package user import ( "SciencesServer/app/service" ) type Instance struct{ *service.SessionEnterprise } type InstanceHandle func(enterprise *service.SessionEnterprise) *Instance type ( // InstanceInfoReturn 基本信息返回 InstanceInfoReturn struct { Name string `json:"name"` // 名称 Avatar string `json:"avatar"` // 头像 Identity int `json:"identity"` // 具体身份 SelectIdentity int `json:"select_identity"` // 最后一次选中的身份信息 } ) // Info 基本信息 func (c *Instance) Info() *InstanceInfoReturn { return &InstanceInfoReturn{Name: c.Name, Avatar: c.Avatar, Identity: c.Identity, SelectIdentity: c.SelectIdentity} } func NewInstance() InstanceHandle { return func(enterprise *service.SessionEnterprise) *Instance { return &Instance{enterprise} } }