3 Star 2 Fork 1

fotomxq/weeekj_core

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fields_page.go 1.90 KB
一键复制 编辑 原始数据 按行查看 历史
fotomxq 提交于 2025-02-05 18:52 +08:00 . 修改项目路径;
package BasePageStyle
import (
"database/sql/driver"
"encoding/json"
"errors"
CoreSQLConfig "gitee.com/fotomxq/weeekj_core/v5/core/sql/config"
"time"
)
// FieldsPage 页面
type FieldsPage 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"`
//系统
System string `db:"system" json:"system"`
//页面识别码
// 同一个系统和商户ID下唯一
Page string `db:"page" json:"page"`
//标题
Title string `db:"title" json:"title"`
//样式结构内容
Data string `db:"data" json:"data"`
//组件列
ComponentList FieldsPageComponentList `db:"component_list" json:"componentList"`
//附加参数
Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"`
}
type FieldsPageComponentList []FieldsPageComponent
// Value sql底层处理器
func (t FieldsPageComponentList) Value() (driver.Value, error) {
return json.Marshal(t)
}
func (t *FieldsPageComponentList) Scan(value interface{}) error {
b, ok := value.([]byte)
if !ok {
return errors.New("type assertion to []byte failed")
}
return json.Unmarshal(b, &t)
}
type FieldsPageComponent struct {
//组件ID
ComponentID int64 `db:"component_id" json:"componentID"`
//组件标识码
ComponentMark string `db:"component_mark" json:"componentMark"`
//样式结构内容
Data string `db:"data" json:"data"`
//附加参数
Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"`
}
// Value sql底层处理器
func (t FieldsPageComponent) Value() (driver.Value, error) {
return json.Marshal(t)
}
func (t *FieldsPageComponent) 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.29

搜索帮助