refactor: param int

This commit is contained in:
wangfuduo 2026-07-08 17:25:02 +08:00
parent 9cadffd46f
commit c7b7e919ed
1 changed files with 5 additions and 1 deletions

View File

@ -19,6 +19,10 @@ func (p Params) Str(key string) string {
return cast.ToString(p[key]) return cast.ToString(p[key])
} }
func (p Params) Int(key string) int {
return cast.ToInt(p[key])
}
type User struct { type User struct {
sess *session.ApiSession sess *session.ApiSession
params Params params Params
@ -82,7 +86,7 @@ func (u *User) VipCheck() *response.Response {
return nil return nil
} }
free := time.Unix(u.sess.GetUserInfo().ActiveTime, 0).AddDate(0, 0, cast.ToInt(u.params[config.ServiceFreeDay])).Unix() free := time.Unix(u.sess.GetUserInfo().ActiveTime, 0).AddDate(0, 0, u.params.Int(config.ServiceFreeDay)).Unix()
if free-u.sess.GetUserInfo().ActiveTime > 0 { if free-u.sess.GetUserInfo().ActiveTime > 0 {
return nil return nil
} }