mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-13 04:33:44 +08:00
发布v2.15.1版本,更新内容请查看:https://github.com/bufanyun/hotgo/blob/v2.0/docs/guide-zh-CN/start-update-log.md
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/tree"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
@@ -21,7 +22,7 @@ type DeptMaxSortInp struct {
|
||||
}
|
||||
|
||||
type DeptMaxSortModel struct {
|
||||
Sort int
|
||||
Sort int `json:"sort"`
|
||||
}
|
||||
|
||||
// DeptEditInp 修改/新增部门数据
|
||||
@@ -112,7 +113,8 @@ type DeptTree struct {
|
||||
}
|
||||
|
||||
type DeptListModel struct {
|
||||
List []*DeptTree `json:"list"`
|
||||
List []*entity.AdminDept `json:"list"`
|
||||
Ids []int64 `json:"ids"`
|
||||
}
|
||||
|
||||
// DeptStatusInp 更新部门状态
|
||||
@@ -148,3 +150,26 @@ type DeptOptionInp struct {
|
||||
type DeptOptionModel struct {
|
||||
List []*DeptTree `json:"list"`
|
||||
}
|
||||
|
||||
// DeptTreeOption 关系树选项
|
||||
type DeptTreeOption struct {
|
||||
Id int64 `json:"id" dc:"部门ID"`
|
||||
Pid int64 `json:"pid" dc:"父部门ID"`
|
||||
Name string `json:"name" dc:"部门名称"`
|
||||
Children []tree.Node `json:"children" dc:"子节点"`
|
||||
}
|
||||
|
||||
// ID 获取节点ID
|
||||
func (t *DeptTreeOption) ID() int64 {
|
||||
return t.Id
|
||||
}
|
||||
|
||||
// PID 获取父级节点ID
|
||||
func (t *DeptTreeOption) PID() int64 {
|
||||
return t.Pid
|
||||
}
|
||||
|
||||
// SetChildren 设置子节点数据
|
||||
func (t *DeptTreeOption) SetChildren(children []tree.Node) {
|
||||
t.Children = children
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ type LoginMemberInfoModel struct {
|
||||
DeptName string `json:"deptName" dc:"所属部门"`
|
||||
RoleName string `json:"roleName" dc:"所属角色"`
|
||||
Permissions []string `json:"permissions" dc:"角色信息"`
|
||||
DeptType string `json:"deptType" dc:"部门类型"`
|
||||
DeptId int64 `json:"-" dc:"部门ID"`
|
||||
RoleId int64 `json:"-" dc:"角色ID"`
|
||||
Username string `json:"username" dc:"用户名"`
|
||||
@@ -115,7 +116,7 @@ type LoginMemberInfoModel struct {
|
||||
type MemberEditInp struct {
|
||||
Id int64 `json:"id" dc:"管理员ID"`
|
||||
RoleId int64 `json:"roleId" v:"required#角色不能为空" dc:"角色ID"`
|
||||
PostIds []int64 `json:"postIds" v:"required#岗位不能为空" dc:"岗位ID"`
|
||||
PostIds []int64 `json:"postIds" dc:"岗位ID"`
|
||||
DeptId int64 `json:"deptId" v:"required#部门不能为空" dc:"部门ID"`
|
||||
Username string `json:"username" v:"required#账号不能为空" dc:"帐号"`
|
||||
PasswordHash string `json:"passwordHash" dc:"密码hash"`
|
||||
@@ -149,7 +150,7 @@ func (in *MemberEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Password != "" {
|
||||
if err := g.Validator().
|
||||
Rules("length:6,16").
|
||||
Messages("#新密码不能为空#新密码需在6~16之间").
|
||||
Messages("新密码不能为空#新密码需在6~16之间").
|
||||
Data(in.Password).Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ func (in *MenuEditInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
if in.Name == "" {
|
||||
err = gerror.New("路由名称不能为空")
|
||||
err = gerror.New("路由别名不能为空")
|
||||
return
|
||||
}
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user