feat:完善项目信息
This commit is contained in:
@ -5,15 +5,16 @@ import (
|
||||
"SciencesServer/app/api/admin/model"
|
||||
model2 "SciencesServer/app/common/model"
|
||||
"SciencesServer/app/service"
|
||||
"SciencesServer/app/session"
|
||||
"SciencesServer/config"
|
||||
"SciencesServer/utils"
|
||||
"errors"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Instance struct{ *controller.Platform }
|
||||
type Instance struct{ *session.Admin }
|
||||
|
||||
type InstanceHandle func(session *service.Session) *Instance
|
||||
type InstanceHandle func(session *session.Admin) *Instance
|
||||
|
||||
type (
|
||||
// InstanceInfo 基本信息
|
||||
@ -27,6 +28,7 @@ type (
|
||||
// InstanceUserInfo 用户信息
|
||||
InstanceUserInfo struct {
|
||||
UID string `json:"uid"`
|
||||
Avatar string `json:"avatar"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
Mobile string `json:"mobile"`
|
||||
@ -51,7 +53,8 @@ func (c *Instance) Info() (*InstanceUserInfo, error) {
|
||||
return nil, err
|
||||
}
|
||||
return &InstanceUserInfo{
|
||||
UID: mSysUser.UUIDString(), Name: mSysUser.Name, Email: mSysUser.Email, Mobile: mSysUser.Mobile,
|
||||
UID: mSysUser.UUIDString(), Avatar: mSysUser.Avatar, Name: mSysUser.Name,
|
||||
Email: mSysUser.Email, Mobile: mSysUser.Mobile,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -82,7 +85,7 @@ func (c *Instance) Index(name, mobile string, status, page, pageSize int) (*cont
|
||||
|
||||
var count int64
|
||||
|
||||
if err := model2.PagesFields(mSysUser.SysUser, out, []string{"id", "uid", "account", "name", "mobile", "gender",
|
||||
if err := model2.PagesFields(mSysUser.SysUser, &out, []string{"id", "uuid", "account", "avatar", "name", "mobile", "gender",
|
||||
"is_admin", "created_at"}, page, pageSize, &count, where...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -92,6 +95,7 @@ func (c *Instance) Index(name, mobile string, status, page, pageSize int) (*cont
|
||||
list = append(list, &InstanceInfo{ID: v.GetEncodeID(),
|
||||
InstanceUserInfo: InstanceUserInfo{
|
||||
UID: v.UUIDString(),
|
||||
Avatar: v.Avatar,
|
||||
Name: v.Name,
|
||||
Email: v.Email,
|
||||
Mobile: v.Mobile,
|
||||
@ -234,7 +238,7 @@ func (c *Instance) Delete(id uint64) error {
|
||||
}
|
||||
|
||||
func NewInstance() InstanceHandle {
|
||||
return func(session *service.Session) *Instance {
|
||||
return &Instance{Platform: &controller.Platform{Session: session}}
|
||||
return func(session *session.Admin) *Instance {
|
||||
return &Instance{Admin: session}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user