3 Star 2 Fork 1

fotomxq/weeekj_core

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
data_config.go 1.84 KB
一键复制 编辑 原始数据 按行查看 历史
刘云 提交于 2024-04-20 11:11 +08:00 . 修复审批配置BUG;启动审批路由
package BaseApprover
import (
"database/sql/driver"
"encoding/json"
"errors"
"time"
)
type DataConfig struct {
//ID
ID int64 `db:"id" json:"id"`
//创建时间
CreateAt time.Time `db:"create_at" json:"createAt"`
//更新时间
UpdateAt time.Time `db:"update_at" json:"updateAt"`
//删除时间
DeleteAt time.Time `db:"delete_at" json:"deleteAt"`
//组织ID
OrgID int64 `db:"org_id" json:"orgID" check:"id"`
//关联的模块标识码
// erp_project
ModuleCode string `db:"module_code" json:"moduleCode" check:"des" min:"1" max:"50"`
//名称
Name string `db:"name" json:"name" check:"des" min:"1" max:"300"`
//描述
Des string `db:"des" json:"des" check:"des" min:"1" max:"300" empty:"true"`
//审批分叉标识码
// 用于识别模块内,不同的审批流程
ForkCode string `db:"fork_code" json:"forkCode" check:"des" min:"1" max:"50"`
//审批流配置
Items DataConfigItems `json:"items"`
}
type DataConfigItems []DataConfigItem
// Value sql底层处理器
func (t DataConfigItems) Value() (driver.Value, error) {
return json.Marshal(t)
}
func (t *DataConfigItems) Scan(value interface{}) error {
b, ok := value.([]byte)
if !ok {
return errors.New("type assertion to []byte failed")
}
return json.Unmarshal(b, &t)
}
type DataConfigItem struct {
//审批顺序
FlowOrder int `db:"flow_order" json:"flowOrder" check:"intThan0" empty:"true"`
//组织成员ID
OrgBindID int64 `db:"org_bind_id" json:"orgBindID" check:"id" empty:"true"`
//审批人用户ID
// 用户ID
UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
}
// Value sql底层处理器
func (t DataConfigItem) Value() (driver.Value, error) {
return json.Marshal(t)
}
func (t *DataConfigItem) Scan(value interface{}) error {
b, ok := value.([]byte)
if !ok {
return errors.New("type assertion to []byte failed")
}
return json.Unmarshal(b, &t)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/fotomxq/weeekj_core.git
git@gitee.com:fotomxq/weeekj_core.git
fotomxq
weeekj_core
weeekj_core
v5.4.30

搜索帮助