feat:完善项目
This commit is contained in:
@ -24,6 +24,7 @@ type (
|
||||
InstanceIdentityInfo struct {
|
||||
ID string `json:"id"`
|
||||
*model2.SysMenuBasic
|
||||
ParentID string `json:"parent_id"`
|
||||
Checked bool `json:"checked"`
|
||||
Children []*InstanceIdentityInfo `json:"children"`
|
||||
}
|
||||
@ -67,9 +68,18 @@ func TreeIdentity(iModel model2.IModel, src []*model.SysMenuScene, parentID uint
|
||||
for _, v := range src {
|
||||
if v.ParentID == parentID {
|
||||
iModel.SetID(v.ID)
|
||||
id := iModel.GetEncodeID()
|
||||
|
||||
_parentID := "0"
|
||||
|
||||
if v.ParentID > 0 {
|
||||
iModel.SetID(v.ParentID)
|
||||
_parentID = iModel.GetEncodeID()
|
||||
}
|
||||
out = append(out, &InstanceIdentityInfo{
|
||||
ID: iModel.GetEncodeID(),
|
||||
ID: id,
|
||||
SysMenuBasic: v.SysMenuBasic,
|
||||
ParentID: _parentID,
|
||||
Checked: v.SceneID > 0,
|
||||
Children: TreeIdentity(iModel, src, v.ID),
|
||||
})
|
||||
|
@ -30,6 +30,11 @@ type (
|
||||
Account, Name, Avatar, Mobile, Password, Remark string
|
||||
Gender int
|
||||
}
|
||||
// InstanceBasicInfo 基本信息
|
||||
InstanceBasicInfo struct {
|
||||
UUID string `json:"id"` // 别名更改为ID
|
||||
Name string `json:"name"`
|
||||
}
|
||||
)
|
||||
|
||||
// Info 基本信息
|
||||
@ -37,6 +42,18 @@ func (c *Instance) Info() *InstanceBasic {
|
||||
return &InstanceBasic{Name: c.Name, Avatar: c.Avatar}
|
||||
}
|
||||
|
||||
// Select 筛选信息
|
||||
func (c *Instance) Select() ([]*InstanceBasicInfo, error) {
|
||||
mSysUser := model.NewSysUser()
|
||||
|
||||
out := make([]*InstanceBasicInfo, 0)
|
||||
|
||||
if err := model2.ScanFields(mSysUser.SysUser, &out, []string{"uuid", "name"}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// List 列表信息
|
||||
func (c *Instance) List(name, mobile string, tenantID uint64, page, pageSize int) (*basic.PageDataResponse, error) {
|
||||
mSysUser := model.NewSysUser()
|
||||
|
Reference in New Issue
Block a user