mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-09 10:43:47 +08:00
发布v2.3.5版本,本次为优化版本。更新内容请查看:https://github.com/bufanyun/hotgo/blob/v2.0/docs/guide-zh-CN/start-update-log.md
This commit is contained in:
@@ -166,6 +166,8 @@ type GenerateConfig struct {
|
||||
type BuildAddonConfig struct {
|
||||
SrcPath string `json:"srcPath"`
|
||||
TemplatePath string `json:"templatePath"`
|
||||
WebApiPath string `json:"webApiPath"`
|
||||
WebViewsPath string `json:"webViewsPath"`
|
||||
}
|
||||
|
||||
// CacheConfig 缓存配置
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package adminin
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/model/entity"
|
||||
)
|
||||
|
||||
@@ -57,34 +56,18 @@ type DeptListInp struct {
|
||||
Code string
|
||||
}
|
||||
|
||||
// DeptTreeDept 树
|
||||
type DeptTreeDept struct {
|
||||
// DeptTree 树
|
||||
type DeptTree struct {
|
||||
entity.AdminDept
|
||||
Children []*DeptTreeDept `json:"children"`
|
||||
Label string `json:"label" dc:"标签"`
|
||||
Value int64 `json:"value" dc:"键值"`
|
||||
Children []*DeptTree `json:"children"`
|
||||
}
|
||||
|
||||
type DeptListModel []g.Map
|
||||
|
||||
// DeptListTreeInp 获取列表树
|
||||
type DeptListTreeInp struct {
|
||||
Name string
|
||||
Code string
|
||||
type DeptListModel struct {
|
||||
List []*DeptTree `json:"list"`
|
||||
}
|
||||
|
||||
// DeptListTreeDept 树
|
||||
type DeptListTreeDept struct {
|
||||
Id int64 `json:"id" `
|
||||
Key int64 `json:"key" `
|
||||
Pid int64 `json:"pid" `
|
||||
Label string `json:"label"`
|
||||
Title string `json:"title"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
Children []*DeptListTreeDept `json:"children"`
|
||||
}
|
||||
|
||||
type DeptListTreeModel DeptListTreeDept
|
||||
|
||||
// DeptStatusInp 更新部门状态
|
||||
type DeptStatusInp struct {
|
||||
entity.AdminDept
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
package adminin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
@@ -44,13 +46,13 @@ type MemberProfileInp struct {
|
||||
Id int64
|
||||
}
|
||||
type MemberProfileModel struct {
|
||||
PostGroup string `json:"postGroup" description:"岗位名称"`
|
||||
RoleGroup string `json:"roleGroup" description:"角色名称"`
|
||||
User *MemberViewModel `json:"member" description:"用户基本信息"`
|
||||
SysDept *DeptViewModel `json:"sysDept" description:"部门信息"`
|
||||
SysRoles []*RoleListModel `json:"sysRoles" description:"角色列表"`
|
||||
PostIds int64 `json:"postIds" description:"当前岗位"`
|
||||
RoleIds int64 `json:"roleIds" description:"当前角色"`
|
||||
PostGroup string `json:"postGroup" dc:"岗位名称"`
|
||||
RoleGroup string `json:"roleGroup" dc:"角色名称"`
|
||||
User *MemberViewModel `json:"member" dc:"用户基本信息"`
|
||||
SysDept *DeptViewModel `json:"sysDept" dc:"部门信息"`
|
||||
SysRoles []*RoleListModel `json:"sysRoles" dc:"角色列表"`
|
||||
PostIds int64 `json:"postIds" dc:"当前岗位"`
|
||||
RoleIds int64 `json:"roleIds" dc:"当前角色"`
|
||||
}
|
||||
|
||||
// MemberUpdateProfileInp 更新用户资料
|
||||
@@ -118,36 +120,48 @@ type MemberMaxSortModel struct {
|
||||
|
||||
// MemberEditInp 修改/新增管理员
|
||||
type MemberEditInp struct {
|
||||
Id int64 `json:"id" description:""`
|
||||
RoleId int `json:"roleId" v:"required#角色不能为空" description:"角色ID"`
|
||||
PostIds []int64 `json:"postIds" v:"required#岗位不能为空" description:"岗位ID"`
|
||||
DeptId int64 `json:"deptId" v:"required#部门不能为空" description:"部门ID"`
|
||||
Username string `json:"username" v:"required#账号不能为空" description:"帐号"`
|
||||
Password string `json:"password" description:"密码"`
|
||||
RealName string `json:"realName" description:"真实姓名"`
|
||||
Avatar string `json:"avatar" description:"头像"`
|
||||
Sex string `json:"sex" description:"性别"`
|
||||
Qq string `json:"qq" description:"qq"`
|
||||
Email string `json:"email" description:"邮箱"`
|
||||
Birthday *gtime.Time `json:"birthday" description:"生日"`
|
||||
ProvinceId int `json:"provinceId" description:"省"`
|
||||
CityId int `json:"cityId" description:"城市"`
|
||||
AreaId int `json:"areaId" description:"地区"`
|
||||
Address string `json:"address" description:"默认地址"`
|
||||
Mobile string `json:"mobile" description:"手机号码"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status string `json:"status" description:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"`
|
||||
Id int64 `json:"id" dc:""`
|
||||
RoleId int `json:"roleId" v:"required#角色不能为空" dc:"角色ID"`
|
||||
PostIds []int64 `json:"postIds" v:"required#岗位不能为空" dc:"岗位ID"`
|
||||
DeptId int64 `json:"deptId" v:"required#部门不能为空" dc:"部门ID"`
|
||||
Username string `json:"username" v:"required#账号不能为空" dc:"帐号"`
|
||||
PasswordHash string `json:"passwordHash" dc:"密码hash"`
|
||||
Password string `json:"password" dc:"密码"`
|
||||
RealName string `json:"realName" dc:"真实姓名"`
|
||||
Avatar string `json:"avatar" dc:"头像"`
|
||||
Sex string `json:"sex" dc:"性别"`
|
||||
Qq string `json:"qq" dc:"qq"`
|
||||
Email string `json:"email" dc:"邮箱"`
|
||||
Birthday *gtime.Time `json:"birthday" dc:"生日"`
|
||||
ProvinceId int `json:"provinceId" dc:"省"`
|
||||
CityId int `json:"cityId" dc:"城市"`
|
||||
AreaId int `json:"areaId" dc:"地区"`
|
||||
Address string `json:"address" dc:"默认地址"`
|
||||
Mobile string `json:"mobile" dc:"手机号码"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
}
|
||||
|
||||
type MemberAddInp struct {
|
||||
MemberEditInp
|
||||
PasswordHash string `json:"passwordHash" description:"密码hash"`
|
||||
Salt string `json:"salt" description:"密码盐"`
|
||||
Pid int64 `json:"pid" description:"上级ID"`
|
||||
Level int `json:"level" description:"等级"`
|
||||
Tree string `json:"tree" description:"关系树"`
|
||||
Salt string `json:"salt" dc:"密码盐"`
|
||||
Pid int64 `json:"pid" dc:"上级ID"`
|
||||
Level int `json:"level" dc:"等级"`
|
||||
Tree string `json:"tree" dc:"关系树"`
|
||||
}
|
||||
|
||||
func (in *MemberEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Password != "" {
|
||||
if err := g.Validator().
|
||||
Rules("length:6,16").
|
||||
Messages("#新密码不能为空#新密码需在6~16之间").
|
||||
Data(in.Password).Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type MemberEditModel struct{}
|
||||
@@ -165,8 +179,8 @@ type MemberViewInp struct {
|
||||
|
||||
type MemberViewModel struct {
|
||||
entity.AdminMember
|
||||
DeptName string `json:"deptName" description:"所属部门"`
|
||||
RoleName string `json:"roleName" description:"所属角色"`
|
||||
DeptName string `json:"deptName" dc:"所属部门"`
|
||||
RoleName string `json:"roleName" dc:"所属角色"`
|
||||
}
|
||||
|
||||
// MemberListInp 获取列表
|
||||
@@ -174,21 +188,21 @@ type MemberListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
DeptId int `json:"deptId" dc:"部门ID"`
|
||||
Mobile int `json:"mobile" dc:"手机号"`
|
||||
DeptId int `json:"deptId" dc:"部门ID"`
|
||||
Mobile int `json:"mobile" dc:"手机号"`
|
||||
Username string `json:"username" dc:"用户名"`
|
||||
RealName string `json:"realName" dc:"真实姓名"`
|
||||
Name string `json:"name" dc:"岗位名称"`
|
||||
Code string `json:"code" dc:"岗位编码"`
|
||||
CreatedAt []int64 `json:"createdAt" dc:"创建时间"`
|
||||
Name string `json:"name" dc:"岗位名称"`
|
||||
Code string `json:"code" dc:"岗位编码"`
|
||||
CreatedAt []int64 `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
type MemberListModel struct {
|
||||
entity.AdminMember
|
||||
DeptName string `json:"deptName" description:"所属部门"`
|
||||
RoleName string `json:"roleName" description:"所属角色"`
|
||||
PostIds []int64 `json:"postIds" description:"岗位"`
|
||||
DeptId int64 `json:"deptId" description:"部门ID"`
|
||||
DeptName string `json:"deptName" dc:"所属部门"`
|
||||
RoleName string `json:"roleName" dc:"所属角色"`
|
||||
PostIds []int64 `json:"postIds" dc:"岗位"`
|
||||
DeptId int64 `json:"deptId" dc:"部门ID"`
|
||||
}
|
||||
|
||||
// MemberLoginInp 登录
|
||||
@@ -197,31 +211,31 @@ type MemberLoginInp struct {
|
||||
Password string
|
||||
}
|
||||
type MemberLoginModel struct {
|
||||
Id int64 `json:"id" description:"用户ID"`
|
||||
Token string `json:"token" description:"登录token"`
|
||||
Expires int64 `json:"expires" description:"登录有效期"`
|
||||
Id int64 `json:"id" dc:"用户ID"`
|
||||
Token string `json:"token" dc:"登录token"`
|
||||
Expires int64 `json:"expires" dc:"登录有效期"`
|
||||
}
|
||||
|
||||
type LoginMemberInfoModel struct {
|
||||
Id int64 `json:"id" description:"用户ID"`
|
||||
DeptName string `json:"deptName" description:"所属部门"`
|
||||
RoleName string `json:"roleName" description:"所属角色"`
|
||||
Permissions []string `json:"permissions" description:"角色信息"`
|
||||
DeptId int64 `json:"-" description:"部门ID"`
|
||||
RoleId int64 `json:"-" description:"角色ID"`
|
||||
Username string `json:"username" description:"用户名"`
|
||||
RealName string `json:"realName" description:"姓名"`
|
||||
Avatar string `json:"avatar" description:"头像"`
|
||||
Balance float64 `json:"balance" description:"余额"`
|
||||
Sex int `json:"sex" description:"性别"`
|
||||
Qq string `json:"qq" description:"qq"`
|
||||
Email string `json:"email" description:"邮箱"`
|
||||
Mobile string `json:"mobile" description:"手机号码"`
|
||||
Birthday *gtime.Time `json:"birthday" description:"生日"`
|
||||
CityId int64 `json:"cityId" description:"城市编码"`
|
||||
Address string `json:"address" description:"联系地址"`
|
||||
Cash *MemberCash `json:"cash" description:"收款信息"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
Id int64 `json:"id" dc:"用户ID"`
|
||||
DeptName string `json:"deptName" dc:"所属部门"`
|
||||
RoleName string `json:"roleName" dc:"所属角色"`
|
||||
Permissions []string `json:"permissions" dc:"角色信息"`
|
||||
DeptId int64 `json:"-" dc:"部门ID"`
|
||||
RoleId int64 `json:"-" dc:"角色ID"`
|
||||
Username string `json:"username" dc:"用户名"`
|
||||
RealName string `json:"realName" dc:"姓名"`
|
||||
Avatar string `json:"avatar" dc:"头像"`
|
||||
Balance float64 `json:"balance" dc:"余额"`
|
||||
Sex int `json:"sex" dc:"性别"`
|
||||
Qq string `json:"qq" dc:"qq"`
|
||||
Email string `json:"email" dc:"邮箱"`
|
||||
Mobile string `json:"mobile" dc:"手机号码"`
|
||||
Birthday *gtime.Time `json:"birthday" dc:"生日"`
|
||||
CityId int64 `json:"cityId" dc:"城市编码"`
|
||||
Address string `json:"address" dc:"联系地址"`
|
||||
Cash *MemberCash `json:"cash" dc:"收款信息"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
*MemberLoginStatModel
|
||||
}
|
||||
|
||||
@@ -246,10 +260,10 @@ type MemberSelectInp struct {
|
||||
}
|
||||
|
||||
type MemberSelectModel struct {
|
||||
Value int64 `json:"value" dc:"用户ID"`
|
||||
Label string `json:"label" dc:"真实姓名"`
|
||||
Value int64 `json:"value" dc:"用户ID"`
|
||||
Label string `json:"label" dc:"真实姓名"`
|
||||
Username string `json:"username" dc:"用户名"`
|
||||
Avatar string `json:"avatar" dc:"头像"`
|
||||
Avatar string `json:"avatar" dc:"头像"`
|
||||
}
|
||||
|
||||
// MemberLoginStatInp 用户登录统计
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package adminin
|
||||
|
||||
import (
|
||||
@@ -123,9 +122,7 @@ type MenuRouteMeta struct {
|
||||
FrameSrc string `json:"frameSrc,omitempty" ` // 内联外部地址
|
||||
Permissions string `json:"permissions,omitempty"` // 菜单包含权限集合,满足其中一个就会显示
|
||||
Affix bool `json:"affix,omitempty"` // 是否固定 设置为 true 之后 多页签不可删除
|
||||
|
||||
// 自定义
|
||||
Type int `json:"type"` // 菜单类型
|
||||
Type int `json:"type"` // 菜单类型
|
||||
}
|
||||
|
||||
type MenuRoute struct {
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"hotgo/internal/model"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"sort"
|
||||
)
|
||||
|
||||
// RoleListInp 获取列表
|
||||
@@ -17,10 +18,27 @@ type RoleListInp struct {
|
||||
form.PageReq
|
||||
}
|
||||
|
||||
type RoleListModel struct {
|
||||
type RoleTree struct {
|
||||
entity.AdminRole
|
||||
Label string `json:"label" dc:"标签"`
|
||||
Value int64 `json:"value" dc:"键值"`
|
||||
Label string `json:"label" dc:"标签"`
|
||||
Value int64 `json:"value" dc:"键值"`
|
||||
Children []*RoleTree `json:"children" dc:"子级"`
|
||||
}
|
||||
|
||||
type RoleListModel struct {
|
||||
List []*RoleTree `json:"list"`
|
||||
}
|
||||
|
||||
func Sort(v []*RoleTree) {
|
||||
sort.SliceStable(v, func(i, j int) bool {
|
||||
if v[i].Sort < v[j].Sort {
|
||||
return true
|
||||
}
|
||||
if v[i].Sort > v[j].Sort {
|
||||
return false
|
||||
}
|
||||
return v[i].Id < v[j].Id
|
||||
})
|
||||
}
|
||||
|
||||
// RoleMemberListInp 查询列表
|
||||
@@ -28,15 +46,15 @@ type RoleMemberListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
Role int `json:"role" description:"角色ID"`
|
||||
DeptId int `json:"deptId" description:"部门ID"`
|
||||
Mobile int `json:"mobile" description:"手机号"`
|
||||
Username string `json:"username" description:"用户名"`
|
||||
Realname string `json:"realname" description:"真实姓名"`
|
||||
StartTime string `json:"start_time" description:"开始时间"`
|
||||
EndTime string `json:"end_time" description:"结束时间"`
|
||||
Name string `json:"name" description:"岗位名称"`
|
||||
Code string `json:"code" description:"岗位编码"`
|
||||
Role int `json:"role" dc:"角色ID"`
|
||||
DeptId int `json:"deptId" dc:"部门ID"`
|
||||
Mobile int `json:"mobile" dc:"手机号"`
|
||||
Username string `json:"username" dc:"用户名"`
|
||||
RealName string `json:"realName" dc:"真实姓名"`
|
||||
StartTime string `json:"start_time" dc:"开始时间"`
|
||||
EndTime string `json:"end_time" dc:"结束时间"`
|
||||
Name string `json:"name" dc:"岗位名称"`
|
||||
Code string `json:"code" dc:"岗位编码"`
|
||||
}
|
||||
|
||||
type RoleMemberListModel []*MemberListModel
|
||||
@@ -46,12 +64,12 @@ type MenuRoleListInp struct {
|
||||
RoleId int64
|
||||
}
|
||||
type MenuRoleListModel struct {
|
||||
Menus []*model.LabelTreeMenu `json:"menus" description:"菜单列表"`
|
||||
CheckedKeys []int64 `json:"checkedKeys" description:"选择的菜单ID"`
|
||||
Menus []*model.LabelTreeMenu `json:"menus" dc:"菜单列表"`
|
||||
CheckedKeys []int64 `json:"checkedKeys" dc:"选择的菜单ID"`
|
||||
}
|
||||
|
||||
type DataScopeEditInp struct {
|
||||
Id int64 `json:"id" v:"required" dc:"角色ID"`
|
||||
Id int64 `json:"id" v:"required" dc:"角色ID"`
|
||||
DataScope int `json:"dataScope" v:"required" dc:"数据范围"`
|
||||
CustomDept []int64 `json:"customDept" dc:"自定义部门权限"`
|
||||
CustomDept []int64 `json:"customDept" dc:"自定义部门权限"`
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
@@ -64,4 +63,15 @@ type CronGroupStatusModel struct{}
|
||||
type CronGroupSelectInp struct {
|
||||
}
|
||||
|
||||
type CronGroupSelectModel []g.Map
|
||||
type CronGroupSelectModel struct {
|
||||
List []*CronGroupTree `json:"list"`
|
||||
}
|
||||
|
||||
type CronGroupTree struct {
|
||||
entity.SysCronGroup
|
||||
Disabled bool `json:"disabled" dc:"是否禁用"`
|
||||
Label string `json:"label" dc:"标签"`
|
||||
Value int64 `json:"value" dc:"键值"`
|
||||
Key int64 `json:"key" dc:"键名"`
|
||||
Children []*CronGroupTree `json:"children" dc:"子级"`
|
||||
}
|
||||
|
||||
@@ -23,14 +23,17 @@ type DictTypeDeleteInp struct {
|
||||
}
|
||||
type DictTypeDeleteModel struct{}
|
||||
|
||||
// DictTypeSelectInp 获取类型选项
|
||||
type DictTypeSelectInp struct {
|
||||
}
|
||||
|
||||
type DictTypeSelectModel []g.Map
|
||||
|
||||
// DictTreeSelectInp 获取类型关系树选项
|
||||
type DictTreeSelectInp struct {
|
||||
}
|
||||
|
||||
type DictTreeSelectModel []g.Map
|
||||
|
||||
type DictTypeTree struct {
|
||||
entity.SysDictType
|
||||
Disabled bool `json:"disabled" dc:"是否禁用"`
|
||||
Label string `json:"label" dc:"标签"`
|
||||
Value int64 `json:"value" dc:"键值"`
|
||||
Key int64 `json:"key" dc:"键名"`
|
||||
Children []*DictTypeTree `json:"children" dc:"子级"`
|
||||
}
|
||||
|
||||
@@ -83,11 +83,11 @@ type GenCodesSelectsModel struct {
|
||||
LinkMode form.Selects `json:"linkMode" dc:"关联表方式"`
|
||||
BuildMeth form.Selects `json:"buildMeth" dc:"生成方式"`
|
||||
// 字段表格选项
|
||||
FormMode form.Selects `json:"formMode" dc:"表单组件"`
|
||||
FormRole form.Selects `json:"formRole" dc:"表单验证"`
|
||||
DictMode DictTreeSelectModel `json:"dictMode" dc:"字典类型"`
|
||||
WhereMode form.Selects `json:"whereMode" dc:"查询条件"`
|
||||
Addons form.Selects `json:"addons" dc:"插件选项"`
|
||||
FormMode form.Selects `json:"formMode" dc:"表单组件"`
|
||||
FormRole form.Selects `json:"formRole" dc:"表单验证"`
|
||||
DictMode []*DictTypeTree `json:"dictMode" dc:"字典类型"`
|
||||
WhereMode form.Selects `json:"whereMode" dc:"查询条件"`
|
||||
Addons form.Selects `json:"addons" dc:"插件选项"`
|
||||
}
|
||||
|
||||
type GenTypeSelects []*GenTypeSelect
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package model
|
||||
|
||||
import (
|
||||
@@ -12,7 +11,7 @@ import (
|
||||
|
||||
type MonitorData struct {
|
||||
// STartTime 启动时间
|
||||
STartTime *gtime.Time
|
||||
STartTime int64
|
||||
// 内网IP
|
||||
IntranetIP string
|
||||
// 公网IP
|
||||
|
||||
Reference in New Issue
Block a user