refactor🎨 : uint 调整为 int

This commit is contained in:
zhangwenjian committed 2020-12-21 22:04:20 +08:00
1 parent ab7c34f817
commit 46ea5f18aa
17 files changed
+125 -172

No files matched your search

+11 -13
View File
@@ -1,30 +1,28 @@
package models
import (
"gorm.io/gorm"
"go-admin/common/models"
)
type SysFileDir struct {
gorm.Model
models.ControlBy
models.Model
Label string `json:"label" gorm:"type:varchar(255);comment:目录名称"` // 目录名称
PId uint `json:"pId" gorm:"type:int(11);comment:上级目录"` // 上级目录
PId int `json:"pId" gorm:"type:int(11);comment:上级目录"` // 上级目录
Sort string `json:"sort" gorm:"type:bigint(20);comment:排序"` // 排序
Path string `json:"path" gorm:"type:varchar(255);comment:路径"` // 路径
models.ControlBy
models.ModelTime
}
type SysFileDirL struct {
gorm.Model
models.Model
Label string `json:"label" gorm:"type:varchar(255);comment:目录名称"` // 目录名称
PId int `json:"pId" gorm:"type:int(11);comment:上级目录"` // 上级目录
Sort string `json:"sort" gorm:"type:bigint(20);comment:排序"` // 排序
Path string `json:"path" gorm:"type:varchar(255);comment:路径"` // 路径
models.ControlBy
Label string `json:"label" gorm:"type:varchar(255);comment:目录名称"` // 目录名称
PId uint `json:"pId" gorm:"type:int(11);comment:上级目录"` // 上级目录
Sort string `json:"sort" gorm:"type:bigint(20);comment:排序"` // 排序
Path string `json:"path" gorm:"type:varchar(255);comment:路径"` // 路径
Children []SysFileDirL `json:"children" gorm:"-"` // 下级信息
models.ModelTime
Children []SysFileDirL `json:"children" gorm:"-"` // 下级信息
}
func (SysFileDir) TableName() string { /**/
+9 -11
View File
@@ -1,24 +1,22 @@
package models
import (
"gorm.io/gorm"
"go-admin/common/models"
)
type SysCategory struct {
gorm.Model
models.ControlBy
Name string `json:"name" gorm:"type:varchar(255);comment:名称"` //
Img string `json:"img" gorm:"type:varchar(255);comment:图标"` //
Sort string `json:"sort" gorm:"type:int(4);comment:排序"` //
Status string `json:"status" gorm:"type:int(1);comment:状态"` //
Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"` //
models.Model
Name string `json:"name" gorm:"type:varchar(255);comment:名称"` //
Img string `json:"img" gorm:"type:varchar(255);comment:图标"` //
Sort string `json:"sort" gorm:"type:int(4);comment:排序"` //
Status string `json:"status" gorm:"type:int(1);comment:状态"` //
Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"` //
models.ControlBy
models.ModelTime
}
func (SysCategory) TableName() string {
return "sys_category"
return "sys_category"
}
func (e *SysCategory) Generate() models.ActiveRecord {
+3 -3
View File
@@ -9,7 +9,7 @@ import (
)
type SysJob struct {
JobId uint `json:"jobId" gorm:"primary_key;AUTO_INCREMENT"` // 编码
JobId int `json:"jobId" gorm:"primary_key;AUTO_INCREMENT"` // 编码
JobName string `json:"jobName" gorm:"size:255;"` // 名称
JobGroup string `json:"jobGroup" gorm:"size:255;"` // 任务分组
JobType int `json:"jobType" gorm:"size:1;"` // 任务类型
@@ -40,11 +40,11 @@ func (e *SysJob) GetId() interface{} {
return e.JobId
}
func (e *SysJob) SetCreateBy(createBy uint) {
func (e *SysJob) SetCreateBy(createBy int) {
e.CreateBy = strconv.Itoa(int(createBy))
}
func (e *SysJob) SetUpdateBy(updateBy uint) {
func (e *SysJob) SetUpdateBy(updateBy int) {
e.UpdateBy = strconv.Itoa(int(updateBy))
}
+3 -4
View File
@@ -1,19 +1,18 @@
package system
import (
"gorm.io/gorm"
"go-admin/common/models"
)
type SysConfig struct {
gorm.Model
models.ControlBy
models.Model
ConfigName string `json:"configName" gorm:"type:varchar(128);comment:ConfigName"` //
ConfigKey string `json:"configKey" gorm:"type:varchar(128);comment:ConfigKey"` //
ConfigValue string `json:"configValue" gorm:"type:varchar(255);comment:ConfigValue"` //
ConfigType string `json:"configType" gorm:"type:varchar(64);comment:ConfigType"` //
Remark string `json:"remark" gorm:"type:varchar(128);comment:Remark"` //
models.ControlBy
models.ModelTime
}
func (SysConfig) TableName() string {
+3 -5
View File
@@ -1,17 +1,13 @@
package system
import (
"gorm.io/gorm"
"go-admin/common/models"
"time"
)
type SysLoginLog struct {
gorm.Model
models.ControlBy
models.Model
Username string `json:"username" gorm:"type:varchar(128);comment:用户名"` //
Status string `json:"status" gorm:"type:varchar(4);comment:状态"` //
Ipaddr string `json:"ipaddr" gorm:"type:varchar(255);comment:ip地址"` //
@@ -22,6 +18,8 @@ type SysLoginLog struct {
LoginTime time.Time `json:"loginTime" gorm:"type:timestamp;comment:登录时间"` //
Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"` //
Msg string `json:"msg" gorm:"type:varchar(255);comment:信息"` //
models.ControlBy
models.ModelTime
}
func (SysLoginLog) TableName() string {
+3 -5
View File
@@ -1,17 +1,13 @@
package system
import (
"gorm.io/gorm"
"go-admin/common/models"
"time"
)
type SysOperaLog struct {
gorm.Model
models.ControlBy
models.Model
Title string `json:"title" gorm:"type:varchar(255);comment:操作模块"` //
BusinessType string `json:"businessType" gorm:"type:varchar(128);comment:操作类型"` //
BusinessTypes string `json:"businessTypes" gorm:"type:varchar(128);comment:BusinessTypes"` //
@@ -30,6 +26,8 @@ type SysOperaLog struct {
Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"` //
LatencyTime string `json:"latencyTime" gorm:"type:varchar(128);comment:耗时"` //
UserAgent string `json:"userAgent" gorm:"type:varchar(255);comment:ua"` //
models.ControlBy
models.ModelTime
}
func (SysOperaLog) TableName() string {