From 2f26b2ddb59ae86d94d004894001408dff412226 Mon Sep 17 00:00:00 2001 From: Asai Neko Date: Wed, 21 Jan 2026 14:58:23 +0800 Subject: [PATCH] Fix stupid ai errors Signed-off-by: Asai Neko --- service/auth/exchange.go | 6 +++--- service/auth/magic.go | 4 ++-- service/auth/redirect.go | 14 +++++++------- service/auth/refresh.go | 4 ++-- service/auth/token.go | 4 ++-- service/event/checkin.go | 10 +++++----- service/event/info.go | 4 ++-- service/user/list.go | 6 +++--- service/user/update.go | 12 ++++++------ 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/service/auth/exchange.go b/service/auth/exchange.go index 6f5e7bc..6a750a7 100644 --- a/service/auth/exchange.go +++ b/service/auth/exchange.go @@ -25,7 +25,7 @@ func Exchange(c *gin.Context) { if err != nil { fmt.Println(err) errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceExchange). SetType(exception.TypeCommon). @@ -39,7 +39,7 @@ func Exchange(c *gin.Context) { userIdOrig, ok := c.Get("user_id") if !ok { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceExchange). SetType(exception.TypeCommon). @@ -95,7 +95,7 @@ func Exchange(c *gin.Context) { url, err := url.Parse(exchangeReq.RedirectUri) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceExchange). SetType(exception.TypeSpecific). diff --git a/service/auth/magic.go b/service/auth/magic.go index bd4c0f3..799e4ce 100644 --- a/service/auth/magic.go +++ b/service/auth/magic.go @@ -25,7 +25,7 @@ func Magic(c *gin.Context) { var req MagicRequest if err := c.ShouldBindJSON(&req); err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceMagic). SetType(exception.TypeCommon). @@ -40,7 +40,7 @@ func Magic(c *gin.Context) { ok, err := turnstile.VerifyTurnstile(req.TurnstileToken, c.ClientIP()) if err != nil || !ok { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceMagic). SetType(exception.TypeSpecific). diff --git a/service/auth/redirect.go b/service/auth/redirect.go index 11ee995..d99fc3d 100644 --- a/service/auth/redirect.go +++ b/service/auth/redirect.go @@ -16,7 +16,7 @@ func Redirect(c *gin.Context) { clientId := c.Query("client_id") if clientId == "" { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceRedirect). SetType(exception.TypeCommon). @@ -29,7 +29,7 @@ func Redirect(c *gin.Context) { redirectUri := c.Query("redirect_uri") if redirectUri == "" { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceRedirect). SetType(exception.TypeCommon). @@ -42,7 +42,7 @@ func Redirect(c *gin.Context) { state := c.Query("state") if state == "" { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceRedirect). SetType(exception.TypeCommon). @@ -58,7 +58,7 @@ func Redirect(c *gin.Context) { authCode, ok := authcode.VerifyAuthCode(code) if !ok { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceRedirect). SetType(exception.TypeSpecific). @@ -110,7 +110,7 @@ func Redirect(c *gin.Context) { client, err := clientData.GetClientByClientId(clientId) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceRedirect). SetType(exception.TypeSpecific). @@ -124,7 +124,7 @@ func Redirect(c *gin.Context) { err = client.ValidateRedirectURI(redirectUri) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceRedirect). SetType(exception.TypeSpecific). @@ -152,7 +152,7 @@ func Redirect(c *gin.Context) { url, err := url.Parse(redirectUri) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceRedirect). SetType(exception.TypeSpecific). diff --git a/service/auth/refresh.go b/service/auth/refresh.go index 54020cc..809c2f0 100644 --- a/service/auth/refresh.go +++ b/service/auth/refresh.go @@ -16,7 +16,7 @@ func Refresh(c *gin.Context) { if err := c.ShouldBindJSON(&req); err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceRefresh). SetType(exception.TypeCommon). @@ -34,7 +34,7 @@ func Refresh(c *gin.Context) { accessToken, err := JwtTool.RefreshAccessToken(req.RefreshToken) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceRefresh). SetType(exception.TypeSpecific). diff --git a/service/auth/token.go b/service/auth/token.go index 3950eb3..ca5482f 100644 --- a/service/auth/token.go +++ b/service/auth/token.go @@ -21,7 +21,7 @@ func Token(c *gin.Context) { err := c.ShouldBindJSON(&req) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceToken). SetType(exception.TypeCommon). @@ -35,7 +35,7 @@ func Token(c *gin.Context) { authCode, ok := authcode.VerifyAuthCode(req.Code) if !ok { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceAuth). SetEndpoint(exception.EndpointAuthServiceToken). SetType(exception.TypeSpecific). diff --git a/service/event/checkin.go b/service/event/checkin.go index fbbea66..c482b7a 100644 --- a/service/event/checkin.go +++ b/service/event/checkin.go @@ -41,7 +41,7 @@ func Checkin(c *gin.Context) { eventIdOrig, ok := c.GetQuery("event_id") if !ok { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceEvent). SetEndpoint(exception.EndpointEventServiceCheckin). SetType(exception.TypeCommon). @@ -96,7 +96,7 @@ func CheckinSubmit(c *gin.Context) { err := attendanceData.VerifyCheckinCode(req.ChekinCode) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceEvent). SetEndpoint(exception.EndpointEventServiceCheckinSubmit). SetType(exception.TypeCommon). @@ -140,7 +140,7 @@ func CheckinQuery(c *gin.Context) { eventIdOrig, ok := c.GetQuery("event_id") if !ok { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceEvent). SetEndpoint(exception.EndpointEventServiceCheckinQuery). SetType(exception.TypeCommon). @@ -152,7 +152,7 @@ func CheckinQuery(c *gin.Context) { eventId, err := uuid.Parse(eventIdOrig) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceEvent). SetEndpoint(exception.EndpointEventServiceCheckinQuery). SetType(exception.TypeCommon). @@ -179,7 +179,7 @@ func CheckinQuery(c *gin.Context) { return } else if attendance == nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceEvent). SetEndpoint(exception.EndpointEventServiceCheckinQuery). SetType(exception.TypeSpecific). diff --git a/service/event/info.go b/service/event/info.go index b8d8362..c71d98b 100644 --- a/service/event/info.go +++ b/service/event/info.go @@ -15,7 +15,7 @@ func Info(c *gin.Context) { eventIdOrig, ok := c.GetQuery("event_id") if !ok { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceEvent). SetEndpoint(exception.EndpointEventServiceInfo). SetType(exception.TypeCommon). @@ -43,7 +43,7 @@ func Info(c *gin.Context) { event, err := eventData.GetEventById(eventId) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceEvent). SetEndpoint(exception.EndpointEventServiceInfo). SetType(exception.TypeSpecific). diff --git a/service/user/list.go b/service/user/list.go index 1698635..9450b6b 100644 --- a/service/user/list.go +++ b/service/user/list.go @@ -18,7 +18,7 @@ func List(c *gin.Context) { offset, ok := c.GetQuery("offset") if !ok { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceUser). SetEndpoint(exception.EndpointUserServiceList). SetType(exception.TypeCommon). @@ -32,7 +32,7 @@ func List(c *gin.Context) { limitNum, err := strconv.ParseInt(limit, 10, 64) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceUser). SetEndpoint(exception.EndpointUserServiceList). SetType(exception.TypeCommon). @@ -45,7 +45,7 @@ func List(c *gin.Context) { offsetNum, err := strconv.ParseInt(offset, 10, 64) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceUser). SetEndpoint(exception.EndpointUserServiceList). SetType(exception.TypeCommon). diff --git a/service/user/update.go b/service/user/update.go index 1147cd7..9ba9f3a 100644 --- a/service/user/update.go +++ b/service/user/update.go @@ -44,7 +44,7 @@ func Update(c *gin.Context) { err = c.ShouldBindJSON(&ReqInfo) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceUser). SetEndpoint(exception.EndpointUserServiceUpdate). SetType(exception.TypeCommon). @@ -82,7 +82,7 @@ func Update(c *gin.Context) { if ReqInfo.Username != "" { if len(ReqInfo.Username) < 5 || len(ReqInfo.Username) >= 255 { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceUser). SetEndpoint(exception.EndpointUserServiceUpdate). SetType(exception.TypeCommon). @@ -97,7 +97,7 @@ func Update(c *gin.Context) { if ReqInfo.Nickname != "" { if utf8.RuneCountInString(ReqInfo.Nickname) > 24 { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceUser). SetEndpoint(exception.EndpointUserServiceUpdate). SetType(exception.TypeCommon). @@ -112,7 +112,7 @@ func Update(c *gin.Context) { if ReqInfo.Subtitle != "" { if utf8.RuneCountInString(ReqInfo.Subtitle) > 32 { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceUser). SetEndpoint(exception.EndpointUserServiceUpdate). SetType(exception.TypeCommon). @@ -128,7 +128,7 @@ func Update(c *gin.Context) { _, err := url.ParseRequestURI(ReqInfo.Avatar) if err != nil { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceUser). SetEndpoint(exception.EndpointUserServiceUpdate). SetType(exception.TypeCommon). @@ -144,7 +144,7 @@ func Update(c *gin.Context) { if ReqInfo.Bio != "" { if !cryptography.IsBase64Std(ReqInfo.Bio) { errorCode := new(exception.Builder). - SetStatus(exception.StatusClient). + SetStatus(exception.StatusUser). SetService(exception.ServiceUser). SetEndpoint(exception.EndpointUserServiceUpdate). SetType(exception.TypeCommon).