init...
This commit is contained in:
@@ -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 (
|
||||
models2 "cutego/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 models2.SysDept `xorm:"extends" json:"dept"` // 部门实体
|
||||
}
|
||||
|
||||
// UserInfo 用户整体数据
|
||||
type UserInfo struct {
|
||||
User *UserResponse `json:"user,omitempty"` // 用户数据
|
||||
Roles []*models2.SysRole `json:"roles,omitempty"` // 角色集合
|
||||
Posts []*models2.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
|
||||
}
|
||||
Reference in New Issue
Block a user