diff --git a/base/data_list.go b/base/data_list.go index caea555..04b4a97 100644 --- a/base/data_list.go +++ b/base/data_list.go @@ -1,45 +1,56 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) +type DataListOrder struct { + Sql string `json:"sql"` + Type string `json:"type"` + Direction string `json:"direction"` +} +type DataListGroup struct { + Sql string `json:"sql"` + Type string `json:"type"` +} + +type XlsxImportConfig struct { + Mode int `json:"mode"` + UniqueImportFields []string `json:"uniqueImportFields"` +} type DataList struct { - Uuid string `db:"uuid"` - ResourceUuid string `db:"resource_uuid"` // 所属资源UUID - Code string `db:"code"` // 列表标识 - Name string `db:"name"` // 列表名称 - Title string `db:"title"` // 布局标题 - PrimaryKey string `db:"primaryKey"` // 主键标识 - Layout string `db:"layout"` // 主键标识 - IsOperationColumn bool `db:"isOperationColumn"` // 是否显示操作栏,1是,0否 - OperationColumnWidth int `db:"operationColumnWidth"` // 操作列宽度 - IsPaginate bool `db:"isPaginate"` // 是否分页 - IsTreeData bool `db:"isTreeData"` // 是否使用树形列表 - TreeDataConfig res_type.ResFieldByMap `db:"treeDataConfig"` // 树形列表配置 - IsExpandedRow string `db:"isExpandedRow"` // 列表明细控件 - ExpandedRowConfig res_type.ResFieldByMap `db:"expandedRowConfig"` // 列表明细控件配置 - IsTreeSider bool `db:"isTreeSider"` // 是否打开侧边栏侧边栏 - TreeSiderConfig res_type.ResFieldByMap `db:"treeSiderConfig"` // 侧边栏设置 - IsDynamicRefresh bool `db:"isDynamicRefresh"` // 是否启用动态刷新 - PageSize int `db:"pagesize"` // 分页大小 - IsAuxiliaryPanel bool `db:"isAuxiliaryPanel"` // 是否使用附属面板 - AuxiliaryPanelConfig res_type.ResFieldByMap `db:"auxiliaryPanelConfig"` // 附属面板配置 - SortConfig res_type.ResFieldByAnys `db:"sortConfig"` // 排序设置 - FieldsSort res_type.ResFieldByAnys `db:"fieldsSort"` // 字段排序 - GroupConfig res_type.ResFieldByAnys `db:"groupConfig"` // 分组设置 - XlsxFieldsSort res_type.ResFieldByAnys `db:"xlsxFieldsSort"` // 字段排序 - XlsxImportFieldsSort res_type.ResFieldByAnys `db:"xlsxImportFieldsSort"` // 字段排序 - XlsxImportConfig res_type.ResFieldByMap `db:"xlsxImportConfig"` // 导入设置 - TabsSort res_type.ResFieldByAnys `db:"tabsSort"` // 标签排序 - OperationsSort res_type.ResFieldByAnys `db:"operationsSort"` // 按钮排序 - FsmConfig res_type.ResFieldByAnys `db:"fsmConfig"` // FSM设置 - ApprovalConfig res_type.ResFieldByAnys `db:"approvalConfig"` // 审批设置 - UniqueImportFields res_type.ResFieldByAnys `db:"uniqueImportFields"` // 导入字段唯一效验 - Roles res_type.ResFieldByAnys `db:"roles"` // 列表权限 - IsAuthDB int `db:"is_auth_db"` // 启用权限过滤 - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + ResourceUuid string `db:"resource_uuid"` // 所属资源UUID + Code string `db:"code"` // 列表标识 + Name string `db:"name"` // 列表名称 + Title string `db:"title"` // 布局标题 + PrimaryKey string `db:"primaryKey"` // 主键标识 + Layout string `db:"layout"` // 主键标识 + IsOperationColumn bool `db:"isOperationColumn"` // 是否显示操作栏,1是,0否 + OperationColumnWidth int `db:"operationColumnWidth"` // 操作列宽度 + IsPaginate bool `db:"isPaginate"` // 是否分页 + IsTreeData bool `db:"isTreeData"` // 是否使用树形列表 + TreeDataConfig map[string]any `db:"treeDataConfig"` // 树形列表配置 + IsExpandedRow string `db:"isExpandedRow"` // 列表明细控件 + ExpandedRowConfig map[string]any `db:"expandedRowConfig"` // 列表明细控件配置 + IsTreeSider bool `db:"isTreeSider"` // 是否打开侧边栏侧边栏 + TreeSiderConfig map[string]any `db:"treeSiderConfig"` // 侧边栏设置 + IsDynamicRefresh bool `db:"isDynamicRefresh"` // 是否启用动态刷新 + PageSize int `db:"pagesize"` // 分页大小 + IsAuxiliaryPanel bool `db:"isAuxiliaryPanel"` // 是否使用附属面板 + AuxiliaryPanelConfig map[string]any `db:"auxiliaryPanelConfig"` // 附属面板配置 + SortConfig []DataListOrder `db:"sortConfig"` // 排序设置 + FieldsSort []string `db:"fieldsSort"` // 字段排序 + GroupConfig []DataListGroup `db:"groupConfig"` // 分组设置 + XlsxFieldsSort []string `db:"xlsxFieldsSort"` // 字段排序 + XlsxImportFieldsSort []string `db:"xlsxImportFieldsSort"` // 字段排序 + XlsxImportConfig XlsxImportConfig `db:"xlsxImportConfig"` // 导入设置 + TabsSort []string `db:"tabsSort"` // 标签排序 + OperationsSort []string `db:"operationsSort"` // 按钮排序 + FsmConfig [][2]any `db:"fsmConfig"` // FSM设置 + ApprovalConfig [][2]any `db:"approvalConfig"` // 审批设置 + UniqueImportFields []string `db:"uniqueImportFields"` // 导入字段唯一效验 + Roles []string `db:"roles"` // 列表权限 + IsAuthDB int `db:"is_auth_db"` // 启用权限过滤 + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetDataList func(code string) (DataList, bool) diff --git a/base/data_list_field.go b/base/data_list_field.go index 9d81a35..0b70dc1 100644 --- a/base/data_list_field.go +++ b/base/data_list_field.go @@ -1,36 +1,32 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type DataListField struct { - Uuid string `db:"uuid"` - DataListUuid string `db:"data_list_uuid"` // 所属列表 UUID - Title res_type.ResFieldByString `db:"title"` // 列表标题 - Code string `db:"code"` // 字段名称 - CodeResource string `db:"codeResource"` // 字段所属资源 - Alias string `db:"alias"` // 字段别名 - IsExpr bool `db:"isExpr"` // 字段名是否为SQL表达式 - FieldDataType string `db:"fieldDataType"` // 字段数据类型 - Width int `db:"width"` // 列宽 - IsWidthFixed bool `db:"isWidthFixed"` // 列宽固定 - Fixed bool `db:"fixed"` // 字段冻结 - Align string `db:"align"` // 对齐方式 - IsShow int `db:"isShow"` // 是否显示 - WidgetByJs string `db:"widgetByJs"` // 前端数据渲染控件 - WidgetByJsSetting res_type.ResFieldByMap `db:"widgetByJsSetting"` // 前端数据渲染控件设置参数 - IsSearch bool `db:"isSearch"` // 允许关键字搜索 - IsVirtual bool `db:"isVirtual"` // 是否虚拟字段 - IsSort bool `db:"isSort"` // 允许字段排序 - EditableByJs string `db:"editableByJs"` // 字段更新组件 - EditableByJsSetting res_type.ResFieldByMap `db:"editableByJsSetting"` // 字段更新组件设置 - FilterByJs string `db:"filterByJs"` // 字段筛选组件 - FilterByJsSetting res_type.ResFieldByMap `db:"filterByJsSetting"` // 字段筛选组件设置参数 - FilterOperator string `db:"filterOperator"` // 字段筛选符号 - EditableRoles res_type.ResFieldByAnys `db:"editableRoles"` // 字段编辑权限 - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + DataListUuid string `db:"data_list_uuid"` // 所属列表 UUID + Title string `db:"title"` // 列表标题 + Code string `db:"code"` // 字段名称 + CodeResource string `db:"codeResource"` // 字段所属资源 + Alias string `db:"alias"` // 字段别名 + IsExpr bool `db:"isExpr"` // 字段名是否为SQL表达式 + FieldDataType string `db:"fieldDataType"` // 字段数据类型 + Width int `db:"width"` // 列宽 + IsWidthFixed bool `db:"isWidthFixed"` // 列宽固定 + Fixed bool `db:"fixed"` // 字段冻结 + Align string `db:"align"` // 对齐方式 + IsShow int `db:"isShow"` // 是否显示 + WidgetByJs string `db:"widgetByJs"` // 前端数据渲染控件 + WidgetByJsSetting map[string]any `db:"widgetByJsSetting"` // 前端数据渲染控件设置参数 + IsSearch bool `db:"isSearch"` // 允许关键字搜索 + IsVirtual bool `db:"isVirtual"` // 是否虚拟字段 + IsSort bool `db:"isSort"` // 允许字段排序 + EditableByJs string `db:"editableByJs"` // 字段更新组件 + EditableByJsSetting map[string]any `db:"editableByJsSetting"` // 字段更新组件设置 + FilterByJs string `db:"filterByJs"` // 字段筛选组件 + FilterByJsSetting map[string]any `db:"filterByJsSetting"` // 字段筛选组件设置参数 + FilterOperator string `db:"filterOperator"` // 字段筛选符号 + EditableRoles []string `db:"editableRoles"` // 字段编辑权限 + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetDataListFields func(listUuid string) []DataListField diff --git a/base/data_list_import_field.go b/base/data_list_import_field.go index ca7c10a..cce0cbf 100644 --- a/base/data_list_import_field.go +++ b/base/data_list_import_field.go @@ -1,26 +1,22 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type DataListImportField struct { - Uuid string `db:"uuid"` - DataListUuid string `db:"data_list_uuid"` // 所属列表 UUID - Title res_type.ResFieldByString `db:"title"` // 列表标题 - Code string `db:"code"` // 字段名称 - CodeResource string `db:"codeResource"` // 字段所属资源 - FieldDataType string `db:"fieldDataType"` // 字段数据类型 - Width int `db:"width"` // 列宽 - Align string `db:"align"` // 对齐方式 - IsWidthFixed bool `db:"isWidthFixed"` // 列宽固定 - ConvertByJs string `db:"convertByJs"` // 前端数据转换控件 - ConvertByJsSetting res_type.ResFieldByMap `db:"convertByJsSetting"` // 前端数据转换控件设置参数 - IsVirtual bool `db:"isVirtual"` // 是否虚拟字段 - IsValidator int `db:"isValidator"` // 导入字段验证 - Validators res_type.ResFieldByMap `db:"validators"` // 导入字段验证规则 - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + DataListUuid string `db:"data_list_uuid"` // 所属列表 UUID + Title string `db:"title"` // 列表标题 + Code string `db:"code"` // 字段名称 + CodeResource string `db:"codeResource"` // 字段所属资源 + FieldDataType string `db:"fieldDataType"` // 字段数据类型 + Width int `db:"width"` // 列宽 + Align string `db:"align"` // 对齐方式 + IsWidthFixed bool `db:"isWidthFixed"` // 列宽固定 + ConvertByJs string `db:"convertByJs"` // 前端数据转换控件 + ConvertByJsSetting map[string]any `db:"convertByJsSetting"` // 前端数据转换控件设置参数 + IsVirtual bool `db:"isVirtual"` // 是否虚拟字段 + IsValidator int `db:"isValidator"` // 导入字段验证 + Validators map[string]any `db:"validators"` // 导入字段验证规则 + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetDataListImportFields func(listUuid string) []DataListImportField diff --git a/base/data_list_operation.go b/base/data_list_operation.go index 2928374..5908724 100644 --- a/base/data_list_operation.go +++ b/base/data_list_operation.go @@ -1,38 +1,34 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type DataListOperation struct { - Uuid string `db:"uuid"` - Puuid string `db:"pUuid"` - DataListUuid string `db:"data_list_uuid"` // 所属列表 UUID - Name string `db:"name"` // 按钮名称 - Code string `db:"code"` // 按钮标识 - Category string `db:"category"` // 按钮类型 - Icon string `db:"icon"` // 按钮图标 - Size string `db:"size"` // 按钮大小 - Block bool `db:"block"` // 固定宽度 - Ghost bool `db:"ghost"` // 背景透明 - Shape string `db:"shape"` // 按钮形状 - Type string `db:"type"` // 按钮样式 - IsPopConfirm bool `db:"isPopConfirm"` // 按钮提示 - PopTitle string `db:"popTitle"` // 按钮提示 - PopOkText string `db:"popOkText"` // 按钮提示 - PopCancelText string `db:"popCancelText"` // 按钮提示 - PopOkType string `db:"popOkType"` // 按钮提示 - PopPlacement string `db:"popPlacement"` // 按钮提示 - Widget string `db:"widget"` // 按钮组件 - WidgetType string `db:"widgetType"` // 组件类型 - WidgetProps res_type.ResFieldByMap `db:"widgetProps"` // 组件PROPS - WidgetSetting res_type.ResFieldByMap `db:"widgetSetting"` // 组件设置 - WidgetContainerSetting res_type.ResFieldByMap `db:"widgetContainerSetting"` // 组件容器设置 - IsRefresh int `db:"isRefresh"` // 0不刷新, 1刷新所有数据, 2刷新一条数据 - NoAuthType string `db:"noAuthType"` // 无按钮权限处理方式 - Roles res_type.ResFieldByAnys `db:"roles"` // 按钮权限 - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + Puuid string `db:"pUuid"` + DataListUuid string `db:"data_list_uuid"` // 所属列表 UUID + Name string `db:"name"` // 按钮名称 + Code string `db:"code"` // 按钮标识 + Category string `db:"category"` // 按钮类型 + Icon string `db:"icon"` // 按钮图标 + Size string `db:"size"` // 按钮大小 + Block bool `db:"block"` // 固定宽度 + Ghost bool `db:"ghost"` // 背景透明 + Shape string `db:"shape"` // 按钮形状 + Type string `db:"type"` // 按钮样式 + IsPopConfirm bool `db:"isPopConfirm"` // 按钮提示 + PopTitle string `db:"popTitle"` // 按钮提示 + PopOkText string `db:"popOkText"` // 按钮提示 + PopCancelText string `db:"popCancelText"` // 按钮提示 + PopOkType string `db:"popOkType"` // 按钮提示 + PopPlacement string `db:"popPlacement"` // 按钮提示 + Widget string `db:"widget"` // 按钮组件 + WidgetType string `db:"widgetType"` // 组件类型 + WidgetProps map[string]any `db:"widgetProps"` // 组件PROPS + WidgetSetting map[string]any `db:"widgetSetting"` // 组件设置 + WidgetContainerSetting map[string]any `db:"widgetContainerSetting"` // 组件容器设置 + IsRefresh int `db:"isRefresh"` // 0不刷新, 1刷新所有数据, 2刷新一条数据 + NoAuthType string `db:"noAuthType"` // 无按钮权限处理方式 + Roles []string `db:"roles"` // 按钮权限 + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetDataListOperations func(listUuid string) []DataListOperation diff --git a/base/data_list_tab.go b/base/data_list_tab.go index cdeb218..abdf137 100644 --- a/base/data_list_tab.go +++ b/base/data_list_tab.go @@ -1,19 +1,15 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type DataListTab struct { - Uuid string `db:"uuid"` - DataListUuid string `db:"data_list_uuid"` // 所属列表 UUID - Label string `db:"label"` // 标签名 - Code string `db:"code"` // 标签标识 - Order res_type.ResFieldByAnys `db:"order"` // 排序 - UseOrderMode int `db:"useOrderMode"` // 排序模式 - IsDefault bool `db:"isDefault"` // 是否默认 - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + DataListUuid string `db:"data_list_uuid"` // 所属列表 UUID + Label string `db:"label"` // 标签名 + Code string `db:"code"` // 标签标识 + Order []DataListOrder `db:"order"` // 排序 + UseOrderMode int `db:"useOrderMode"` // 排序模式 + IsDefault bool `db:"isDefault"` // 是否默认 + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetDataListTabs func(listUuid string) []DataListTab diff --git a/base/data_list_xlsx_field.go b/base/data_list_xlsx_field.go index aabda87..cd8c938 100644 --- a/base/data_list_xlsx_field.go +++ b/base/data_list_xlsx_field.go @@ -1,21 +1,17 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type DataListXlsxField struct { - Uuid string `db:"uuid"` - DataListUuid string `db:"data_list_uuid"` // 所属列表 UUID - Title res_type.ResFieldByString `db:"title"` // 列表标题 - Code string `db:"code"` // 字段名称 - CodeResource string `db:"codeResource"` // 字段所属资源 - Alias string `db:"alias"` // 字段别名 - FieldDataType string `db:"fieldDataType"` // 字段数据类型 - IsExpr bool `db:"isExpr"` // 字段名是否为SQL表达式 - IsShow bool `db:"isShow"` // 字段名是否为SQL表达式 - ConvertByJs string `db:"convertByJs"` // 字段数据转换组件 - ConvertByJsSetting res_type.ResFieldByMap `db:"convertByJsSetting"` // 字段数据转换组件参数 + Uuid string `db:"uuid"` + DataListUuid string `db:"data_list_uuid"` // 所属列表 UUID + Title string `db:"title"` // 列表标题 + Code string `db:"code"` // 字段名称 + CodeResource string `db:"codeResource"` // 字段所属资源 + Alias string `db:"alias"` // 字段别名 + FieldDataType string `db:"fieldDataType"` // 字段数据类型 + IsExpr bool `db:"isExpr"` // 字段名是否为SQL表达式 + IsShow bool `db:"isShow"` // 字段名是否为SQL表达式 + ConvertByJs string `db:"convertByJs"` // 字段数据转换组件 + ConvertByJsSetting map[string]any `db:"convertByJsSetting"` // 字段数据转换组件参数 } type GetDataListXlsxFields func(listUuid string) []DataListXlsxField diff --git a/base/fsm_transition.go b/base/fsm_transition.go index d66a578..6440b38 100644 --- a/base/fsm_transition.go +++ b/base/fsm_transition.go @@ -1,33 +1,29 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type FsmTransition struct { - Uuid string `db:"uuid"` - FsmUuid string `db:"fsm_uuid"` - Name string `db:"name"` - Code string `db:"code"` - From string `db:"from"` - To string `db:"to"` - ResourceUuid string `db:"resource_uuid"` - FsmName string `db:"fsm_name"` - PrimaryKey string `db:"primaryKey"` - StatusField string `db:"statusField"` - StatusOptions res_type.ResFieldByAnys `db:"statusOptions"` - IsPopConfirm bool `db:"isPopConfirm"` - PopTitle string `db:"popTitle"` - PopOkText string `db:"popOkText"` - PopCancelText string `db:"popCancelText"` - PopOkType string `db:"popOkType"` - PopPlacement string `db:"popPlacement"` - WidgetContainerSetting res_type.ResFieldByMap `db:"widgetContainerSetting"` - Roles res_type.ResFieldByAnys `db:"roles"` - OperationRoles res_type.ResFieldByAnys `db:"operationRoles"` - IsWithLayoutForm bool `db:"isWithLayoutForm"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + FsmUuid string `db:"fsm_uuid"` + Name string `db:"name"` + Code string `db:"code"` + From string `db:"from"` + To string `db:"to"` + ResourceUuid string `db:"resource_uuid"` + FsmName string `db:"fsm_name"` + PrimaryKey string `db:"primaryKey"` + StatusField string `db:"statusField"` + StatusOptions []map[string]string `db:"statusOptions"` + IsPopConfirm bool `db:"isPopConfirm"` + PopTitle string `db:"popTitle"` + PopOkText string `db:"popOkText"` + PopCancelText string `db:"popCancelText"` + PopOkType string `db:"popOkType"` + PopPlacement string `db:"popPlacement"` + WidgetContainerSetting map[string]any `db:"widgetContainerSetting"` + Roles []string `db:"roles"` + OperationRoles []string `db:"operationRoles"` + IsWithLayoutForm bool `db:"isWithLayoutForm"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetFsmTransition func(uuid string) (FsmTransition, bool) diff --git a/base/grid_layout.go b/base/grid_layout.go index b1922b4..6c824a1 100644 --- a/base/grid_layout.go +++ b/base/grid_layout.go @@ -1,24 +1,20 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type GridLayout struct { - Uuid string `db:"uuid"` - ResourceUuid string `db:"resource_uuid"` // 所属资源UUID - Code string `db:"code"` // 布局标识 - Name string `db:"name"` // 布局名称 - PrimaryKey string `db:"primaryKey"` // 主键 - MarginX int `db:"marginX"` // 栅格 x 间距 - MarginY int `db:"marginY"` // 栅格 y 间距 - Cols int `db:"cols"` // 网格列基数 - RowHeight int `db:"rowHeight"` // 栅格行高 - Css res_type.ResFieldByMap `db:"css"` // 布局CSS - Props res_type.ResFieldByAnys `db:"props"` // 布局PROPS - Roles res_type.ResFieldByAnys `db:"roles"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + ResourceUuid string `db:"resource_uuid"` // 所属资源UUID + Code string `db:"code"` // 布局标识 + Name string `db:"name"` // 布局名称 + PrimaryKey string `db:"primaryKey"` // 主键 + MarginX int `db:"marginX"` // 栅格 x 间距 + MarginY int `db:"marginY"` // 栅格 y 间距 + Cols int `db:"cols"` // 网格列基数 + RowHeight int `db:"rowHeight"` // 栅格行高 + Css map[string]any `db:"css"` // 布局CSS + Props []any `db:"props"` // 布局PROPS + Roles []string `db:"roles"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetGridLayout func(code string) (GridLayout, bool) diff --git a/base/grid_layout_field.go b/base/grid_layout_field.go index e12b820..3f7e250 100644 --- a/base/grid_layout_field.go +++ b/base/grid_layout_field.go @@ -1,32 +1,30 @@ package base -import "git.fsdpf.net/go/contracts/res_type" - type GridLayoutField struct { - Uuid string `db:"uuid"` - GridLayoutUuid string `db:"grid_layout_uuid"` // 所属布局 UUID - Type string `db:"type"` - X int `db:"x"` - Y int `db:"y"` - W int `db:"w"` - H int `db:"h"` - MinH int `db:"minH"` - MinW int `db:"minW"` - MaxH int `db:"maxH"` - MaxW int `db:"maxW"` - Code string `db:"code"` - Label string `db:"label"` - Widget string `db:"widget"` - WidgetPerfix string `db:"widgetPerfix"` - WidgetDecorator res_type.ResFieldByString `db:"widgetDecorator"` - SubWidgets res_type.ResFieldByAnys `db:"subWidgets"` - InitialValue string `db:"initialValue"` - Css res_type.ResFieldByMap `db:"css"` - Extras res_type.ResFieldByMap `db:"extras"` - Hidden bool `db:"hidden"` - IsVirtual bool `db:"isVirtual"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + GridLayoutUuid string `db:"grid_layout_uuid"` // 所属布局 UUID + Type string `db:"type"` + X int `db:"x"` + Y int `db:"y"` + W int `db:"w"` + H int `db:"h"` + MinH int `db:"minH"` + MinW int `db:"minW"` + MaxH int `db:"maxH"` + MaxW int `db:"maxW"` + Code string `db:"code"` + Label string `db:"label"` + Widget string `db:"widget"` + WidgetPerfix string `db:"widgetPerfix"` + WidgetDecorator string `db:"widgetDecorator"` + SubWidgets []map[string]any `db:"subWidgets"` + InitialValue string `db:"initialValue"` + Css map[string]any `db:"css"` + Extras map[string]any `db:"extras"` + Hidden bool `db:"hidden"` + IsVirtual bool `db:"isVirtual"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetGridLayoutFields func(uuid string) []GridLayoutField diff --git a/base/grid_layout_form.go b/base/grid_layout_form.go index 4325f7e..dc6a6f4 100644 --- a/base/grid_layout_form.go +++ b/base/grid_layout_form.go @@ -1,25 +1,23 @@ package base -import "git.fsdpf.net/go/contracts/res_type" - type GridLayoutForm struct { - Uuid string `db:"uuid"` - ResourceUuid string `db:"resource_uuid"` // 所属资源UUID - Code string `db:"code"` // 布局标识 - Name string `db:"name"` // 布局名称 - Type int `db:"type"` // 布局类型 - Align string `db:"align"` // 方向 - PrimaryKey string `db:"primaryKey"` // 主键 - AutoComplete string `db:"autoComplete"` // 自动填充表单, off | on - RowHeight int `db:"rowHeight"` // 栅格行高 - MarginX int `db:"marginX"` // 栅格 x 间距 - MarginY int `db:"marginY"` // 栅格 y 间距 - FormProps res_type.ResFieldByAnys `db:"formProps"` // 表单PROPS - ListenChangeFields res_type.ResFieldByAnys `db:"listenChangeFields"` // 监听字段 - ListenChangeFieldsFunc res_type.ResFieldByString `db:"listenChangeFieldsFunc"` // 监听字段回调方法 - Roles res_type.ResFieldByAnys `db:"roles"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + ResourceUuid string `db:"resource_uuid"` // 所属资源UUID + Code string `db:"code"` // 布局标识 + Name string `db:"name"` // 布局名称 + Type int `db:"type"` // 布局类型 + Align string `db:"align"` // 方向 + PrimaryKey string `db:"primaryKey"` // 主键 + AutoComplete string `db:"autoComplete"` // 自动填充表单, off | on + RowHeight int `db:"rowHeight"` // 栅格行高 + MarginX int `db:"marginX"` // 栅格 x 间距 + MarginY int `db:"marginY"` // 栅格 y 间距 + FormProps []map[string]string `db:"formProps"` // 表单PROPS + ListenChangeFields []string `db:"listenChangeFields"` // 监听字段 + ListenChangeFieldsFunc string `db:"listenChangeFieldsFunc"` // 监听字段回调方法 + Roles []string `db:"roles"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetGridLayoutForm func(code string) (GridLayoutForm, bool) diff --git a/base/grid_layout_form_field.go b/base/grid_layout_form_field.go index c464779..73639a4 100644 --- a/base/grid_layout_form_field.go +++ b/base/grid_layout_form_field.go @@ -1,37 +1,33 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type GridLayoutFormField struct { - Uuid string `db:"uuid"` - GridLayoutFormUuid string `db:"grid_layout_form_uuid"` // 所属布局 UUID - Type string `db:"type"` - X int `db:"x"` - Y int `db:"y"` - W int `db:"w"` - H int `db:"h"` - MinH int `db:"minH"` - MinW int `db:"minW"` - MaxH int `db:"maxH"` - MaxW int `db:"maxW"` - Code string `db:"code"` - Label string `db:"label"` - Widget string `db:"widget"` - WidgetPerfix string `db:"widgetPerfix"` - WidgetDecorator res_type.ResFieldByString `db:"widgetDecorator"` - SubWidgets res_type.ResFieldByAnys `db:"subWidgets"` - Placeholder string `db:"placeholder"` - Help string `db:"help"` - Disabled int `db:"disabled"` - InitialValue string `db:"initialValue"` - Extras res_type.ResFieldByMap `db:"extras"` - Validators res_type.ResFieldByMap `db:"validators"` - Hidden bool `db:"hidden"` - IsVirtual bool `db:"isVirtual"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + GridLayoutFormUuid string `db:"grid_layout_form_uuid"` // 所属布局 UUID + Type string `db:"type"` + X int `db:"x"` + Y int `db:"y"` + W int `db:"w"` + H int `db:"h"` + MinH int `db:"minH"` + MinW int `db:"minW"` + MaxH int `db:"maxH"` + MaxW int `db:"maxW"` + Code string `db:"code"` + Label string `db:"label"` + Widget string `db:"widget"` + WidgetPerfix string `db:"widgetPerfix"` + WidgetDecorator string `db:"widgetDecorator"` + SubWidgets []any `db:"subWidgets"` + Placeholder string `db:"placeholder"` + Help string `db:"help"` + Disabled int `db:"disabled"` + InitialValue string `db:"initialValue"` + Extras map[string]any `db:"extras"` + Validators map[string]any `db:"validators"` + Hidden bool `db:"hidden"` + IsVirtual bool `db:"isVirtual"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetGridLayoutFormFields func(uuid string) []GridLayoutFormField diff --git a/base/layout.go b/base/layout.go index c110790..1043f5c 100644 --- a/base/layout.go +++ b/base/layout.go @@ -1,27 +1,23 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type Layout struct { - Uuid string `db:"uuid"` - ResourceUuid string `db:"resource_uuid"` // 所属资源UUID - Code string `db:"code"` // 布局标识 - Name string `db:"name"` // 布局名称 - Type int `db:"type"` // 布局类型 - Align string `db:"align"` // 方向 - PrimaryKey string `db:"primaryKey"` // 主键 - AutoComplete string `db:"autoComplete"` // 自动填充表单, off | on - RowHeight int `db:"rowHeight"` // 栅格行高 - MarginX int `db:"marginX"` // 栅格 x 间距 - MarginY int `db:"marginY"` // 栅格 y 间距 - FormProps res_type.ResFieldByAnys `db:"formProps"` // 表单PROPS - ListenChangeFields res_type.ResFieldByAnys `db:"listenChangeFields"` // 监听字段 - ListenChangeFieldsFunc res_type.ResFieldByString `db:"listenChangeFieldsFunc"` // 监听字段回调方法 - Roles res_type.ResFieldByAnys `db:"roles"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + ResourceUuid string `db:"resource_uuid"` // 所属资源UUID + Code string `db:"code"` // 布局标识 + Name string `db:"name"` // 布局名称 + Type int `db:"type"` // 布局类型 + Align string `db:"align"` // 方向 + PrimaryKey string `db:"primaryKey"` // 主键 + AutoComplete string `db:"autoComplete"` // 自动填充表单, off | on + RowHeight int `db:"rowHeight"` // 栅格行高 + MarginX int `db:"marginX"` // 栅格 x 间距 + MarginY int `db:"marginY"` // 栅格 y 间距 + FormProps []map[string]string `db:"formProps"` // 表单PROPS + ListenChangeFields []string `db:"listenChangeFields"` // 监听字段 + ListenChangeFieldsFunc string `db:"listenChangeFieldsFunc"` // 监听字段回调方法 + Roles []string `db:"roles"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetLayout func(code string) (Layout, bool) diff --git a/base/layout_field.go b/base/layout_field.go index a5175df..11213a2 100644 --- a/base/layout_field.go +++ b/base/layout_field.go @@ -1,37 +1,33 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type LayoutField struct { - Uuid string `db:"uuid"` - LayoutUuid string `db:"layout_uuid"` // 所属布局 UUID - Type string `db:"type"` - X int `db:"x"` - Y int `db:"y"` - W int `db:"w"` - H int `db:"h"` - MinH int `db:"minH"` - MinW int `db:"minW"` - MaxH int `db:"maxH"` - MaxW int `db:"maxW"` - Code string `db:"code"` - Label string `db:"label"` - Widget string `db:"widget"` - WidgetPerfix string `db:"widgetPerfix"` - WidgetDecorator res_type.ResFieldByString `db:"widgetDecorator"` - SubWidgets res_type.ResFieldByAnys `db:"subWidgets"` - Placeholder string `db:"placeholder"` - Help string `db:"help"` - Disabled int `db:"disabled"` - InitialValue string `db:"initialValue"` - Extras res_type.ResFieldByMap `db:"extras"` - Validators res_type.ResFieldByMap `db:"validators"` - Hidden bool `db:"hidden"` - IsVirtual bool `db:"isVirtual"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + LayoutUuid string `db:"layout_uuid"` // 所属布局 UUID + Type string `db:"type"` + X int `db:"x"` + Y int `db:"y"` + W int `db:"w"` + H int `db:"h"` + MinH int `db:"minH"` + MinW int `db:"minW"` + MaxH int `db:"maxH"` + MaxW int `db:"maxW"` + Code string `db:"code"` + Label string `db:"label"` + Widget string `db:"widget"` + WidgetPerfix string `db:"widgetPerfix"` + WidgetDecorator string `db:"widgetDecorator"` + SubWidgets []map[string]any `db:"subWidgets"` + Placeholder string `db:"placeholder"` + Help string `db:"help"` + Disabled int `db:"disabled"` + InitialValue string `db:"initialValue"` + Extras map[string]any `db:"extras"` + Validators map[string]any `db:"validators"` + Hidden bool `db:"hidden"` + IsVirtual bool `db:"isVirtual"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetLayoutFields func(uuid string) []LayoutField diff --git a/base/menu.go b/base/menu.go index 1e82910..ec1dbd7 100644 --- a/base/menu.go +++ b/base/menu.go @@ -1,25 +1,21 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type Menu struct { - Uuid string `db:"uuid"` - Id int `db:"id"` - Pid int `db:"pid"` - Type string `db:"type"` - Name string `db:"name"` - Icon string `db:"icon"` - Widget string `db:"widget"` - WidgetType string `db:"widgetType"` - WidgetProps res_type.ResFieldByMap `db:"widgetProps"` - WidgetSetting res_type.ResFieldByMap `db:"widgetSetting"` - WidgetContainerSetting res_type.ResFieldByMap `db:"widgetContainerSetting"` - Roles res_type.ResFieldByAnys `db:"roles"` - Platform string `db:"platform"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + Id int `db:"id"` + Pid int `db:"pid"` + Type string `db:"type"` + Name string `db:"name"` + Icon string `db:"icon"` + Widget string `db:"widget"` + WidgetType string `db:"widgetType"` + WidgetProps map[string]any `db:"widgetProps"` + WidgetSetting map[string]any `db:"widgetSetting"` + WidgetContainerSetting map[string]any `db:"widgetContainerSetting"` + Roles []string `db:"roles"` + Platform string `db:"platform"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetMenus func(platform string, roles ...string) []Menu diff --git a/base/print_template.go b/base/print_template.go index 30dca4c..091322a 100644 --- a/base/print_template.go +++ b/base/print_template.go @@ -1,19 +1,15 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type PrintTemplate struct { - Uuid string `db:"uuid"` - ResourceUuid string `db:"resource_uuid"` // 所属资源UUID - Code string `db:"code"` // 打印模板标识 - Name string `db:"name"` // 打印模板名称 - PrimaryKey string `db:"primaryKey"` // 主键标识 - Roles res_type.ResFieldByAnys `db:"roles"` // 打印权限 - Template res_type.ResFieldByMap `db:"template"` // 打印权限 - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + ResourceUuid string `db:"resource_uuid"` // 所属资源UUID + Code string `db:"code"` // 打印模板标识 + Name string `db:"name"` // 打印模板名称 + PrimaryKey string `db:"primaryKey"` // 主键标识 + Roles []string `db:"roles"` // 打印权限 + Template map[string]any `db:"template"` // 打印权限 + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetPrintTemplate func(uuid string) (PrintTemplate, bool) diff --git a/base/print_template_field.go b/base/print_template_field.go index c8d4ac3..83de284 100644 --- a/base/print_template_field.go +++ b/base/print_template_field.go @@ -1,23 +1,19 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type PrintTemplateField struct { - Uuid string `db:"uuid"` - PrintTemplateUuid string `db:"print_template_uuid"` // 所属打印模板UUID - Label res_type.ResFieldByString `db:"label"` // 字段标签 - Code string `db:"code"` // 字段名称 - CodeResource string `db:"codeResource"` // 字段所属资源 - Category string `db:"category"` // 字段控件类型 - Alias string `db:"alias"` // 字段别名 - IsExpr bool `db:"isExpr"` // 字段名是否为SQL表达式 - FieldDataType string `db:"fieldDataType"` // 字段数据类型 - WidgetByJs string `db:"widgetByJs"` // 前端数据渲染控件 - WidgetByJsSetting res_type.ResFieldByMap `db:"widgetByJsSetting"` // 前端数据渲染控件设置参数 - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + PrintTemplateUuid string `db:"print_template_uuid"` // 所属打印模板UUID + Label string `db:"label"` // 字段标签 + Code string `db:"code"` // 字段名称 + CodeResource string `db:"codeResource"` // 字段所属资源 + Category string `db:"category"` // 字段控件类型 + Alias string `db:"alias"` // 字段别名 + IsExpr bool `db:"isExpr"` // 字段名是否为SQL表达式 + FieldDataType string `db:"fieldDataType"` // 字段数据类型 + WidgetByJs string `db:"widgetByJs"` // 前端数据渲染控件 + WidgetByJsSetting map[string]any `db:"widgetByJsSetting"` // 前端数据渲染控件设置参数 + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetPrintTemplateFields func(uuid string) []PrintTemplateField diff --git a/base/query_field.go b/base/query_field.go index dbc6c49..89b1d38 100644 --- a/base/query_field.go +++ b/base/query_field.go @@ -102,7 +102,7 @@ func (this *QueryField) ToStructField(tags ...string) reflect.StructField { switch this.typ { case contracts.QueryDataType_String: - typ = reflect.TypeOf(res_type.ResFieldByString("")) + typ = reflect.TypeOf(string("")) case contracts.QueryDataType_Number: typ = reflect.TypeOf(res_type.ResFieldByNumber(0)) case contracts.QueryDataType_Integer: @@ -114,7 +114,7 @@ func (this *QueryField) ToStructField(tags ...string) reflect.StructField { case contracts.QueryDataType_Array: typ = reflect.TypeOf(res_type.ResFieldByAnys{}) case contracts.QueryDataType_Json: - typ = reflect.TypeOf(res_type.ResFieldByMap{}) + typ = reflect.TypeOf(map[string]any{}) } return reflect.StructField{ diff --git a/base/res_api.go b/base/res_api.go index 745dfd8..004e6f9 100644 --- a/base/res_api.go +++ b/base/res_api.go @@ -1,23 +1,27 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) +type ResApiParam struct { + Code string `db:"code"` + Name string `db:"name"` + Category string `db:"category"` + DataType string `db:"type"` + isRequired bool `db:"isRequired"` +} type ResApi struct { - Uuid string `db:"uuid"` - Code string `db:"code"` - UriPrefix string `db:"uri_prefix"` - Name string `db:"name"` - PrimaryKey string `db:"primaryKey"` - ResourceUuid string `db:"resource_uuid"` - Method string `db:"method"` - Category string `db:"action"` - Params res_type.ResFieldByAnys `db:"params"` - Roles res_type.ResFieldByAnys `db:"roles"` - IsAuthDB int `db:"is_auth_db"` // 启用权限过滤 - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + Code string `db:"code"` + UriPrefix string `db:"uri_prefix"` + Name string `db:"name"` + PrimaryKey string `db:"primaryKey"` + ResourceUuid string `db:"resource_uuid"` + Method string `db:"method"` + Category string `db:"action"` + Params []ResApiParam `db:"params"` + Roles []string `db:"roles"` + IsAuthDB int `db:"is_auth_db"` // 启用权限过滤 + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetResApi func(code string) (ResApi, bool) diff --git a/base/res_api_approval.go b/base/res_api_approval.go index 3be43de..53d8898 100644 --- a/base/res_api_approval.go +++ b/base/res_api_approval.go @@ -1,20 +1,27 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) +type ResApiApprovalFlow struct { + Uuid string `json:"uuid"` + Code string `json:"code"` + Name string `json:"name"` + RoleUuid string `json:"role_uuid"` + Type int64 `json:"type"` + Yes string `json:"yes"` + No string `json:"no"` + Comment string `json:"comment"` +} type ResApiApproval struct { - Uuid string `db:"uuid"` - ApiUuid string `db:"api_uuid"` - Code string `db:"code"` - Name string `db:"name"` - MarkField string `db:"markField"` - RolesUuid res_type.ResFieldByAnys `db:"rolesUuid"` - Flows res_type.ResFieldByAnys `db:"flows"` - Roles res_type.ResFieldByAnys `db:"roles"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + ApiUuid string `db:"api_uuid"` + Code string `db:"code"` + Name string `db:"name"` + MarkField string `db:"markField"` + RolesUuid []string `db:"rolesUuid"` + Flows []ResApiApprovalFlow `db:"flows"` + Roles []string `db:"roles"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetResApiApproval func(code string) (ResApiApproval, bool) diff --git a/base/res_field.go b/base/res_field.go index f6e4664..a03a495 100644 --- a/base/res_field.go +++ b/base/res_field.go @@ -40,7 +40,7 @@ func (this ResField) ToStructField(tags ...string) reflect.StructField { switch this.DataType { case contracts.ResDataType_String, contracts.ResDataType_Text, contracts.ResDataType_Enum, contracts.ResDataType_Timestamp, contracts.ResDataType_Date, contracts.ResDataType_Datetime: - typ = reflect.TypeOf(res_type.ResFieldByString("")) + typ = reflect.TypeOf(string("")) case contracts.ResDataType_Integer, contracts.ResDataType_SmallInteger: typ = reflect.TypeOf(res_type.ResFieldByInteger(0)) case contracts.ResDataType_Decimal: @@ -51,7 +51,7 @@ func (this ResField) ToStructField(tags ...string) reflect.StructField { if this.Default != "" && this.Default[0:1] == "[" { typ = reflect.TypeOf(res_type.ResFieldByAnys{}) } else { - typ = reflect.TypeOf(res_type.ResFieldByMap{}) + typ = reflect.TypeOf(map[string]any{}) } } @@ -109,7 +109,7 @@ func (this ResField) ToValue(v any) any { v = float64(data) case res_type.ResFieldByNumber: v = float64(data) - case res_type.ResFieldByString: + case string: v = strings.Trim(string(data), " ") case res_type.ResFieldByAnys: if v != nil { @@ -117,12 +117,6 @@ func (this ResField) ToValue(v any) any { return string(b) } v = []any(data) - case res_type.ResFieldByMap: - if v != nil { - b, _ := json.Marshal(v) - return string(b) - } - v = map[string]any(data) case []any, []string, []int, []float64, []float32, []int64: if v != nil { b, _ := json.Marshal(v) diff --git a/base/res_widget_operations.go b/base/res_widget_operations.go index c31be0d..7afab59 100644 --- a/base/res_widget_operations.go +++ b/base/res_widget_operations.go @@ -1,19 +1,15 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type ResWidgetOperation struct { - Uuid string `db:"uuid"` - WidgetUuid string `db:"widget_uuid"` - Name string `db:"name"` - NoAuthType string `db:"noAuthType"` - PropsAuthRule res_type.ResFieldByAnys `db:"propsAuthRule"` - ExtraAuthRule res_type.ResFieldByAnys `db:"extraAuthRule"` - Roles res_type.ResFieldByAnys `db:"roles"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + WidgetUuid string `db:"widget_uuid"` + Name string `db:"name"` + NoAuthType string `db:"noAuthType"` + PropsAuthRule []any `db:"propsAuthRule"` + ExtraAuthRule []any `db:"extraAuthRule"` + Roles []string `db:"roles"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetResWidgetOperations func(roles ...string) []ResWidgetOperation diff --git a/base/resource.go b/base/resource.go index d8fe790..7df7d10 100644 --- a/base/resource.go +++ b/base/resource.go @@ -12,7 +12,6 @@ import ( "git.fsdpf.net/go/contracts" "git.fsdpf.net/go/contracts/helper" - "git.fsdpf.net/go/contracts/res_type" "git.fsdpf.net/go/contracts/support" "git.fsdpf.net/go/db" ) @@ -42,21 +41,21 @@ type ResChangeRecordTopicPayload struct { type Resource struct { container *do.Injector - Uuid string `db:"uuid"` - PUuid string `db:"pUuid"` - Code string `db:"code"` - Name string `db:"name"` - IsResVirtual bool `db:"isVirtual"` - Table string `db:"table"` - Namespace string `db:"namespace"` - Workspace string `db:"workspace"` - Primarykey string `db:"primaryKey"` - IsHistoryRecord bool `db:"isHistoryRecord"` - HistoryCacheMax int `db:"historyCacheMax"` - Fields ResFields `db:"fields"` - Roles res_type.ResFieldByMap `db:"roles"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + PUuid string `db:"pUuid"` + Code string `db:"code"` + Name string `db:"name"` + IsResVirtual bool `db:"isVirtual"` + Table string `db:"table"` + Namespace string `db:"namespace"` + Workspace string `db:"workspace"` + Primarykey string `db:"primaryKey"` + IsHistoryRecord bool `db:"isHistoryRecord"` + HistoryCacheMax int `db:"historyCacheMax"` + Fields ResFields `db:"fields"` + Roles map[string]any `db:"roles"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } func (this *Resource) InitContainer(container *do.Injector) { diff --git a/base/route.go b/base/route.go index f3546d6..6cb4080 100644 --- a/base/route.go +++ b/base/route.go @@ -1,25 +1,21 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type Route struct { - Uuid string `db:"uuid"` - Name string `db:"name"` - Uri string `db:"uri"` - Layout string `db:"layout"` - IsLogin bool `db:"isLogin"` - IsPhone bool `db:"isPhone"` - Type string `db:"type"` - Component string `db:"component"` - WidgetProps res_type.ResFieldByMap `db:"widgetProps"` - WidgetSetting res_type.ResFieldByMap `db:"widgetSetting"` - WidgetContainerSetting res_type.ResFieldByMap `db:"widgetContainerSetting"` - Exact bool `db:"exact"` - Platform string `db:"platform"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + Name string `db:"name"` + Uri string `db:"uri"` + Layout string `db:"layout"` + IsLogin bool `db:"isLogin"` + IsPhone bool `db:"isPhone"` + Type string `db:"type"` + Component string `db:"component"` + WidgetProps map[string]any `db:"widgetProps"` + WidgetSetting map[string]any `db:"widgetSetting"` + WidgetContainerSetting map[string]any `db:"widgetContainerSetting"` + Exact bool `db:"exact"` + Platform string `db:"platform"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } // 前端路由 diff --git a/go.mod b/go.mod index 1feedcc..1b7c1e4 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.fsdpf.net/go/contracts go 1.18 require ( - git.fsdpf.net/go/db v0.0.0-20230412075825-59b3faa171bc + git.fsdpf.net/go/db v0.0.0-20230621051209-5740d112407f github.com/go-chi/chi v1.5.4 github.com/golang/protobuf v1.5.2 github.com/google/uuid v1.3.0 diff --git a/go.sum b/go.sum index 61e4833..3662ab2 100644 --- a/go.sum +++ b/go.sum @@ -38,6 +38,12 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.fsdpf.net/go/db v0.0.0-20230412075825-59b3faa171bc h1:d3ZqjNGbsgVknkbvATV96rv1bW8mwqbmnV5bfGTVRVU= git.fsdpf.net/go/db v0.0.0-20230412075825-59b3faa171bc/go.mod h1:397Sdx1cJS0OlHtTX1bVl//9k3Xn0Klnc6jC4MAkb6w= +git.fsdpf.net/go/db v0.0.0-20230621020351-bf3032103e5f h1:h8Id5NLdX4zaAVd+Qe1iO5M3O4LTtTkHQCHBKAjt1Tc= +git.fsdpf.net/go/db v0.0.0-20230621020351-bf3032103e5f/go.mod h1:397Sdx1cJS0OlHtTX1bVl//9k3Xn0Klnc6jC4MAkb6w= +git.fsdpf.net/go/db v0.0.0-20230621030725-28d9dcbd4dcb h1:3igohcxzv3K+uir9IGBK1AGV8OC7FvfW6fyFD98QqcM= +git.fsdpf.net/go/db v0.0.0-20230621030725-28d9dcbd4dcb/go.mod h1:397Sdx1cJS0OlHtTX1bVl//9k3Xn0Klnc6jC4MAkb6w= +git.fsdpf.net/go/db v0.0.0-20230621051209-5740d112407f h1:H+/H6j+hyFMgSy+tUNmymRy7/PWQRjjp8qY/DrhwrsY= +git.fsdpf.net/go/db v0.0.0-20230621051209-5740d112407f/go.mod h1:397Sdx1cJS0OlHtTX1bVl//9k3Xn0Klnc6jC4MAkb6w= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=