fix: user

This commit is contained in:
wangfuduo 2026-07-08 18:07:01 +08:00
parent fe0c4ae276
commit 2a39aec3df
3 changed files with 6 additions and 9 deletions

View File

@ -4,13 +4,10 @@ import (
"net/http" "net/http"
"twin-api/app/api/service" "twin-api/app/api/service"
"git.u8t.cn/open/go-server/session"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
type User struct { type User struct{}
sess *session.ApiSession
}
func (u *User) Verify(ctx *gin.Context) { func (u *User) Verify(ctx *gin.Context) {
res := service.NewUser(ctx).Verify() res := service.NewUser(ctx).Verify()

View File

@ -9,7 +9,7 @@ type Button struct {
param Params param Params
} }
func New(param Params) *Button { func NewButton(param Params) *Button {
return &Button{param: param} return &Button{param: param}
} }

View File

@ -104,9 +104,9 @@ func (u *User) VipCheck() *response.Response {
if u.params[payWayKey] == config.FirstRechargeByCoupon { if u.params[payWayKey] == config.FirstRechargeByCoupon {
resp.Message(u.params.Str(config.ServerCouponNotice)). resp.Message(u.params.Str(config.ServerCouponNotice)).
Button(New(u.params).CouponButton()...) Button(NewButton(u.params).CouponButton()...)
} else { } 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). return u.resp(config.UerNoPkg, config.ServiceUserPackageLack).
Closable(false). Closable(false).
Button(New(u.params).LackButton()...) Button(NewButton(u.params).LackButton()...)
} }
// 先判断是否强制更新expireCheck 已设置强制更新文案且不可关闭,直接返回 // 先判断是否强制更新expireCheck 已设置强制更新文案且不可关闭,直接返回
@ -186,7 +186,7 @@ func (u *User) expireCheck(userPkg *model.UserPkgInfo, day int) *response.Respon
resp = u.resp(config.NeedUpgrade, msgKey). resp = u.resp(config.NeedUpgrade, msgKey).
Closable(false). Closable(false).
Button(New(u.params).UpgradeButton(pkg.Link)...) Button(NewButton(u.params).UpgradeButton(pkg.Link)...)
} }
return resp return resp