feat:优化信息

This commit is contained in:
henry
2021-12-22 14:53:45 +08:00
parent 332f67d1c1
commit 4743481ef8
5 changed files with 27 additions and 24 deletions

View File

@ -20,7 +20,7 @@ type (
Avatar string `json:"avatar"` // 头像
Name string `json:"name"` // 名称
Currency float64 `json:"currency"` // 创新币
Vip bool `json:"vip"` // Vip状态
Vip int `json:"vip"` // Vip
VipDays int `json:"vip_days"` // Vip剩余天数
Identity int `json:"identity"` // 具体身份
SelectIdentity int `json:"select_identity"` // 最后一次选中的身份信息
@ -38,11 +38,11 @@ type (
func (c *Instance) Info() *InstanceInfo {
out := &InstanceInfo{Avatar: c.Avatar, Name: c.Name,
Currency: c.Currency,
Vip: c.VipStatus(),
Identity: c.Identity,
SelectIdentity: c.SelectIdentity}
if out.Vip {
if c.IsVip() {
out.Vip = c.Vip
out.VipDays = utils.DiffTimeDays(time.Now(), c.VipDeadline)
}
return out