feat: management && notify

This commit is contained in:
fallen-angle
2022-05-04 20:06:21 +08:00
parent e58bafd0d3
commit 7598280fc1
28 changed files with 1226 additions and 143 deletions

View File

@@ -9,11 +9,13 @@ import (
// This file is define some business error
const (
BAD_REQUEST = "Bad Request"
DATA_NOT_FOUND = "Data not Found"
STATUS_DATA_NOT_FOUND = 210
FORBIDDENT = "FORBIDDENT"
PAGE_NOT_FOUND = "404 page not found"
BAD_REQUEST = "Bad Request"
DATA_NOT_FOUND = "Data not Found"
STATUS_DATA_NOT_FOUND = 210
FORBIDDENT = "FORBIDDENT"
PAGE_NOT_FOUND = "404 page not found"
STATUS_OPERATION_FAILED = 410
OPERATION_FAILED = "operation failed"
)
func RequestError(c *gin.Context, code int, data interface{}) {
@@ -40,3 +42,7 @@ func Forbidden(c *gin.Context) {
func UrlNotFound(c *gin.Context) {
c.String(http.StatusNotFound, PAGE_NOT_FOUND)
}
func OperationFailed(c *gin.Context) {
c.String(STATUS_OPERATION_FAILED, OPERATION_FAILED)
}