改变路由层级,模块化

This commit is contained in:
2023-01-18 15:40:27 +08:00
parent bd25f041a2
commit 0f8c1f989b
102 changed files with 335 additions and 322 deletions
@@ -0,0 +1,12 @@
package response
type CronJobResponse struct {
JobId int `json:"jobId"` // 任务主键
JobName string `json:"jobName"` // 任务名称
JobCron string `json:"jobCron"` // cron表达式
FuncAlias string `json:"funcAlias"` // 方法别名(程序内注册的别名)
FuncParam string `json:"funcParam"` // 方法参数
Status string `json:"status"` // 状态(1、Running 0、Stop)
Level int `json:"level"` // 任务级别(0、普通 1、一般 2、重要 3、强保)
Remark string `json:"remark"` // 备注
}
@@ -0,0 +1,11 @@
package response
// DictDataResponse 字典数据实体返回结构体
type DictDataResponse struct {
DictCode int64 `excel:"name=字典编码" xorm:"pk autoincr" json:"dictCode"` // 字典ID
DictSort int `excel:"name=字典排序" xorm:"int" json:"dictSort"` // 字典排序
DictLabel string `excel:"name=字典标签" xorm:"varchar(128)" json:"dictLabel"` // 字典标签
DictValue string `excel:"name=字典键值" xorm:"varchar(128)" json:"dictValue"` // 字典键值
DictType string `excel:"name=字典类型" xorm:"varchar(128)" json:"dictType"` // 字典类型
IsDefault string `excel:"name=是否默认,format=Y=是,N=否" json:"isDefault"` // 是否默认
}
@@ -0,0 +1,41 @@
package response
import (
"cutego/modules/core/entity"
"time"
)
// UserResponse 用户实体返回结构体
type UserResponse struct {
UserId int64 `json:"userId"` // 用户ID
DeptId int64 `excel:"name=部门" json:"deptId"` // 部门ID
UserName string `excel:"name=用户登录名" json:"userName"` // 登录用户名
NickName string `excel:"name=用户昵称" json:"nickName"` // 用户昵称
Email string `excel:"name=用户邮箱" json:"email"` // 邮箱
PhoneNumber string `excel:"name=手机号" json:"phoneNumber"` // 手机号
Sex string `excel:"name=性别,format=0=男,1=女,2=未知" json:"sex"` // 性别0男1女
Avatar string `json:"avatar"` // 头像路径
Status string `json:"status"` // 状态 0正常1停用
DelFlag string `json:"delFlag"` // 0正常1删除
LoginIp string `json:"loginIp"` // 登录ip
LoginDate time.Time `json:"loginDate"` // 登录时间
CreateTime time.Time `xorm:"created" json:"createTime"` // 创建时间
CreateBy string `json:"createBy"` // 创建人
UpdateTime time.Time `json:"updateTime"` // 更新时间
UpdateBy string `json:"updateBy"` // 更新人
SysDept entity.SysDept `xorm:"extends" json:"dept"` // 部门实体
}
// UserInfo 用户整体数据
type UserInfo struct {
User *UserResponse `json:"user,omitempty"` // 用户数据
Roles []*entity.SysRole `json:"roles,omitempty"` // 角色集合
Posts []*entity.SysPost `json:"posts,omitempty"` // 部门集合
PostIds *[]int64 `json:"postIds,omitempty"` // 岗位id集合
RoleIds *[]int64 `json:"roleIds,omitempty"` // 觉得id集合
}
// IsAdmin 判断当前用户是否是管理员
func (r UserResponse) IsAdmin() bool {
return r.UserId == 1
}