clear:formatting code

This commit is contained in:
zhangwenjian
2020-07-23 12:03:17 +08:00
parent 426cec1b62
commit 8c554d7ee7
52 changed files with 486 additions and 502 deletions
+12 -12
View File
@@ -8,18 +8,18 @@ import (
type DictData struct {
DictCode int `gorm:"primary_key;AUTO_INCREMENT" json:"dictCode" example:"1"` //字典编码
DictSort int `gorm:"" json:"dictSort"` //显示顺序
DictLabel string `gorm:"size:128;" json:"dictLabel"` //数据标签
DictValue string `gorm:"size:255;" json:"dictValue"` //数据键值
DictType string `gorm:"size:64;" json:"dictType"` //字典类型
CssClass string `gorm:"size:128;" json:"cssClass"` //
ListClass string `gorm:"size:128;" json:"listClass"` //
IsDefault string `gorm:"size:8;" json:"isDefault"` //
Status string `gorm:"size:4;" json:"status"` //状态
Default string `gorm:"size:8;" json:"default"` //
CreateBy string `gorm:"size:64;" json:"createBy"` //
UpdateBy string `gorm:"size:64;" json:"updateBy"` //
Remark string `gorm:"size:255;" json:"remark"` //备注
DictSort int `gorm:"" json:"dictSort"` //显示顺序
DictLabel string `gorm:"size:128;" json:"dictLabel"` //数据标签
DictValue string `gorm:"size:255;" json:"dictValue"` //数据键值
DictType string `gorm:"size:64;" json:"dictType"` //字典类型
CssClass string `gorm:"size:128;" json:"cssClass"` //
ListClass string `gorm:"size:128;" json:"listClass"` //
IsDefault string `gorm:"size:8;" json:"isDefault"` //
Status string `gorm:"size:4;" json:"status"` //状态
Default string `gorm:"size:8;" json:"default"` //
CreateBy string `gorm:"size:64;" json:"createBy"` //
UpdateBy string `gorm:"size:64;" json:"updateBy"` //
Remark string `gorm:"size:255;" json:"remark"` //备注
Params string `gorm:"-" json:"params"`
DataScope string `gorm:"-" json:"dataScope"`
BaseModel
+3 -3
View File
@@ -10,9 +10,9 @@ type DictType struct {
DictId int `gorm:"primary_key;AUTO_INCREMENT" json:"dictId"`
DictName string `gorm:"size:128;" json:"dictName"` //字典名称
DictType string `gorm:"size:128;" json:"dictType"` //字典类型
Status string `gorm:"size:4;" json:"status"` //状态
DataScope string `gorm:"-" json:"dataScope"` //
Params string `gorm:"-" json:"params"` //
Status string `gorm:"size:4;" json:"status"` //状态
DataScope string `gorm:"-" json:"dataScope"` //
Params string `gorm:"-" json:"params"` //
CreateBy string `gorm:"size:11;" json:"createBy"` //创建者
UpdateBy string `gorm:"size:11;" json:"updateBy"` //更新者
Remark string `gorm:"size:255;" json:"remark"` //备注
+10 -10
View File
@@ -7,19 +7,19 @@ import (
type LoginLog struct {
InfoId int `json:"infoId" gorm:"primary_key;AUTO_INCREMENT"` //主键
Username string `json:"username" gorm:"size:128;"` //用户名
Status string `json:"status" gorm:"size:4;"` //状态
Ipaddr string `json:"ipaddr" gorm:"size:255;"` //ip地址
LoginLocation string `json:"loginLocation" gorm:"size:255;"` //归属地
Browser string `json:"browser" gorm:"size:255;"` //浏览器
Os string `json:"os" gorm:"size:255;"` //系统
Platform string `json:"platform" gorm:"size:255;"` // 固件
Username string `json:"username" gorm:"size:128;"` //用户名
Status string `json:"status" gorm:"size:4;"` //状态
Ipaddr string `json:"ipaddr" gorm:"size:255;"` //ip地址
LoginLocation string `json:"loginLocation" gorm:"size:255;"` //归属地
Browser string `json:"browser" gorm:"size:255;"` //浏览器
Os string `json:"os" gorm:"size:255;"` //系统
Platform string `json:"platform" gorm:"size:255;"` // 固件
LoginTime time.Time `json:"loginTime" gorm:"type:timestamp;"` //登录时间
CreateBy string `json:"createBy" gorm:"size:128;"` //创建人
UpdateBy string `json:"updateBy" gorm:"size:128;"` //更新者
CreateBy string `json:"createBy" gorm:"size:128;"` //创建人
UpdateBy string `json:"updateBy" gorm:"size:128;"` //更新者
DataScope string `json:"dataScope" gorm:"-"` //数据
Params string `json:"params" gorm:"-"` //
Remark string `json:"remark" gorm:"size:255;"` //备注
Remark string `json:"remark" gorm:"size:255;"` //备注
Msg string `json:"msg" gorm:"size:255;"`
BaseModel
}
+2 -2
View File
@@ -5,7 +5,7 @@ import (
)
type BaseModel struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt"`
}
+21 -21
View File
@@ -8,28 +8,28 @@ import (
//sys_operlog
type SysOperLog struct {
OperId int `json:"operId" gorm:"primary_key;AUTO_INCREMENT"` //日志编码
Title string `json:"title" gorm:"size:255;"` //操作模块
BusinessType string `json:"businessType" gorm:"size:128;"` //操作类型
Title string `json:"title" gorm:"size:255;"` //操作模块
BusinessType string `json:"businessType" gorm:"size:128;"` //操作类型
BusinessTypes string `json:"businessTypes" gorm:"size:128;"`
Method string `json:"method" gorm:"size:128;"` //函数
RequestMethod string `json:"requestMethod" gorm:"size:128;"` //请求方式
OperatorType string `json:"operatorType" gorm:"size:128;"` //操作类型
OperName string `json:"operName" gorm:"size:128;"` //操作者
DeptName string `json:"deptName" gorm:"size:128;"` //部门名称
OperUrl string `json:"operUrl" gorm:"size:255;"` //访问地址
OperIp string `json:"operIp" gorm:"size:128;"` //客户端ip
OperLocation string `json:"operLocation" gorm:"size:128;"` //访问位置
OperParam string `json:"operParam" gorm:"size:255;"` //请求参数
Status string `json:"status" gorm:"size:4;"` //操作状态
OperTime time.Time `json:"operTime" gorm:"type:timestamp;"` //操作时间
JsonResult string `json:"jsonResult" gorm:"size:255;"` //返回数据
CreateBy string `json:"createBy" gorm:"size:128;"` //创建人
UpdateBy string `json:"updateBy" gorm:"size:128;"` //更新者
DataScope string `json:"dataScope" gorm:"-"` //数据
Params string `json:"params" gorm:"-"` //参数
Remark string `json:"remark" gorm:"size:255;"` //备注
LatencyTime string `json:"latencyime" gorm:"size:128;"` //耗时
UserAgent string `json:"userAgent" gorm:"size:255;"` //ua
Method string `json:"method" gorm:"size:128;"` //函数
RequestMethod string `json:"requestMethod" gorm:"size:128;"` //请求方式
OperatorType string `json:"operatorType" gorm:"size:128;"` //操作类型
OperName string `json:"operName" gorm:"size:128;"` //操作者
DeptName string `json:"deptName" gorm:"size:128;"` //部门名称
OperUrl string `json:"operUrl" gorm:"size:255;"` //访问地址
OperIp string `json:"operIp" gorm:"size:128;"` //客户端ip
OperLocation string `json:"operLocation" gorm:"size:128;"` //访问位置
OperParam string `json:"operParam" gorm:"size:255;"` //请求参数
Status string `json:"status" gorm:"size:4;"` //操作状态
OperTime time.Time `json:"operTime" gorm:"type:timestamp;"` //操作时间
JsonResult string `json:"jsonResult" gorm:"size:255;"` //返回数据
CreateBy string `json:"createBy" gorm:"size:128;"` //创建人
UpdateBy string `json:"updateBy" gorm:"size:128;"` //更新者
DataScope string `json:"dataScope" gorm:"-"` //数据
Params string `json:"params" gorm:"-"` //参数
Remark string `json:"remark" gorm:"size:255;"` //备注
LatencyTime string `json:"latencyime" gorm:"size:128;"` //耗时
UserAgent string `json:"userAgent" gorm:"size:255;"` //ua
BaseModel
}
+5 -5
View File
@@ -7,11 +7,11 @@ import (
type Post struct {
PostId int `gorm:"primary_key;AUTO_INCREMENT" json:"postId"` //岗位编号
PostName string `gorm:"size:128;" json:"postName"` //岗位名称
PostCode string `gorm:"size:128;" json:"postCode"` //岗位代码
Sort int `gorm:"" json:"sort"` //岗位排序
Status string `gorm:"size:4;" json:"status"` //状态
Remark string `gorm:"size:255;" json:"remark"` //描述
PostName string `gorm:"size:128;" json:"postName"` //岗位名称
PostCode string `gorm:"size:128;" json:"postCode"` //岗位代码
Sort int `gorm:"" json:"sort"` //岗位排序
Status string `gorm:"size:4;" json:"status"` //状态
Remark string `gorm:"size:255;" json:"remark"` //描述
CreateBy string `gorm:"size:128;" json:"createBy"`
UpdateBy string `gorm:"size:128;" json:"updateBy"`
DataScope string `gorm:"-" json:"dataScope"`
+9 -9
View File
@@ -8,14 +8,14 @@ import (
type SysRole struct {
RoleId int `json:"roleId" gorm:"primary_key;AUTO_INCREMENT"` // 角色编码
RoleName string `json:"roleName" gorm:"size:128;"` // 角色名称
Status string `json:"status" gorm:"size:4;"` //
RoleKey string `json:"roleKey" gorm:"size:128;"` //角色代码
RoleSort int `json:"roleSort" gorm:""` //角色排序
Flag string `json:"flag" gorm:"size:128;"` //
CreateBy string `json:"createBy" gorm:"size:128;"` //
UpdateBy string `json:"updateBy" gorm:"size:128;"` //
Remark string `json:"remark" gorm:"size:255;"` //备注
RoleName string `json:"roleName" gorm:"size:128;"` // 角色名称
Status string `json:"status" gorm:"size:4;"` //
RoleKey string `json:"roleKey" gorm:"size:128;"` //角色代码
RoleSort int `json:"roleSort" gorm:""` //角色排序
Flag string `json:"flag" gorm:"size:128;"` //
CreateBy string `json:"createBy" gorm:"size:128;"` //
UpdateBy string `json:"updateBy" gorm:"size:128;"` //
Remark string `json:"remark" gorm:"size:255;"` //备注
Admin bool `json:"admin" gorm:"size:4;"`
DataScope string `json:"dataScope" gorm:"size:128;"`
Params string `json:"params" gorm:"-"`
@@ -52,7 +52,7 @@ func (role *SysRole) GetPage(pageSize int, pageIndex int) ([]SysRole, int, error
// 数据权限控制
dataPermission := new(DataPermission)
dataPermission.UserId, _ = tools.StringToInt(role.DataScope)
table,err := dataPermission.GetDataScope("sys_role", table)
table, err := dataPermission.GetDataScope("sys_role", table)
if err != nil {
return nil, 0, err
}
+3 -4
View File
@@ -42,13 +42,13 @@ type SysUserId struct {
type SysUserB struct {
NickName string `gorm:"size:128" json:"nickName"` // 昵称
Phone string `gorm:"size:11" json:"phone"` // 手机号
RoleId int `gorm:"" json:"roleId"` // 角色编码
RoleId int `gorm:"" json:"roleId"` // 角色编码
Salt string `gorm:"size:255" json:"salt"` //盐
Avatar string `gorm:"size:255" json:"avatar"` //头像
Sex string `gorm:"size:255" json:"sex"` //性别
Email string `gorm:"size:128" json:"email"` //邮箱
DeptId int `gorm:"" json:"deptId"` //部门编码
PostId int `gorm:"" json:"postId"` //职位编码
DeptId int `gorm:"" json:"deptId"` //部门编码
PostId int `gorm:"" json:"postId"` //职位编码
CreateBy string `gorm:"size:128" json:"createBy"` //
UpdateBy string `gorm:"size:128" json:"updateBy"` //
Remark string `gorm:"size:255" json:"remark"` //备注
@@ -59,7 +59,6 @@ type SysUserB struct {
BaseModel
}
type SysUser struct {
SysUserId
SysUserB
+2 -2
View File
@@ -6,8 +6,8 @@ import (
)
type SysColumns struct {
ColumnId int `gorm:"primary_key;auto_increment" json:"columnId"`
TableId int `gorm:"" json:"tableId"`
ColumnId int `gorm:"primary_key;auto_increment" json:"columnId"`
TableId int `gorm:"" json:"tableId"`
ColumnName string `gorm:"size:128;" json:"columnName"`
ColumnComment string `gorm:"column:column_comment;size:128;" json:"columnComment"`
ColumnType string `gorm:"column:column_type;size:128;" json:"columnType"`
+1 -1
View File
@@ -6,7 +6,7 @@ import (
)
type SysTables struct {
TableId int `gorm:"primary_key;auto_increment" json:"tableId"` //表编码
TableId int `gorm:"primary_key;auto_increment" json:"tableId"` //表编码
TBName string `gorm:"column:table_name;size:255;" json:"tableName"` //表名称
TableComment string `gorm:"size:255;" json:"tableComment"` //表备注
ClassName string `gorm:"size:255;" json:"className"` //类名