First merge from develop to main (WIP) #7
@@ -1,6 +1,7 @@
|
|||||||
package exception
|
package exception
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -50,7 +51,7 @@ func (self *Builder) SetError(e error) *Builder {
|
|||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Builder) Build() string {
|
func (self *Builder) Build(ctx context.Context) string {
|
||||||
errorCode := fmt.Sprintf("%s%s%s%s%s",
|
errorCode := fmt.Sprintf("%s%s%s%s%s",
|
||||||
self.Status,
|
self.Status,
|
||||||
self.Service,
|
self.Service,
|
||||||
@@ -59,7 +60,7 @@ func (self *Builder) Build() string {
|
|||||||
self.Original,
|
self.Original,
|
||||||
)
|
)
|
||||||
if self.Error != nil {
|
if self.Error != nil {
|
||||||
ErrorHandler(self.Status, errorCode, self.Error)
|
ErrorHandler(ctx, self.Status, errorCode, self.Error)
|
||||||
}
|
}
|
||||||
return errorCode
|
return errorCode
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
package exception
|
package exception
|
||||||
|
|
||||||
import "log/slog"
|
import (
|
||||||
|
"context"
|
||||||
|
"log/slog"
|
||||||
|
)
|
||||||
|
|
||||||
func ErrorHandler(status string, errorCode string, err error) {
|
func ErrorHandler(ctx context.Context, status string, errorCode string, err error) {
|
||||||
switch status {
|
switch status {
|
||||||
case StatusSuccess:
|
case StatusSuccess:
|
||||||
slog.Info("Service exception", "id", errorCode, "err", err)
|
slog.InfoContext(ctx, "Service exception! ErrId: "+errorCode, "id", errorCode, "err", err)
|
||||||
case StatusUser:
|
case StatusUser:
|
||||||
slog.Warn("Service exception", "id", errorCode, "err", err)
|
slog.WarnContext(ctx, "Service exception! ErrId: "+errorCode, "id", errorCode, "err", err)
|
||||||
case StatusServer:
|
case StatusServer:
|
||||||
slog.Error("Service exception", "id", errorCode, "err", err)
|
slog.ErrorContext(ctx, "Service exception! ErrId: "+errorCode, "id", errorCode, "err", err)
|
||||||
case StatusClient:
|
case StatusClient:
|
||||||
slog.Error("Service exception", "id", errorCode, "err", err)
|
slog.ErrorContext(ctx, "Service exception! ErrId: "+errorCode, "id", errorCode, "err", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ func ApiVersionCheck() gin.HandlerFunc {
|
|||||||
SetEndpoint(exception.EndpointMiddlewareService).
|
SetEndpoint(exception.EndpointMiddlewareService).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.ApiVersionNotFound).
|
SetOriginal(exception.ApiVersionNotFound).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpAbort(c, 400, errorCode)
|
utils.HttpAbort(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ func JWTAuth() gin.HandlerFunc {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUnauthorized).
|
SetOriginal(exception.CommonErrorUnauthorized).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
|
|
||||||
utils.HttpAbort(c, 401, errorCode)
|
utils.HttpAbort(c, 401, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ func Permission(requiredLevel uint) gin.HandlerFunc {
|
|||||||
SetEndpoint(exception.EndpointMiddlewareService).
|
SetEndpoint(exception.EndpointMiddlewareService).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorMissingUserId).
|
SetOriginal(exception.CommonErrorMissingUserId).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpAbort(c, 401, errorCode)
|
utils.HttpAbort(c, 401, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ func Permission(requiredLevel uint) gin.HandlerFunc {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpAbort(c, 500, errorCode)
|
utils.HttpAbort(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ func Permission(requiredLevel uint) gin.HandlerFunc {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUserNotFound).
|
SetOriginal(exception.CommonErrorUserNotFound).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpAbort(c, 404, errorCode)
|
utils.HttpAbort(c, 404, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ func Permission(requiredLevel uint) gin.HandlerFunc {
|
|||||||
SetEndpoint(exception.EndpointMiddlewareService).
|
SetEndpoint(exception.EndpointMiddlewareService).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorPermissionDenied).
|
SetOriginal(exception.CommonErrorPermissionDenied).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpAbort(c, 403, errorCode)
|
utils.HttpAbort(c, 403, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ func Exchange(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ func Exchange(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceExchange).
|
SetEndpoint(exception.EndpointAuthServiceExchange).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUnauthorized).
|
SetOriginal(exception.CommonErrorUnauthorized).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 401, errorCode)
|
utils.HttpResponse(c, 401, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ func Exchange(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ func Exchange(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthExchangeGetUserIdFailed).
|
SetOriginal(exception.AuthExchangeGetUserIdFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ func Exchange(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthExchangeCodeGenFailed).
|
SetOriginal(exception.AuthExchangeCodeGenFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ func Exchange(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthExchangeInvalidRedirectUri).
|
SetOriginal(exception.AuthExchangeInvalidRedirectUri).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -119,6 +119,6 @@ func Exchange(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceExchange).
|
SetEndpoint(exception.EndpointAuthServiceExchange).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonSuccess).
|
SetOriginal(exception.CommonSuccess).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 200, errorCode, exchangeResp)
|
utils.HttpResponse(c, 200, errorCode, exchangeResp)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ func Magic(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ func Magic(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthMagicTurnstileFailed).
|
SetOriginal(exception.AuthMagicTurnstileFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 403, errorCode)
|
utils.HttpResponse(c, 403, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ func Magic(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthMagicCodeGenFailed).
|
SetOriginal(exception.AuthMagicCodeGenFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ func Magic(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthMagicInvalidExternalUrl).
|
SetOriginal(exception.AuthMagicInvalidExternalUrl).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ func Magic(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthMagicInvalidEmailConfig).
|
SetOriginal(exception.AuthMagicInvalidEmailConfig).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -124,6 +124,6 @@ func Magic(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceMagic).
|
SetEndpoint(exception.EndpointAuthServiceMagic).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonSuccess).
|
SetOriginal(exception.CommonSuccess).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 200, errorCode)
|
utils.HttpResponse(c, 200, errorCode)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthRedirectTokenInvalid).
|
SetOriginal(exception.AuthRedirectTokenInvalid).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 403, errorCode)
|
utils.HttpResponse(c, 403, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInternal).
|
SetOriginal(exception.CommonErrorInternal).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInternal).
|
SetOriginal(exception.CommonErrorInternal).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthRedirectClientNotFound).
|
SetOriginal(exception.AuthRedirectClientNotFound).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthRedirectUriMismatch).
|
SetOriginal(exception.AuthRedirectUriMismatch).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInternal).
|
SetOriginal(exception.CommonErrorInternal).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthRedirectInvalidUri).
|
SetOriginal(exception.AuthRedirectInvalidUri).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ func Refresh(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ func Refresh(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthRefreshInvalidToken).
|
SetOriginal(exception.AuthRefreshInvalidToken).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 401, errorCode)
|
utils.HttpResponse(c, 401, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ func Refresh(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthRefreshRenewFailed).
|
SetOriginal(exception.AuthRefreshRenewFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -70,6 +70,6 @@ func Refresh(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRefresh).
|
SetEndpoint(exception.EndpointAuthServiceRefresh).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonSuccess).
|
SetOriginal(exception.CommonSuccess).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 200, errorCode, tokenResp)
|
utils.HttpResponse(c, 200, errorCode, tokenResp)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ func Token(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ func Token(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceToken).
|
SetEndpoint(exception.EndpointAuthServiceToken).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthTokenInvalidToken).
|
SetOriginal(exception.AuthTokenInvalidToken).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 403, errorCode)
|
utils.HttpResponse(c, 403, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ func Token(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInternal).
|
SetOriginal(exception.CommonErrorInternal).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ func Token(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthTokenGenFailed).
|
SetOriginal(exception.AuthTokenGenFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -89,6 +89,6 @@ func Token(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceToken).
|
SetEndpoint(exception.EndpointAuthServiceToken).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonSuccess).
|
SetOriginal(exception.CommonSuccess).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 200, errorCode, tokenResp)
|
utils.HttpResponse(c, 200, errorCode, tokenResp)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func Checkin(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckin).
|
SetEndpoint(exception.EndpointEventServiceCheckin).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorMissingUserId).
|
SetOriginal(exception.CommonErrorMissingUserId).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 403, errorCode)
|
utils.HttpResponse(c, 403, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ func Checkin(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ func Checkin(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckin).
|
SetEndpoint(exception.EndpointEventServiceCheckin).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ func Checkin(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ func Checkin(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.EventCheckinGenCodeFailed).
|
SetOriginal(exception.EventCheckinGenCodeFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ func CheckinSubmit(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@ func CheckinQuery(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorMissingUserId).
|
SetOriginal(exception.CommonErrorMissingUserId).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ func CheckinQuery(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ func CheckinQuery(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ func CheckinQuery(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ func CheckinQuery(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorDatabase).
|
SetOriginal(exception.CommonErrorDatabase).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
} else if attendance == nil {
|
} else if attendance == nil {
|
||||||
@@ -184,7 +184,7 @@ func CheckinQuery(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.EventCheckinQueryRecordNotFound).
|
SetOriginal(exception.EventCheckinQueryRecordNotFound).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 404, errorCode)
|
utils.HttpResponse(c, 404, errorCode)
|
||||||
return
|
return
|
||||||
} else if attendance.CheckinAt.IsZero() {
|
} else if attendance.CheckinAt.IsZero() {
|
||||||
@@ -202,6 +202,6 @@ func CheckinQuery(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonSuccess).
|
SetOriginal(exception.CommonSuccess).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 200, errorCode, checkInAtResp)
|
utils.HttpResponse(c, 200, errorCode, checkInAtResp)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func Info(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceInfo).
|
SetEndpoint(exception.EndpointEventServiceInfo).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,7 @@ func Info(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,7 @@ func Info(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.EventInfoNotFound).
|
SetOriginal(exception.EventInfoNotFound).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 404, errorCode)
|
utils.HttpResponse(c, 404, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -66,6 +66,6 @@ func Info(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceInfo).
|
SetEndpoint(exception.EndpointEventServiceInfo).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonSuccess).
|
SetOriginal(exception.CommonSuccess).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 200, errorCode, eventInfoResp)
|
utils.HttpResponse(c, 200, errorCode, eventInfoResp)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ func Full(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceFull).
|
SetEndpoint(exception.EndpointUserServiceFull).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorMissingUserId).
|
SetOriginal(exception.CommonErrorMissingUserId).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 403, errorCode)
|
utils.HttpResponse(c, 403, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ func Full(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ func Full(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUserNotFound).
|
SetOriginal(exception.CommonErrorUserNotFound).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 404, errorCode)
|
utils.HttpResponse(c, 404, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ func Full(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorDatabase).
|
SetOriginal(exception.CommonErrorDatabase).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -73,6 +73,6 @@ func Full(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceFull).
|
SetEndpoint(exception.EndpointUserServiceFull).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonSuccess).
|
SetOriginal(exception.CommonSuccess).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 200, errorCode, userFullResp)
|
utils.HttpResponse(c, 200, errorCode, userFullResp)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func Info(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceInfo).
|
SetEndpoint(exception.EndpointUserServiceInfo).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorMissingUserId).
|
SetOriginal(exception.CommonErrorMissingUserId).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 403, errorCode)
|
utils.HttpResponse(c, 403, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ func Info(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@ func Info(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUserNotFound).
|
SetOriginal(exception.CommonErrorUserNotFound).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 404, errorCode)
|
utils.HttpResponse(c, 404, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -69,6 +69,6 @@ func Info(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceInfo).
|
SetEndpoint(exception.EndpointUserServiceInfo).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonSuccess).
|
SetOriginal(exception.CommonSuccess).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 200, errorCode, userInfoResp)
|
utils.HttpResponse(c, 200, errorCode, userInfoResp)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ func List(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceList).
|
SetEndpoint(exception.EndpointUserServiceList).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,7 @@ func List(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ func List(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ func List(c *gin.Context) {
|
|||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.UserListMeilisearchFailed).
|
SetOriginal(exception.UserListMeilisearchFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,6 +79,6 @@ func List(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceList).
|
SetEndpoint(exception.EndpointUserServiceList).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonSuccess).
|
SetOriginal(exception.CommonSuccess).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 200, errorCode, userListResp)
|
utils.HttpResponse(c, 200, errorCode, userListResp)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ func Update(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorMissingUserId).
|
SetOriginal(exception.CommonErrorMissingUserId).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 403, errorCode)
|
utils.HttpResponse(c, 403, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,7 @@ func Update(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ func Update(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ func Update(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUserNotFound).
|
SetOriginal(exception.CommonErrorUserNotFound).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ func Update(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ func Update(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ func Update(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -134,7 +134,7 @@ func Update(c *gin.Context) {
|
|||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
SetError(err).
|
SetError(err).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ func Update(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -165,6 +165,6 @@ func Update(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonSuccess).
|
SetOriginal(exception.CommonSuccess).
|
||||||
Build()
|
Build(c)
|
||||||
utils.HttpResponse(c, 200, errorCode)
|
utils.HttpResponse(c, 200, errorCode)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user