aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-04-30 16:52:55 +0800
committercrupest <crupest@outlook.com>2021-04-30 16:52:55 +0800
commita672e10faad434899d81ef9d0d0d5adbbc7841da (patch)
tree33c18e4bdad7384c748cf08be1f0569f9a8af619 /BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs
parentb87abbb8ed0aa86a808b2f97e4d22b0ee1addd9f (diff)
downloadtimeline-a672e10faad434899d81ef9d0d0d5adbbc7841da.tar.gz
timeline-a672e10faad434899d81ef9d0d0d5adbbc7841da.tar.bz2
timeline-a672e10faad434899d81ef9d0d0d5adbbc7841da.zip
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs')
-rw-r--r--BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs b/BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs
new file mode 100644
index 00000000..76a8b7ae
--- /dev/null
+++ b/BackEnd/Timeline/Controllers/ActionResultControllerExtensions.cs
@@ -0,0 +1,13 @@
+using Microsoft.AspNetCore.Mvc;
+using Timeline.Models.Http;
+
+namespace Timeline.Controllers
+{
+ public static class ActionResultControllerExtensions
+ {
+ public static BadRequestObjectResult BadRequestWithCodeAndMessage(this ControllerBase controller, int code, string message)
+ {
+ return controller.BadRequest(new CommonResponse(code, message));
+ }
+ }
+}