package model import ( "time" ) const ( UserNormalStatus = 1 // 正常 UserFreezeStatus = 2 // 冻结 ) type User struct { Avatar string `json:"avatar"` // 头像 Birthday int64 `json:"birthday"` // 出生日期 Code string `json:"code"` // 邀请码 Country string `json:"country"` // 国家 CountryIcon string `json:"country_icon"` // 国旗图标地址 CreatedTime time.Time `json:"created_time"` // CreatedTime DefaultAvatar int `json:"default_avatar"` // DefaultAvatar Description string `json:"description"` // 个性签名 DeviceType string `json:"device_type"` // ios,Android ExternalId string `json:"external_id"` // 别名 Id int64 `json:"id"` // id IsPush int `json:"is_push"` // IsPush IsShowAge int `json:"is_show_age"` // IsShowAge Language string `json:"language"` // Language LogoutTime int64 `json:"logout_time"` // LogoutTime Nick string `json:"nick"` // 昵称 OriginCode string `json:"origin_code"` // 原始邀请码 Sex int `json:"sex"` // 性别 Status int8 `json:"status"` // 状态 UpdatedTime time.Time `json:"updated_time"` // UpdatedTime } func (u *User) TableName() string { return "user" } func (u *User) IsPrettyCode() bool { return u.Code != u.OriginCode } // CvUserDetail 用户详细信息 type CvUserDetail struct { CvUserBase //统计:我喜欢多少人 ILikeCount int `json:"iLikeCount"` //统计:多少人喜欢你, (本才才有数据,不是本人,数据为nil) LikeCount int `json:"likeCount"` //统计:多少人访问你 VisitCount int `json:"visitCount"` //消息提醒, 1:开启,2:关闭 IsPush uint8 `json:"isPush"` //钻石数量(本人才有数据,不是本人,数据为nil)???? 用0 或者-1 不用那么费事 DiamondNum int `json:"diamondNum"` //是否喜欢(本人没有数据,//20210205 已废弃nil,产品说:可以自己喜欢自己) IsLike bool `json:"isLike"` //是否存在会话(本人没有数据) IsSession bool `json:"isSession"` //ID //ID *mysql.ID `json:"id,omitempty"` //是否工会成员, 只有是自己查自己,这个才有值,其它全为nil //IsTradeUnion *bool `json:"isTradeUnion"` //工会成员,是否开启了,匹配通知,只有 isTradeUnion值为true,这里才有值, //IsTradeUnionMatchNotification *bool `json:"isTradeUnionMatchNotification"` //是否可以免费通话,自己本人没有数据 //IsVideoFreeCan *bool `json:"isVideoCanFree"` //别人是否喜欢我,自己本人没有数据 (20210205 已废弃nil,产品说:可以自己喜欢自己) IsLikeMe bool `json:"isLikeMe"` HeartValue uint32 `json:"heartValue"` // 与我之间永恒之心的值 HeartValueMax uint32 `json:"heartValueMax"` // 与我之间永恒之心的最大值(0代表没有永恒之心,即没有相互关注) MeetDays uint `json:"meetDays"` // 成长关系建立的时间(天数) WealthUserGrade int `json:"wealthUserGrade"` //财富等级 CharmUserGrade int `json:"charmUserGrade"` //魅力等级 ActivityUserGrade int `json:"activityUserGrade"` //活跃等级 CurrentRoom string `json:"currentRoom"` // 当前用户所在房间(产品叫“群组”) MyGroupPower int64 `json:"myGroupPower"` // 当前用户所在势力 MyGroupPowerName string `json:"myGroupPowerName"` // 当前用户所在势力绑定群组的名称 } // CvUserBase 用户基本信息 type CvUserBase struct { //不会有返回值 Id int64 `json:"id,omitempty"` //头像,不存在为nil Avatar string `json:"avatar"` //是否默认头像 true:是 false:不是 DefaultAvatar bool `json:"defaultAvatar"` //用户对外ID ExternalId string `json:"externalId"` //昵称,不存在为nil Nick string `json:"nick"` //签名,不存在为nil Description string `json:"description"` //性别 1:男 2:女,不存在为nil Sex uint8 `json:"sex"` //国家,不存在为nil Country string `json:"country"` //国旗图标,不存在为nil CountryIcon string `json:"countryIcon"` //邀请码 Code string `json:"code"` IsPrettyCode bool `json:"isPrettyCode"` // 是否靓号 IsLogout bool `json:"isLogout"` //是否注销 //生日,如果是其它人用户信息,年龄则按照是否展示显示,如果是本人,年龄则按照是否存在展示 Birthday int64 `json:"birthday"` //是否展示年龄, 是本人才有数据,看其他用户均为nil IsShowAge uint8 `json:"isShowAge"` //是否工会成员, 只有是自己查自己,这个才有值,其它全为nil, 20220329 数据开放:原因:产品1对1视频聊天中,公会用户视频需要送礼物。改为: 全部人可以知道是否是公会用户。 IsTradeUnion bool `json:"isTradeUnion"` //是否代理管理员, 只有自己查自己的时候才有值,其他情况为nil IsAgentMgr bool `json:"isAgentMgr"` //工会成员,是否开启了,匹配通知,只有 isTradeUnion值为true,这里才有值, IsTradeUnionMatchNotification bool `json:"isTradeUnionMatchNotification"` //是否VIP用户 IsVip bool `json:"isVip"` //是否是官方人员 IsOfficialStaff bool `json:"isOfficialStaff"` //VIP用户过期时间(只有自己查询自己,才返回) VipExpireTime int64 `json:"vipExpireTime"` Medals []int `json:"medals"` // 勋章列表 TODO: 删除 MedalInfo []*CvMedal `json:"medalInfo"` // 勋章列表 Headwear *CvHeadwear `json:"headwear"` // 当前使用的头饰 Ride *CvProperty `json:"ride"` // 当前使用的座驾 Noble *CvNoble `json:"noble"` // 当前的 } type CvHeadwear struct { Id uint64 `json:"id"` Using bool `json:"using"` PicUrl string `json:"picUrl"` EffectUrl string `json:"effectUrl"` TimeLeft int64 `json:"timeLeft"` // 离到期还有多少秒(过期则是负数) } type CvProperty struct { Id uint64 `json:"id"` PicUrl string `json:"picUrl"` EffectUrl string `json:"effectUrl"` Using bool `json:"using"` TimeLeft int64 `json:"timeLeft"` // 离到期还有多少秒(过期则是负数) SenderAvatar string `json:"senderAvatar"` ReceiverAvatar string `json:"receiverAvatar"` } type CvMedal struct { Id uint32 `json:"id"` PicUrl string `json:"picUrl"` EffectUrl string `json:"effectUrl"` } type CvNoble struct { Level uint16 `json:"level"` EndTime int64 `json:"endTime"` } type CvDiamond struct { //钻石数量 DiamondNum int `json:"diamondNum"` } type CvDiamondBean struct { //钻石数量 DiamondNum int `json:"diamondNum"` //豆子数量 BeanNum string `json:"beanNum"` }