118 lines
5.8 KiB
Go
118 lines
5.8 KiB
Go
package system
|
|
|
|
import (
|
|
"f5"
|
|
"q5"
|
|
"strings"
|
|
)
|
|
|
|
type Player struct {
|
|
Idx int64 `json:"idx"`
|
|
Account_id string `gorm:"uniqueIndex;comment:用户id" json:"account_id"`
|
|
Channel string `gorm:"comment:渠道id" json:"channel"`
|
|
Name string `gorm:"comment:用户名" json:"name"`
|
|
Sex int `gorm:"comment:性别" json:"sex"`
|
|
Head_id int `gorm:"comment:头像id" json:"head_id"`
|
|
Head_frame int `gorm:"comment:头像框id" json:"head_frame"`
|
|
Level int `gorm:"comment:等级" json:"level"`
|
|
Exp int `gorm:"comment:经验" json:"exp"`
|
|
Rank int `gorm:"comment:段位" json:"rank"`
|
|
History_best_rank int `gorm:"comment:历史最高段位" json:"history_best_rank"`
|
|
Score int `gorm:"comment:积分" json:"score"`
|
|
History_best_score int `gorm:"comment:历史最高积分" json:"history_best_score"`
|
|
Elo int `gorm:"comment:隐藏elo积分" json:"elo"`
|
|
Bceg int `gorm:"comment:治理代币" json:"bceg"`
|
|
Gold int `gorm:"comment:金币" json:"gold"`
|
|
Diamond int `gorm:"comment:钻石" json:"diamond"`
|
|
Hero_id int `gorm:"comment:当前上阵英雄id" json:"hero_id"`
|
|
First_fight int `gorm:"comment:是否首战" json:"first_fight"`
|
|
Last_season_id int `gorm:"comment:最后一次赛季id" json:"last_season_id"`
|
|
Activated int `gorm:"comment:是否已激活" json:"activated"`
|
|
Rename_count int `gorm:"comment:改名次数" json:"rename_count"`
|
|
Activatetime int `gorm:"comment:激活时间" json:"activatetime"`
|
|
Already_guide int `gorm:"comment:已引导" json:"already_guide"`
|
|
Pve_instance_id int `gorm:"comment:已过pve副本id" json:"pve_instance_id"`
|
|
Like_count int `gorm:"comment:被点赞次数" json:"like_count"`
|
|
Head_list []string `gorm:"comment:拥有的头像列表" json:"head_list"`
|
|
Head_frame_list []string `gorm:"comment:拥有的头像框列表" json:"head_frame_list"`
|
|
Consume_gold int64 `gorm:"comment:消费金币数" json:"consume_gold"`
|
|
Score_modifytime int `gorm:"comment:积分修改时间" json:"score_modifytime"`
|
|
Best_rank_modifytime int `gorm:"comment:积分修改次数" json:"best_rank_modifytime"`
|
|
Createtime int `gorm:"comment:创建时间" json:"createtime"`
|
|
Last_login_time int `gorm:"comment:上次登录时间" json:"last_login_time"`
|
|
Is_gain_item int `gorm:"comment:是否获取免费item道具" json:"is_gain_item"`
|
|
Guild_id string `gorm:"comment:工会id" json:"guild_id"`
|
|
Guild_job int `gorm:"comment:工会职位" json:"guild_job"`
|
|
Guild_name string `gorm:"comment:工会名称" json:"guild_name"`
|
|
Ring_id int `gorm:"comment:戒指id" json:"ring_id"`
|
|
Parachute int `gorm:"comment:降落伞id" json:"parachute"`
|
|
Star_num int `gorm:"comment:星星数(成长任务)" json:"star_num"`
|
|
Address string `gorm:"uniqueIndex;comment:钱包地址" json:"address"`
|
|
Email string `json:"email"`
|
|
}
|
|
|
|
func (this *Player) TableName() string {
|
|
return "t_user"
|
|
}
|
|
|
|
func (this *Player) LoadFromDs(ds *f5.DataSet) {
|
|
this.Idx = q5.ToInt64(ds.GetByName("idx"))
|
|
this.Account_id = ds.GetByName("account_id")
|
|
this.Channel = ds.GetByName("channel")
|
|
this.Name = ds.GetByName("name")
|
|
this.Sex = q5.ToInt(ds.GetByName("sex"))
|
|
this.Head_id = q5.ToInt(ds.GetByName("head_id"))
|
|
this.Head_frame = q5.ToInt(ds.GetByName("head_frame"))
|
|
this.Level = q5.ToInt(ds.GetByName("level"))
|
|
this.Exp = q5.ToInt(ds.GetByName("exp"))
|
|
this.Rank = q5.ToInt(ds.GetByName("rank"))
|
|
this.History_best_rank = q5.ToInt(ds.GetByName("history_best_rank"))
|
|
this.Score = q5.ToInt(ds.GetByName("score"))
|
|
this.History_best_score = q5.ToInt(ds.GetByName("history_best_score"))
|
|
this.Elo = q5.ToInt(ds.GetByName("elo"))
|
|
this.Bceg = q5.ToInt(ds.GetByName("bceg"))
|
|
this.Gold = q5.ToInt(ds.GetByName("gold"))
|
|
this.Diamond = q5.ToInt(ds.GetByName("diamond"))
|
|
this.Hero_id = q5.ToInt(ds.GetByName("hero_id"))
|
|
this.First_fight = q5.ToInt(ds.GetByName("first_fight"))
|
|
this.Last_season_id = q5.ToInt(ds.GetByName("last_season_id"))
|
|
this.Activated = q5.ToInt(ds.GetByName("activated"))
|
|
this.Rename_count = q5.ToInt(ds.GetByName("rename_count"))
|
|
this.Activatetime = q5.ToInt(ds.GetByName("activatetime"))
|
|
this.Already_guide = q5.ToInt(ds.GetByName("already_guide"))
|
|
this.Pve_instance_id = q5.ToInt(ds.GetByName("pve_instance_id"))
|
|
this.Like_count = q5.ToInt(ds.GetByName("like_count"))
|
|
this.Head_list = this.GetPureStringSlice(ds.GetByName("head_list"))
|
|
this.Head_frame_list = this.GetPureStringSlice(ds.GetByName("head_frame_list"))
|
|
this.Consume_gold = q5.ToInt64(ds.GetByName("consume_gold"))
|
|
this.Score_modifytime = q5.ToInt(ds.GetByName("score_modifytime"))
|
|
this.Best_rank_modifytime = q5.ToInt(ds.GetByName("best_rank_modifytime"))
|
|
this.Createtime = q5.ToInt(ds.GetByName("createtime"))
|
|
this.Last_login_time = q5.ToInt(ds.GetByName("last_login_time"))
|
|
this.Is_gain_item = q5.ToInt(ds.GetByName("is_gain_item"))
|
|
this.Guild_id = ds.GetByName("guild_id")
|
|
this.Guild_job = q5.ToInt(ds.GetByName("guild_job"))
|
|
this.Guild_name = ds.GetByName("guild_name")
|
|
this.Ring_id = q5.ToInt(ds.GetByName("ring_id"))
|
|
this.Parachute = q5.ToInt(ds.GetByName("parachute"))
|
|
this.Star_num = q5.ToInt(ds.GetByName("star_num"))
|
|
this.Address = ds.GetByName("address")
|
|
}
|
|
|
|
func (this *Player) GetPureStringSlice(src string) []string {
|
|
if src == "" {
|
|
return []string{}
|
|
}
|
|
|
|
if src[0] == '[' {
|
|
src = src[1:]
|
|
|
|
}
|
|
if src[len(src)-1] == ']' {
|
|
src = src[:len(src)-1]
|
|
}
|
|
src = strings.Replace(src, "\"", "", -1)
|
|
|
|
return q5.StrSplit(src, ",")
|
|
}
|