32 lines
889 B
Go
32 lines
889 B
Go
package vo
|
|
|
|
import (
|
|
"main/model"
|
|
)
|
|
|
|
type User struct {
|
|
AccountId string `json:"account_id"`
|
|
NickName string `json:"nickname"`
|
|
Avatar string `json:"avatar"`
|
|
Score int64 `json:"score"`
|
|
HourlyEarnings string `json:"hourly_earnings"`
|
|
Dice int32 `json:"dice"`
|
|
SpecDice int32 `json:"spec_dice"`
|
|
CurrGrid int32 `json:"curr_grid"`
|
|
LastPresentDiceTime int32 `json:"last_present_dice_time"`
|
|
AwardGrids []int32 `json:"award_grids"`
|
|
}
|
|
|
|
func (this *User) FromModel(m *model.User) {
|
|
this.AccountId = m.AccountId
|
|
this.NickName = m.NickName
|
|
this.Avatar = m.Avatar
|
|
this.Score = m.Score
|
|
this.HourlyEarnings = "0"
|
|
this.Dice = m.Dice
|
|
this.SpecDice = m.SpecDice
|
|
this.CurrGrid = m.CurrGrid
|
|
this.LastPresentDiceTime = m.LastPresentDiceTime
|
|
this.AwardGrids = m.AwardGridsList
|
|
}
|