修改gorm.Model为自定义的全局global.GVA_MODEL 方便自定义基础参数

This commit is contained in:
pixel
2020-10-29 11:23:34 +08:00
parent 7cb172d60a
commit 10d8d7f28a
24 changed files with 191 additions and 168 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
package model
import (
"gorm.io/gorm"
"gin-vue-admin/global"
)
// file struct, 文件结构体
type ExaFile struct {
gorm.Model
global.GVA_MODEL
FileName string
FileMd5 string
FilePath string
@@ -17,7 +17,7 @@ type ExaFile struct {
// file chunk struct, 切片结构体
type ExaFileChunk struct {
gorm.Model
global.GVA_MODEL
ExaFileID uint
FileChunkNumber int
FileChunkPath string
+2 -2
View File
@@ -1,11 +1,11 @@
package model
import (
"gorm.io/gorm"
"gin-vue-admin/global"
)
type ExaCustomer struct {
gorm.Model
global.GVA_MODEL
CustomerName string `json:"customerName" form:"customerName" gorm:"comment:客户名"`
CustomerPhoneData string `json:"customerPhoneData" form:"customerPhoneData" gorm:"comment:客户手机号"`
SysUserID uint `json:"sysUserId" form:"sysUserId" gorm:"comment:管理ID"`
+2 -2
View File
@@ -1,11 +1,11 @@
package model
import (
"gorm.io/gorm"
"gin-vue-admin/global"
)
type ExaFileUploadAndDownload struct {
gorm.Model
global.GVA_MODEL
Name string `json:"name" gorm:"comment:文件名"`
Url string `json:"url" gorm:"comment:文件地址"`
Tag string `json:"tag" gorm:"comment:文件标签"`
+2 -2
View File
@@ -1,11 +1,11 @@
package model
import (
"gorm.io/gorm"
"gin-vue-admin/global"
)
type SysApi struct {
gorm.Model
global.GVA_MODEL
Path string `json:"path" gorm:"comment:api路径"`
Description string `json:"description" gorm:"comment:api中文描述"`
ApiGroup string `json:"apiGroup" gorm:"comment:api组"`
+3 -3
View File
@@ -1,11 +1,11 @@
package model
import (
"gorm.io/gorm"
"gin-vue-admin/global"
)
type SysBaseMenu struct {
gorm.Model
global.GVA_MODEL
MenuLevel uint `json:"-"`
ParentId string `json:"parentId" gorm:"comment:父菜单ID"`
Path string `json:"path" gorm:"comment:路由path"`
@@ -27,7 +27,7 @@ type Meta struct {
}
type SysBaseMenuParameter struct {
gorm.Model
global.GVA_MODEL
SysBaseMenuID uint
Type string `json:"type" gorm:"commit:'地址栏携带参数为params还是query'"`
Key string `json:"key" gorm:"commit:'地址栏携带参数的key'"`
+2 -2
View File
@@ -2,12 +2,12 @@
package model
import (
"gorm.io/gorm"
"gin-vue-admin/global"
)
// 如果含有time.Time 请自行import time包
type SysDictionary struct {
gorm.Model
global.GVA_MODEL
Name string `json:"name" form:"name" gorm:"column:name;comment:字典名(中)"`
Type string `json:"type" form:"type" gorm:"column:type;comment:字典名(英)"`
Status *bool `json:"status" form:"status" gorm:"column:status;comment:状态"`
+2 -2
View File
@@ -2,12 +2,12 @@
package model
import (
"gorm.io/gorm"
"gin-vue-admin/global"
)
// 如果含有time.Time 请自行import time包
type SysDictionaryDetail struct {
gorm.Model
global.GVA_MODEL
Label string `json:"label" form:"label" gorm:"column:label;comment:展示值"`
Value int `json:"value" form:"value" gorm:"column:value;comment:字典值"`
Status *bool `json:"status" form:"status" gorm:"column:status;comment:启用状态"`
+2 -2
View File
@@ -1,10 +1,10 @@
package model
import (
"gorm.io/gorm"
"gin-vue-admin/global"
)
type JwtBlacklist struct {
gorm.Model
global.GVA_MODEL
Jwt string `gorm:"type:text;comment:jwt"`
}
+2 -2
View File
@@ -2,13 +2,13 @@
package model
import (
"gorm.io/gorm"
"gin-vue-admin/global"
"time"
)
// 如果含有time.Time 请自行import time包
type SysOperationRecord struct {
gorm.Model
global.GVA_MODEL
Ip string `json:"ip" form:"ip" gorm:"column:ip;comment:请求ip"`
Method string `json:"method" form:"method" gorm:"column:method;comment:请求方法"`
Path string `json:"path" form:"path" gorm:"column:path;comment:请求路径"`
+2 -2
View File
@@ -1,12 +1,12 @@
package model
import (
"gin-vue-admin/global"
"github.com/satori/go.uuid"
"gorm.io/gorm"
)
type SysUser struct {
gorm.Model
global.GVA_MODEL
UUID uuid.UUID `json:"uuid" gorm:"comment:用户UUID"`
Username string `json:"userName" gorm:"comment:用户登录名"`
Password string `json:"-" gorm:"comment:用户登录密码"`
+3 -3
View File
@@ -1,12 +1,12 @@
package model
import (
"gorm.io/gorm"
"gin-vue-admin/global"
)
// 工作流属性表
type SysWorkflow struct {
gorm.Model
global.GVA_MODEL
WorkflowNickName string `json:"workflowNickName" gorm:"comment:工作流中文名称"` // 工作流名称
WorkflowName string `json:"workflowName" gorm:"comment:工作流英文名称"` // 工作流英文id
WorkflowDescription string `json:"workflowDescription" gorm:"comment:工作流描述"` // 工作流描述
@@ -15,7 +15,7 @@ type SysWorkflow struct {
// 工作流状态表
type SysWorkflowStepInfo struct {
gorm.Model
global.GVA_MODEL
SysWorkflowID uint `json:"workflowID" gorm:"comment:所属工作流ID"` // 所属工作流ID
IsStart bool `json:"isStart" gorm:"comment:是否是开始流节点"` // 是否是开始流节点
StepName string `json:"stepName" gorm:"comment:工作流节点名称"` // 工作流名称
+4 -2
View File
@@ -1,10 +1,12 @@
package model
import "gorm.io/gorm"
import (
"gin-vue-admin/global"
)
// 工作流流转表
type SysWorkFlowProcess struct {
gorm.Model
global.GVA_MODEL
ApplicationID uint `json:"applicationID" gorm:"comment:当前工作流所属申请的ID"` // 当前工作流所属申请的ID
CurrentNode string `json:"currentNode" gorm:"comment:当前进度节点"` // 当前进度节点
HistoricalNode string `json:"historicalNode" gorm:"comment:上一个进度节点"` // 上一个进度节点