First merge from develop to main (WIP) #7
@@ -22,6 +22,7 @@ func JWTAuth() gin.HandlerFunc {
|
|||||||
SetEndpoint(exception.EndpointMiddlewareService).
|
SetEndpoint(exception.EndpointMiddlewareService).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUnauthorized).
|
SetOriginal(exception.CommonErrorUnauthorized).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
|
|
||||||
utils.HttpAbort(c, 401, errorCode)
|
utils.HttpAbort(c, 401, errorCode)
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ func Permission(requiredLevel uint) gin.HandlerFunc {
|
|||||||
SetEndpoint(exception.EndpointMiddlewareService).
|
SetEndpoint(exception.EndpointMiddlewareService).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpAbort(c, 500, errorCode)
|
utils.HttpAbort(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -48,6 +49,7 @@ func Permission(requiredLevel uint) gin.HandlerFunc {
|
|||||||
SetEndpoint(exception.EndpointMiddlewareService).
|
SetEndpoint(exception.EndpointMiddlewareService).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUserNotFound).
|
SetOriginal(exception.CommonErrorUserNotFound).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpAbort(c, 404, errorCode)
|
utils.HttpAbort(c, 404, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ func Exchange(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceExchange).
|
SetEndpoint(exception.EndpointAuthServiceExchange).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
@@ -56,6 +57,7 @@ func Exchange(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceExchange).
|
SetEndpoint(exception.EndpointAuthServiceExchange).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -70,6 +72,7 @@ func Exchange(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceExchange).
|
SetEndpoint(exception.EndpointAuthServiceExchange).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthExchangeGetUserIdFailed).
|
SetOriginal(exception.AuthExchangeGetUserIdFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -83,6 +86,7 @@ func Exchange(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceExchange).
|
SetEndpoint(exception.EndpointAuthServiceExchange).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthExchangeCodeGenFailed).
|
SetOriginal(exception.AuthExchangeCodeGenFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -96,6 +100,7 @@ func Exchange(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceExchange).
|
SetEndpoint(exception.EndpointAuthServiceExchange).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthExchangeInvalidRedirectUri).
|
SetOriginal(exception.AuthExchangeInvalidRedirectUri).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ func Magic(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceMagic).
|
SetEndpoint(exception.EndpointAuthServiceMagic).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
@@ -44,6 +45,7 @@ func Magic(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceMagic).
|
SetEndpoint(exception.EndpointAuthServiceMagic).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthMagicTurnstileFailed).
|
SetOriginal(exception.AuthMagicTurnstileFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 403, errorCode)
|
utils.HttpResponse(c, 403, errorCode)
|
||||||
return
|
return
|
||||||
@@ -57,6 +59,7 @@ func Magic(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceMagic).
|
SetEndpoint(exception.EndpointAuthServiceMagic).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthMagicCodeGenFailed).
|
SetOriginal(exception.AuthMagicCodeGenFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -71,6 +74,7 @@ func Magic(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceMagic).
|
SetEndpoint(exception.EndpointAuthServiceMagic).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthMagicInvalidExternalUrl).
|
SetOriginal(exception.AuthMagicInvalidExternalUrl).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -101,6 +105,7 @@ func Magic(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceMagic).
|
SetEndpoint(exception.EndpointAuthServiceMagic).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthMagicInvalidEmailConfig).
|
SetOriginal(exception.AuthMagicInvalidEmailConfig).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInternal).
|
SetOriginal(exception.CommonErrorInternal).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -98,6 +99,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInternal).
|
SetOriginal(exception.CommonErrorInternal).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -113,6 +115,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthRedirectClientNotFound).
|
SetOriginal(exception.AuthRedirectClientNotFound).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
@@ -126,6 +129,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthRedirectUriMismatch).
|
SetOriginal(exception.AuthRedirectUriMismatch).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
@@ -139,6 +143,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInternal).
|
SetOriginal(exception.CommonErrorInternal).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -152,6 +157,7 @@ func Redirect(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthRedirectInvalidUri).
|
SetOriginal(exception.AuthRedirectInvalidUri).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ func Refresh(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRefresh).
|
SetEndpoint(exception.EndpointAuthServiceRefresh).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
@@ -38,6 +39,7 @@ func Refresh(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRefresh).
|
SetEndpoint(exception.EndpointAuthServiceRefresh).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthRefreshInvalidToken).
|
SetOriginal(exception.AuthRefreshInvalidToken).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 401, errorCode)
|
utils.HttpResponse(c, 401, errorCode)
|
||||||
return
|
return
|
||||||
@@ -51,6 +53,7 @@ func Refresh(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceRefresh).
|
SetEndpoint(exception.EndpointAuthServiceRefresh).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthRefreshRenewFailed).
|
SetOriginal(exception.AuthRefreshRenewFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ func Token(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceToken).
|
SetEndpoint(exception.EndpointAuthServiceToken).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
@@ -53,6 +54,7 @@ func Token(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceToken).
|
SetEndpoint(exception.EndpointAuthServiceToken).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInternal).
|
SetOriginal(exception.CommonErrorInternal).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -70,6 +72,7 @@ func Token(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointAuthServiceToken).
|
SetEndpoint(exception.EndpointAuthServiceToken).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.AuthTokenGenFailed).
|
SetOriginal(exception.AuthTokenGenFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ func Checkin(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckin).
|
SetEndpoint(exception.EndpointEventServiceCheckin).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
}
|
}
|
||||||
@@ -59,6 +60,7 @@ func Checkin(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckin).
|
SetEndpoint(exception.EndpointEventServiceCheckin).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -72,6 +74,7 @@ func Checkin(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckin).
|
SetEndpoint(exception.EndpointEventServiceCheckin).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.EventCheckinGenCodeFailed).
|
SetOriginal(exception.EventCheckinGenCodeFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -98,6 +101,7 @@ func CheckinSubmit(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckinSubmit).
|
SetEndpoint(exception.EndpointEventServiceCheckinSubmit).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
@@ -127,6 +131,7 @@ func CheckinQuery(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -152,6 +157,7 @@ func CheckinQuery(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
@@ -167,6 +173,7 @@ func CheckinQuery(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
SetEndpoint(exception.EndpointEventServiceCheckinQuery).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorDatabase).
|
SetOriginal(exception.CommonErrorDatabase).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ func Info(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceInfo).
|
SetEndpoint(exception.EndpointEventServiceInfo).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -47,6 +48,7 @@ func Info(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointEventServiceInfo).
|
SetEndpoint(exception.EndpointEventServiceInfo).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.EventInfoNotFound).
|
SetOriginal(exception.EventInfoNotFound).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 404, errorCode)
|
utils.HttpResponse(c, 404, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ func Full(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceFull).
|
SetEndpoint(exception.EndpointUserServiceFull).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -43,6 +44,7 @@ func Full(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceFull).
|
SetEndpoint(exception.EndpointUserServiceFull).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUserNotFound).
|
SetOriginal(exception.CommonErrorUserNotFound).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 404, errorCode)
|
utils.HttpResponse(c, 404, errorCode)
|
||||||
return
|
return
|
||||||
@@ -56,6 +58,7 @@ func Full(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceFull).
|
SetEndpoint(exception.EndpointUserServiceFull).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorDatabase).
|
SetOriginal(exception.CommonErrorDatabase).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ func Info(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceInfo).
|
SetEndpoint(exception.EndpointUserServiceInfo).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -45,6 +46,7 @@ func Info(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceInfo).
|
SetEndpoint(exception.EndpointUserServiceInfo).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUserNotFound).
|
SetOriginal(exception.CommonErrorUserNotFound).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 404, errorCode)
|
utils.HttpResponse(c, 404, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ func List(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceList).
|
SetEndpoint(exception.EndpointUserServiceList).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
@@ -49,6 +50,7 @@ func List(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceList).
|
SetEndpoint(exception.EndpointUserServiceList).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
@@ -63,6 +65,7 @@ func List(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceList).
|
SetEndpoint(exception.EndpointUserServiceList).
|
||||||
SetType(exception.TypeSpecific).
|
SetType(exception.TypeSpecific).
|
||||||
SetOriginal(exception.UserListMeilisearchFailed).
|
SetOriginal(exception.UserListMeilisearchFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ func Update(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -48,6 +49,7 @@ func Update(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
@@ -62,6 +64,7 @@ func Update(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorUserNotFound).
|
SetOriginal(exception.CommonErrorUserNotFound).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 500, errorCode)
|
utils.HttpResponse(c, 500, errorCode)
|
||||||
return
|
return
|
||||||
@@ -130,6 +133,7 @@ func Update(c *gin.Context) {
|
|||||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||||
SetType(exception.TypeCommon).
|
SetType(exception.TypeCommon).
|
||||||
SetOriginal(exception.CommonErrorInvalidInput).
|
SetOriginal(exception.CommonErrorInvalidInput).
|
||||||
|
SetError(err).
|
||||||
Build()
|
Build()
|
||||||
utils.HttpResponse(c, 400, errorCode)
|
utils.HttpResponse(c, 400, errorCode)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user