From 2a39aec3dfa2dc265cd479cd4f1c2074b961bd17 Mon Sep 17 00:00:00 2001 From: wangfuduo Date: Wed, 8 Jul 2026 18:07:01 +0800 Subject: [PATCH] fix: user --- app/api/controller/user.go | 5 +---- app/api/service/button.go | 2 +- app/api/service/user.go | 8 ++++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/api/controller/user.go b/app/api/controller/user.go index 13bea7a..72fd150 100644 --- a/app/api/controller/user.go +++ b/app/api/controller/user.go @@ -4,13 +4,10 @@ import ( "net/http" "twin-api/app/api/service" - "git.u8t.cn/open/go-server/session" "github.com/gin-gonic/gin" ) -type User struct { - sess *session.ApiSession -} +type User struct{} func (u *User) Verify(ctx *gin.Context) { res := service.NewUser(ctx).Verify() diff --git a/app/api/service/button.go b/app/api/service/button.go index 958db23..16fcbd2 100644 --- a/app/api/service/button.go +++ b/app/api/service/button.go @@ -9,7 +9,7 @@ type Button struct { param Params } -func New(param Params) *Button { +func NewButton(param Params) *Button { return &Button{param: param} } diff --git a/app/api/service/user.go b/app/api/service/user.go index a9148e0..bbdfd14 100644 --- a/app/api/service/user.go +++ b/app/api/service/user.go @@ -104,9 +104,9 @@ func (u *User) VipCheck() *response.Response { if u.params[payWayKey] == config.FirstRechargeByCoupon { resp.Message(u.params.Str(config.ServerCouponNotice)). - Button(New(u.params).CouponButton()...) + Button(NewButton(u.params).CouponButton()...) } else { - resp.Button(New(u.params).PayButton()...) + resp.Button(NewButton(u.params).PayButton()...) } } @@ -134,7 +134,7 @@ func (u *User) PkgCheck() *response.Response { } return u.resp(config.UerNoPkg, config.ServiceUserPackageLack). Closable(false). - Button(New(u.params).LackButton()...) + Button(NewButton(u.params).LackButton()...) } // 先判断是否强制更新:expireCheck 已设置强制更新文案且不可关闭,直接返回 @@ -186,7 +186,7 @@ func (u *User) expireCheck(userPkg *model.UserPkgInfo, day int) *response.Respon resp = u.resp(config.NeedUpgrade, msgKey). Closable(false). - Button(New(u.params).UpgradeButton(pkg.Link)...) + Button(NewButton(u.params).UpgradeButton(pkg.Link)...) } return resp