model

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NamingStrategy schema.NamingStrategy

Functions

func AddCodeFiles

func AddCodeFiles(codeFiles []*CodeFile) error

func AutoMigrate

func AutoMigrate()

AutoMigrate 自动生成表

func CamelName

func CamelName(name string) string

func CamelName2

func CamelName2(name string) string

func CellAttrsToPB

func CellAttrsToPB(in *CellAttrs) *apipb.CellAttrs

func CellAttrsesToPB

func CellAttrsesToPB(in []*CellAttrs) []*apipb.CellAttrs

func CellConnectingToPB

func CellConnectingToPB(in *CellConnecting) *apipb.CellConnecting

func CellConnectingsToPB

func CellConnectingsToPB(in []*CellConnecting) []*apipb.CellConnecting

func CellMarkupToPB

func CellMarkupToPB(in *CellMarkup) *apipb.CellMarkup

func CellMarkupsToPB

func CellMarkupsToPB(in []*CellMarkup) []*apipb.CellMarkup

func CellToPB

func CellToPB(in *Cell) *apipb.CellInfo

func CellsToPB

func CellsToPB(in []*Cell) []*apipb.CellInfo

func CodeFileToPB

func CodeFileToPB(in *CodeFile) *apipb.CodeFileInfo

func CodeFilesToPB

func CodeFilesToPB(in []*CodeFile) []*apipb.CodeFileInfo

func Copy

func Copy(pageName string, id string) error

func CopyCell

func CopyCell(id string) error

func CopyFileTemplate

func CopyFileTemplate(id string) (string, error)

func CopyForm

func CopyForm(id string) error

func CopyFunctionalTemplate

func CopyFunctionalTemplate(id string) (string, error)

func CopyMetadata

func CopyMetadata(id string) error

func CopyPage

func CopyPage(id string) error

func CopyService

func CopyService(id string) error

func CopySystemObject

func CopySystemObject(id string) (string, error)

func CopyTemplate

func CopyTemplate(id string) error

func Create

func Create(pageName string, m map[string]interface{}) error

func CreateCell

func CreateCell(m *Cell) error

func CreateFileTemplate

func CreateFileTemplate(m *FileTemplate) (string, error)

func CreateForm

func CreateForm(m *Form) error

func CreateFunctionalTemplate

func CreateFunctionalTemplate(m *FunctionalTemplate) (string, error)

func CreateMetadata

func CreateMetadata(md *Metadata) error

func CreatePage

func CreatePage(m *Page) error

func CreateService

func CreateService(m *Service) error

func CreateSystemObject

func CreateSystemObject(m *SystemObject) (string, error)

func CreateTemplate

func CreateTemplate(tpl *Template) error

func Delete

func Delete(pageName string, id string) (err error)

func DeleteAttrs

func DeleteAttrs(tx *gorm.DB, old, m *Cell) error

func DeleteButtons

func DeleteButtons(tx *gorm.DB, old, m *Page) error

func DeleteCell

func DeleteCell(id string) (err error)

func DeleteCodeFiles

func DeleteCodeFiles(tx *gorm.DB, old, m *Service) error

func DeleteConnectings

func DeleteConnectings(tx *gorm.DB, old, m *Cell) error

func DeleteFields

func DeleteFields(tx *gorm.DB, old, m *Page) error

func DeleteFileTemplate

func DeleteFileTemplate(id string) (err error)

func DeleteForm

func DeleteForm(id string) (err error)

func DeleteFunctionalTemplate

func DeleteFunctionalTemplate(id string) (err error)

func DeleteMarkup

func DeleteMarkup(tx *gorm.DB, old, m *Cell) error

func DeleteMetadata

func DeleteMetadata(id string) (err error)

func DeletePage

func DeletePage(id string) (err error)

func DeleteService

func DeleteService(id string) (err error)

func DeleteServiceFunctionals

func DeleteServiceFunctionals(tx *gorm.DB, old, m *Service) error

func DeleteSystemObject

func DeleteSystemObject(id string) (err error)

func DeleteTemplate

func DeleteTemplate(id string) (err error)

func Enable

func Enable(pageName string, id string, enable bool) error

func EnableCell

func EnableCell(id string, enable bool) error

func EnableFunctionalTemplate

func EnableFunctionalTemplate(id string, enable bool) error

func EnablePage

func EnablePage(id string, enable bool) error

func EnableSystemObject

func EnableSystemObject(id string, enable bool) error

func FileTemplateToPB

func FileTemplateToPB(in *FileTemplate) *apipb.FileTemplateInfo

func FileTemplatesToPB

func FileTemplatesToPB(in []*FileTemplate) []*apipb.FileTemplateInfo

func FormToPB

func FormToPB(in Form) *apipb.FormInfo

func FormVersionToPB

func FormVersionToPB(version *FormVersion) *apipb.FormVersion

func FormsToPB

func FormsToPB(in []Form) []*apipb.FormInfo

func FunctionalTemplatesToPB

func FunctionalTemplatesToPB(in []*FunctionalTemplate) []*apipb.FunctionalTemplateInfo

func GetAll

func GetAll(pageName string) (list []map[string]interface{}, err error)

func GetChildrenList

func GetChildrenList(location map[string]interface{}, treeMap map[string][]map[string]interface{}) (err error)

func GetDetailById

func GetDetailById(pageName string, id string) (data map[string]interface{}, err error)

func GetDetailByName

func GetDetailByName(pageName, name string) (map[string]interface{}, error)

func GetTree

func GetTree(pageName string) (list []map[string]interface{}, total int64, err error)

func GetTreeMap

func GetTreeMap(page *Page) (treeMap map[string][]map[string]interface{}, err error)

func Init

func Init(connStr string, debug bool)

Init Init

func InitDB

func InitDB(client db.DBClientInterface, debug bool)

func InitSqlite

func InitSqlite(database string, debug bool)

func JsonToStringArray

func JsonToStringArray(str string) []string

func LcFirst

func LcFirst(s string) string

func LowerSnakeCase

func LowerSnakeCase(s string) string

func MetadataFieldsToPB

func MetadataFieldsToPB(in []*MetadataField) []*apipb.MetadataField

func MetadataToPB

func MetadataToPB(in *Metadata) *apipb.MetadataInfo

func MetadatasToPB

func MetadatasToPB(in []*Metadata) []*apipb.MetadataInfo

func ObjectToJsonString

func ObjectToJsonString(obj interface{}) string

func PBToFormVersions

func PBToFormVersions(versions []*FormVersion) []*apipb.FormVersion

func PBToPageButtons

func PBToPageButtons(btns []*PageButton) []*apipb.PageButton

func PageFieldsToPB

func PageFieldsToPB(in []*PageField) []*apipb.PageField

func PageToPB

func PageToPB(in *Page) *apipb.PageInfo

func PageToolBarToPB

func PageToolBarToPB(in *PageToolBar) *apipb.PageToolBar

func PagesToPB

func PagesToPB(in []*Page) []*apipb.PageInfo

func PublishForm

func PublishForm(req *FormVersion) error

func Query

func Query(req *QueryRequest, resp *QueryResponse)

func QueryCell

func QueryCell(req *apipb.QueryCellRequest, resp *apipb.QueryCellResponse, preload bool)

func QueryFileTemplate

func QueryFileTemplate(req *apipb.QueryFileTemplateRequest, resp *apipb.QueryFileTemplateResponse, preload bool)

func QueryForm

func QueryForm(req *apipb.QueryFormRequest, resp *apipb.QueryFormResponse, preload bool)

func QueryMetadata

func QueryMetadata(req *apipb.QueryMetadataRequest, resp *apipb.QueryMetadataResponse, preload bool)

func QueryPage

func QueryPage(req *apipb.QueryPageRequest, resp *apipb.QueryPageResponse, preload, sorted bool)

func QueryService

func QueryService(req *apipb.QueryServiceRequest, resp *apipb.QueryServiceResponse, preload bool)

func QuerySystemObject

func QuerySystemObject(req *apipb.QuerySystemObjectRequest, resp *apipb.QuerySystemObjectResponse, preload bool)

func QueryTemplate

func QueryTemplate(req *apipb.QueryTemplateRequest, resp *apipb.QueryTemplateResponse)

func RemoveLastChar

func RemoveLastChar(s string) string

func ServiceFunctionalToPB

func ServiceFunctionalToPB(in *ServiceFunctional) *apipb.ServiceFunctionalInfo

func ServiceFunctionalsToPB

func ServiceFunctionalsToPB(in []*ServiceFunctional) []*apipb.ServiceFunctionalInfo

func ServiceToPB

func ServiceToPB(in *Service) *apipb.ServiceInfo

func ServicesToPB

func ServicesToPB(in []*Service) []*apipb.ServiceInfo

func SortButtons

func SortButtons(buttons []*PageButton)

func SortFields

func SortFields(fields []*PageField)

func SwitchFormVersion

func SwitchFormVersion(versionID string) error

func SystemObjectToPB

func SystemObjectToPB(in *SystemObject) *apipb.SystemObjectInfo

func SystemObjectsToPB

func SystemObjectsToPB(in []*SystemObject) []*apipb.SystemObjectInfo

func TemplateToPB

func TemplateToPB(in *Template) *apipb.TemplateInfo

func TemplatesToPB

func TemplatesToPB(in []*Template) []*apipb.TemplateInfo

func Update

func Update(pageName string, m map[string]interface{}) error

func UpdateCell

func UpdateCell(m *Cell) error

func UpdateFileTemplate

func UpdateFileTemplate(m *FileTemplate) error

func UpdateForm

func UpdateForm(f *Form) error

func UpdateFormAll

func UpdateFormAll(f *Form) error

func UpdateFormSchema

func UpdateFormSchema(f *Form) error

func UpdateFunctionalTemplate

func UpdateFunctionalTemplate(m *FunctionalTemplate) error

func UpdateMetadata

func UpdateMetadata(md *Metadata) error

func UpdatePage

func UpdatePage(m *Page) error

func UpdateService

func UpdateService(m *Service) error

func UpdateSystemObject

func UpdateSystemObject(m *SystemObject) error

func UpdateSystemObjectAll

func UpdateSystemObjectAll(m *SystemObject) error

func UpdateTemplate

func UpdateTemplate(tpl *Template) error

Types

type Cell

type Cell struct {
	commonmodel.Model
	TenantID          string `gorm:"index;size:36"`
	ProjectID         string `gorm:"index;size:36"`
	Name              string `json:"name" gorm:"size:0;index" `
	System            string `json:"system" gorm:"size:100;index;comment:例如BPM、IoT、HR" `
	Group             string `json:"group" gorm:"size:100;index;comment:例如BPM中分组,开始,结束,任务,事件等" `
	Shape             string `json:"shape" gorm:"size:100;index;comment:继承自X6的基础形状,例如Circle、Rect等" `
	IdPrefix          string `json:"idPrefix" gorm:"size:100" `
	PropertyForm      string `json:"propertyForm" gorm:"size:36" `
	View              string `json:"view" gorm:"size:500;comment:渲染节点/边的视图" `
	DefaultLabel      string `json:"defaultLabel" gorm:"size:100" `
	Icon              string `json:"icon" gorm:"comment:可以是url,也可以是path data,也可以是默认的icon里面获取" `
	IconSource        int32  `json:"iconSource" gorm:"comment:1-URL 2-PathData 3-IconComponent" `
	IsEdge            bool   `json:"isEdge" gorm:"index" `
	Common            bool   `json:"common" gorm:"index" `
	Resizing          bool   `json:"resizing" gorm:"index;comment:定义组件可以调整大小" `
	MustTarget        bool   `json:"mustTarget" gorm:"index;comment:必须是连线的结束" `
	MustSource        bool   `json:"mustSource" gorm:"index;comment:必须是连线的开始" `
	Width             int32  `json:"width" gorm:"" `
	Height            int32  `json:"height" gorm:"" `
	Width2            int32  `json:"width2" gorm:"" `
	Height2           int32  `json:"height2" gorm:"" `
	Parent            bool   `gorm:"index"`
	Index             int32
	DefaultEdge       bool          `gorm:"comment:例如默认Edge"`
	Other             string        `gorm:"comment:其他属性,json格式"`
	DefaultLabelAttrs string        `gorm:"comment:默认Label其他属性,json格式"`
	Ports             string        `gorm:"comment:链接桩属性,json格式"`
	FormDefaultValue  string        `gorm:"comment:表单默认值,json格式"`
	Attrs             []*CellAttrs  `json:"attrs" gorm:""`
	Markup            []*CellMarkup `json:"markup" gorm:""`
	Connectings       []*CellConnecting
	IsMust            bool `json:"isMust" gorm:"index;comment:系统必须要有的数据"`
}

func GetAllCells

func GetAllCells(req *apipb.GetAllCellRequest) (list []*Cell, err error)

func GetCellByID

func GetCellByID(id string) (*Cell, error)

func PBToCell

func PBToCell(in *apipb.CellInfo) *Cell

func PBToCells

func PBToCells(in []*apipb.CellInfo) []*Cell

func (*Cell) Sort

func (c *Cell) Sort()

type CellAttrs

type CellAttrs struct {
	commonmodel.Model
	Stroke             string `json:"stroke" gorm:"size:50"`
	SelectedStroke     string `json:"selectedStroke" gorm:"size:50"`
	FontSize           int32  `json:"fontSize" gorm:"" `
	Other              string `json:"other" gorm:"comment:json格式"`
	TextAnchor         string `json:"textAnchor" gorm:"size:10" `
	Name               string `json:"name" gorm:"size:100;index" `
	Fill               string `json:"fill" gorm:"size:50" `
	SelectedFill       string `json:"selectedFill" gorm:"size:50" `
	Ref                string `json:"ref" gorm:"size:100" `
	Magnet             bool   `json:"magnet" gorm:"" `
	TextVerticalAnchor string `json:"textVerticalAnchor" gorm:"size:10" `
	CellID             string `json:"cellID" gorm:"size:36;index" `
	IsDefaultLabel     bool
	LinkHref           string `gorm:"size:36"`
}

func PBToCellAttrs

func PBToCellAttrs(in *apipb.CellAttrs) *CellAttrs

func PBToCellAttrses

func PBToCellAttrses(in []*apipb.CellAttrs) []*CellAttrs

type CellConnecting

type CellConnecting struct {
	commonmodel.Model
	CellID      string `json:"cellID" gorm:"size:36;index" `
	AnotherCell string `json:"anotherCell" gorm:"size:36;null" `
	Edge        string `json:"edge" gorm:"size:36;null" `
	Direct      int32  `gorm:"comment:连线方向,1-开始 2-结束 3-任意"`
}

func PBToCellConnecting

func PBToCellConnecting(in *apipb.CellConnecting) *CellConnecting

func PBToCellConnectings

func PBToCellConnectings(in []*apipb.CellConnecting) []*CellConnecting

type CellMarkup

type CellMarkup struct {
	commonmodel.Model
	TextContent    string `json:"textContent" gorm:"size:200" `
	CellID         string `json:"cellID" gorm:"size:36;index" `
	Other          string `json:"other" gorm:"comment:json格式" `
	Children       string `json:"children" gorm:"size:500" `
	ClassName      string `json:"className" gorm:"size:100" `
	Selector       string `json:"selector" gorm:"size:100" `
	GroupSelector  string `json:"groupSelector" gorm:"size:100" `
	TagName        string `json:"tagName" gorm:"size:100" `
	Attrs          string `json:"attrs" gorm:"size:200" `
	Style          string `json:"style" `
	Index          int32
	IsDefaultLabel bool
}

func PBToCellMarkup

func PBToCellMarkup(in *apipb.CellMarkup) *CellMarkup

func PBToCellMarkups

func PBToCellMarkups(in []*apipb.CellMarkup) []*CellMarkup

type CodeFile

type CodeFile struct {
	model.Model
	ServiceID       string `json:"serviceID" gorm:"index" copier:"-"`
	Name            string `json:"name" gorm:"size:100;comment:文件名称"`
	Dir             string `json:"dir" gorm:"size:100;comment:文件存放的目录" `
	Package         string `json:"package" gorm:"size:50;comment:包名"`
	MetadataID      string `json:"metadataID" gorm:"size:36;comment:元数据ID"`
	Start           string `json:"start" gorm:"size:36;comment:开头模板ID"`
	End             string `json:"end" gorm:"size:36;comment:结尾模板ID"`
	Body            string `json:"body" gorm:"size:500;comment:一组模板ID"`
	Params          string `json:"params" gorm:"size:500;comment:自定义参数"`
	Code            string `json:"code" gorm:"-"`
	TemplateContent string `json:"templateContent" gorm:"-"`
	Enable          bool   `json:"enable"`
}

func PBToCodeFile

func PBToCodeFile(in *apipb.CodeFileInfo) *CodeFile

func PBToCodeFiles

func PBToCodeFiles(in []*apipb.CodeFileInfo) []*CodeFile

type FileTemplate

type FileTemplate struct {
	commonmodel.Model
	//文件模版名称
	Name string `json:"name" gorm:"size:100;index;uniqueindex:FileTemplate_uidx1" `
	//文件存放的目录
	Dir string `json:"dir" gorm:"size:100" `
	//包名
	Package string `json:"package" gorm:"size:100" `
	//开头模板ID
	Start string `json:"start" gorm:"size:36"`
	//结尾模板ID
	End string `json:"end" gorm:"size:36"`
	//一组模板ID
	Body string `json:"body" gorm:"size:500"`
	//自定义参数
	Params   string `json:"params" gorm:"size:500" `
	Language string `json:"language" gorm:"size:50;index;uniqueindex:FileTemplate_uidx1"`
	Group    string `json:"group" gorm:"size:50;index;uniqueindex:FileTemplate_uidx1"`
	//文件名称后缀
	FileNameSuffix string `json:"fileNameSuffix" gorm:"size:100"`
}

func GetAllFileTemplates

func GetAllFileTemplates() (list []*FileTemplate, err error)

func GetFileTemplateByID

func GetFileTemplateByID(id string) (*FileTemplate, error)

func GetFileTemplateByIDs

func GetFileTemplateByIDs(ids []string) ([]*FileTemplate, error)

func PBToFileTemplate

func PBToFileTemplate(in *apipb.FileTemplateInfo) *FileTemplate

func PBToFileTemplates

func PBToFileTemplates(in []*apipb.FileTemplateInfo) []*FileTemplate

type Form

type Form struct {
	model.TenantModel
	ProjectID string         `gorm:"index;size:36"`
	Name      string         `json:"name" gorm:"index;size:200"`
	PageName  string         `json:"pageName" gorm:"index;size:200"`
	Group     string         `json:"group" gorm:"index;size:200"`
	Schema    string         `json:"schema"`
	Type      string         `json:"type" gorm:"index;size:100;comment:例如Cell、CURD、AIoT、Page、BPM"`
	Public    bool           `gorm:"comment:是否是公共表单"`
	Subform   bool           `gorm:"index;子表单"`
	Versions  []*FormVersion `json:"versions" copier:"-"`
	IsMust    bool           `json:"isMust" gorm:"index;comment:系统必须要有的数据"`
}

func GetAllForms

func GetAllForms(req *apipb.GetAllFormRequest) (fs []Form, err error)

func GetFormById

func GetFormById(id string, containerVersions bool) (f Form, err error)

func PBToForm

func PBToForm(in *apipb.FormInfo) *Form

type FormVersion

type FormVersion struct {
	model.Model
	Version     string `json:"version" gorm:"size:50;index"`
	FormID      string `json:"formID" gorm:"index"`
	Schema      string `json:"schema"`
	Description string `json:"description" gorm:"size:200"`
}

func FormVersionsToPB

func FormVersionsToPB(versions []*apipb.FormVersion) []*FormVersion

func GetFormVersionById

func GetFormVersionById(id string) (version FormVersion, err error)

func PBToFormVersion

func PBToFormVersion(in *apipb.FormVersion) *FormVersion

type FunctionalTemplate

type FunctionalTemplate struct {
	commonmodel.Model
	//描述
	Description string `json:"description" gorm:"size:500" `
	//自定义参数
	Params string `json:"params" gorm:"size:500" `
	//语音
	Language string `json:"language" gorm:"size:50;index" `
	//分组
	Group string `json:"group" gorm:"size:50;index" `
	//名称
	Name string `json:"name" gorm:"size:100;index" `
	//文件模版ID
	FileTemplateIDs string `json:"fileTemplateIDs" gorm:"size:500" `
}

func GetAllFunctionalTemplates

func GetAllFunctionalTemplates() (list []*FunctionalTemplate, err error)

func GetFunctionalTemplateByID

func GetFunctionalTemplateByID(id string) (*FunctionalTemplate, error)

func GetFunctionalTemplateByIDs

func GetFunctionalTemplateByIDs(ids []string) ([]*FunctionalTemplate, error)

func PBToFunctionalTemplates

func PBToFunctionalTemplates(in []*apipb.FunctionalTemplateInfo) []*FunctionalTemplate

type Metadata

type Metadata struct {
	model.Model
	TenantID       string           `gorm:"size:36;index"`
	ProjectID      string           `gorm:"size:36;index"`
	Name           string           `json:"name" gorm:"size:100;index"`
	DisplayName    string           `json:"displayName" gorm:"size:100;comment:显示名字"`
	Level          int32            `json:"level"`
	ParentID       string           `json:"parentID"`
	Description    string           `json:"description" gorm:"size:200;"`
	Package        string           `json:"package" gorm:"size:100"`
	MetadataFields []*MetadataField `json:"metadataFields"`
	Children       []*Metadata      `json:"children" gorm:"-"`
	UniqueFields   string           `json:"-" gorm:"-"`
	Fields         string           `json:"-" gorm:"-"`
	Preloads       []string         `json:"-" gorm:"-"`
	System         string           `json:"system" gorm:"index;size:100"`
	IsMust         bool             `json:"isMust" gorm:"index;comment:系统必须要有的数据"`
}

func GetAllMetadatas

func GetAllMetadatas(req *apipb.QueryMetadataRequest) (mds []*Metadata, err error)

func GetMetadataById

func GetMetadataById(id string) (*Metadata, error)

func GetMetadataByName

func GetMetadataByName(name string) (*Metadata, error)

func GetMetadataTree

func GetMetadataTree(req *apipb.QueryMetadataRequest) (list []*Metadata, total int64, err error)

func PBToMetadata

func PBToMetadata(in *apipb.MetadataInfo) *Metadata

func (*Metadata) FieldSort

func (md *Metadata) FieldSort()

func (*Metadata) Sort

func (md *Metadata) Sort()

type MetadataField

type MetadataField struct {
	model.Model
	MetadataID   string `json:"metadataID"`
	ProjectID    string `gorm:"index;size:36"`
	Name         string `json:"name" gorm:"size:100;"`
	Type         string `json:"type" gorm:"size:50;comment:基础数据类型"`
	Length       int32  `json:"length" gorm:"comment:字段长度"`
	NotNull      bool   `json:"notNull" gorm:"comment:是否可以为空"`
	Comment      string `json:"comment" gorm:"size:200;"`
	IsArray      bool   `json:"isArray" gorm:"comment:数组"`
	RefMetadata  string `json:"refMetadata" gorm:"size:100;comment:引用其他元数据"`
	DisplayName  string `json:"displayName" gorm:"size:100;comment:显示名字"`
	ShowInTable  bool   `json:"showInTable" gorm:"comment:是否在列表中显示"`
	ShowInEdit   bool   `json:"showInEdit" gorm:"comment:是否在编辑中显示"`
	Component    string `json:"component" gorm:"size:100;comment:显示组件类型"`
	Unique       bool   `json:"unique" gorm:"comment:唯一索引"`
	Index        bool   `json:"index" gorm:"comment:索引"`
	DefaultValue string `json:"defaultValue" gorm:"size:100;comment:默认值"`
	ShowInQuery  bool   `json:"showInQuery" gorm:"comment:查询条件"`
	Order        int32  `json:"order" gorm:"comment:显示顺序"`
	Like         bool   `json:"like" gorm:"comment:like查询"`
	Copier       bool   `json:"copier" gorm:"comment:是否不拷贝"`
	DotNotGen    bool
	PBToStruct   string `json:"pbToStruct" gorm:"size:100;"`
	StructToPB   string `json:"structToPB" gorm:"size:100;"`
}

func GetMetadataFieldByMDId

func GetMetadataFieldByMDId(mdID string) ([]*MetadataField, error)

func PBToMetadataFields

func PBToMetadataFields(in []*apipb.MetadataField) []*MetadataField

type Page

type Page struct {
	model.TenantModel
	ProjectID          string       `gorm:"index;size:36"`
	Name               string       `json:"name" gorm:"size:100;uniqueindex:page_uidx1" `
	Enable             bool         `json:"enable" gorm:"comment:是否启用"`
	MetadataID         string       `json:"metadataID" gorm:"" `
	Metadata           *Metadata    `json:"metadata" gorm:"" copier:"-"`
	PageSize           uint32       `json:"pageSize" gorm:"comment:每页数量" `
	Editable           string       `json:"editable" gorm:"size:100" `
	ShowIndex          bool         `json:"showIndex" gorm:"comment:是否显示序号"`
	ShowSelection      bool         `json:"showSelection" gorm:"显示批量操作"`
	ToolBar            *PageToolBar `json:"toolBar" gorm:"" `
	Fields             []*PageField `json:"fields" gorm:"" `
	Path               string       `json:"path" gorm:"size:200;comment:接口前缀,例如/api/core/auth/user"`
	Title              string       `json:"title" gorm:"size:100"`
	Description        string       `json:"description" gorm:"size:500"`
	SearchDefaultValue string       `json:"searchDefaultValue" gorm:"size:500"`
	AddDefaultValue    string       `json:"addDefaultValue"`
	EditFormID         string       `json:"editFormID"`
	SearchFormID       string       `json:"searchFormID"`
	AddFormID          string       `json:"addFormID"`
	ViewFormID         string       `json:"viewFormID"`
	Type               int32        `json:"type" gorm:"index;comment:1-表格 2-树形"`
	SubmitBefore       string       `json:"submitBefore" gorm:"comment:提交前执行"`
	SubmitAfter        string       `json:"submitAfter" gorm:"comment:提交成功后执行"`
	LoadDetailBefore   string       `json:"loadDetailBefore" gorm:"comment:加载明细前执行"`
	LoadDetailAfter    string       `json:"loadDetailAfter" gorm:"comment:加载明细成功后执行"`
	QueryBefore        string       `json:"queryBefore" gorm:"comment:查询前执行"`
	QueryAfter         string       `json:"queryAfter" gorm:"comment:查询成功后执行"`
	LabelField         string       `json:"labelField" gorm:"size:100"`
	ValueField         string       `json:"valueField" gorm:"size:100"`

	ScrollX int32 `json:"scrollX" gorm:"comment:横向滚动条"`

	ListKeyField         string `json:"listKeyField" gorm:"size:100"`
	ListAvatarField      string `json:"listAvatarField" gorm:"size:100"`
	ListTitleField       string `json:"listTitleField" gorm:"size:100"`
	ListDescriptionField string `json:"listDescriptionField" gorm:"size:100"`
	ListContentField     string `json:"listContentField" gorm:"size:100"`
	ListLoadType         int32  `json:"listLoadType"`

	CardAvatarField      string        `json:"cardAvatarField" gorm:"size:100"`
	CardTitleField       string        `json:"cardTitleField" gorm:"size:100"`
	CardDescriptionField string        `json:"cardDescriptionField" gorm:"size:100"`
	CardContentField     string        `json:"cardContentField" gorm:"size:100"`
	CardLoadType         int32         `json:"cardLoadType"`
	CardImageField       string        `json:"cardImageField" gorm:"size:100"`
	Buttons              []*PageButton `json:"buttons"`

	ProListGhost           bool   `json:"proListGhost"`
	ProListCardActionProps string `json:"proListCardActionProps" gorm:"size:50"`

	ProListShowTitle      bool   `json:"proListShowTitle"`
	ProListTitleDataIndex string `json:"proListTitleDataIndex" gorm:"size:100"`
	ProListTitleValueType string `json:"proListTitleValueType" gorm:"size:50"`
	ProListTitleRender    string `json:"proListTitleRender" gorm:"size:500"`

	ProListShowSubTitle      bool   `json:"proListShowSubTitle"`
	ProListSubTitleDataIndex string `json:"proListSubTitleDataIndex" gorm:"size:100"`
	ProListSubTitleValueType string `json:"proListSubTitleValueType" gorm:"size:50"`
	ProListSubTitleRender    string `json:"proListSubTitleRender" gorm:"size:500"`

	ProListShowMetaType  bool   `json:"proListShowMetaType"`
	ProListTypeDataIndex string `json:"proListTypeDataIndex" gorm:"size:100"`
	ProListTypeValueType string `json:"proListTypeValueType" gorm:"size:50"`
	ProListTypeRender    string `json:"proListTypeRender" gorm:"size:500"`

	ProListShowAvatar      bool   `json:"proListShowAvatar"`
	ProListAvatarDataIndex string `json:"proListAvatarDataIndex" gorm:"size:100"`
	ProListAvatarValueType string `json:"proListAvatarValueType" gorm:"size:50"`
	ProListAvatarRender    string `json:"proListAvatarRender" gorm:"size:500"`

	ProListShowContent      bool   `json:"proListShowContent"`
	ProListContentDataIndex string `json:"proListContentDataIndex" gorm:"size:100"`
	ProListContentValueType string `json:"proListContentValueType" gorm:"size:50"`
	ProListContentRender    string `json:"proListContentRender" gorm:"size:500"`

	ProListShowMetaExtra  bool   `json:"proListShowMetaExtra"`
	ProListExtraDataIndex string `json:"proListExtraDataIndex" gorm:"size:100"`
	ProListExtraValueType string `json:"proListExtraValueType" gorm:"size:50"`
	ProListExtraRender    string `json:"proListExtraRender" gorm:"size:500"`

	ProListShowActions    string `json:"proListShowActions" gorm:"size:20;comment:hover | always"`
	ProListShowType       int32  `json:"proListShowType" gorm:"comment:1-List 2-Card"`
	ProListShowExtra      string `json:"proListShowExtra" gorm:"size:20;comment:hover | always"`
	ProListItemClick      string `json:"proListItemClick" gorm:"size:500"`
	ProListItemMouseEnter string `json:"proListItemMouseEnter" gorm:"size:500"`

	ListGridTypeGutter int32  `json:"listGridTypeGutter"`
	ListGridTypeColumn int32  `json:"listGridTypeColumn"`
	ListItemLayout     string `json:"listItemLayout" gorm:"size:20"`
	ListExpandable     bool   `json:"listExpandable"`

	IsMust   bool   `json:"isMust" gorm:"index;comment:系统必须要有的数据"`
	IsChild  bool   `json:"isChild" gorm:"index;comment:子列表,应用于左右分栏"`
	Children string `json:"children" gorm:"size:200;comment:子列表的PageName,多个使用逗号隔开,应用于左右分栏等"`
	Bordered bool   `json:"bordered" gorm:"comment:是否显示边框"`
}

func GetAllPage

func GetAllPage(req *apipb.QueryPageRequest) (list []*Page, err error)

func GetPageByID

func GetPageByID(id string) (*Page, error)

func GetPageByIDs

func GetPageByIDs(ids []string) ([]Page, error)

func GetPageByName

func GetPageByName(name string) (*Page, error)

func PBToPage

func PBToPage(in *apipb.PageInfo) *Page

type PageButton

type PageButton struct {
	ID           string `json:"id" copier:"-"`
	PageID       string `json:"pageID" gorm:"" copier:"-"`
	Key          string `json:"key" gorm:"size:100"`
	Label        string `json:"label" gorm:"size:200"`
	Expanded     bool   `json:"expanded"`
	ShowType     string `json:"showType" gorm:"size:50"`
	Href         string `json:"href" gorm:"size:200"`
	HrefFunc     string `json:"hrefFunc"`
	Script       string `json:"script"`
	HiddenScript string `json:"hiddenScript"`
	Index        int32  `json:"index"`
	Enable       bool   `json:"enable" gorm:"comment:是否启用;index"`
	//按钮权限有两种控制方式
	//先判断角色权限
	//在判断数据权限
	Permission   string `json:"permission" gorm:"size:200;comment:按钮权限"`
	ShowPosition int32  `json:"showPosition" gorm:"default:0;comment:0-显示在列表行 1-在搜索框显示"`
	FormID       string `json:"formID" gorm:"size:36"`
}

func PageButtonsToPB

func PageButtonsToPB(versions []*apipb.PageButton) []*PageButton

func (*PageButton) BeforeCreate

func (u *PageButton) BeforeCreate(tx *gorm.DB) (err error)

type PageField

type PageField struct {
	model.Model
	PageID         string `json:"pageID" gorm:"" copier:"-"`
	Name           string `json:"name" gorm:"size:100;comment:字段名" copier:"-"`
	Title          string `json:"title" gorm:"size:100;comment:显示名称" copier:"-"`
	Copyable       bool   `json:"copyable" gorm:"comment:显示复制按钮" copier:"-"`
	Ellipsis       bool   `json:"ellipsis" gorm:"comment:是否自动缩略" copier:"-"`
	RowKey         bool   `json:"rowKey" gorm:"comment:Row Key" copier:"-"`
	Sort           int32  `json:"sort"`
	EnableSort     bool   `json:"enableSort" gorm:"comment:启用排序" copier:"-"`
	Fixed          string `json:"fixed" gorm:"comment:固定列;size:20" copier:"-"`
	ShowInTable    bool   `json:"showInTable"`
	ValueEnum      string `json:"valueEnum" gorm:"size:500;comment:枚举值转换"`
	Component      string `json:"component" gorm:"size:200;comment:组件"`
	ComponentProps string `json:"componentProps" gorm:"size:500"`
	DataType       string `json:"dataType" gorm:"size:100;comment:数据类型"`
	LabelField     string `json:"labelField" gorm:"size:100"`
	ValueField     string `json:"valueField" gorm:"size:100"`
	Align          string `json:"align" gorm:"size:20"`
	Width          string `json:"width" gorm:"size:20"`
}

func PBToPageFields

func PBToPageFields(in []*apipb.PageField) []*PageField

type PageToolBar

type PageToolBar struct {
	model.Model
	PageID         string `json:"pageID" gorm:"" copier:"-"`
	FullScreen     bool   `json:"fullScreen" gorm:"comment:全屏" copier:"-"`
	Reload         bool   `json:"reload" gorm:"comment:刷新" copier:"-"`
	Setting        bool   `json:"setting" gorm:"" copier:"-"`
	Render         string `json:"render" gorm:"size:500" copier:"-"`
	ShowAdd        bool   `json:"showAdd" gorm:"comment:是否显示新增按钮"`
	AddPermission  string `json:"addPermission" gorm:"size:200;comment:新增按钮权限"`
	AddScript      string `json:"addScript"`
	ShowExport     bool   `json:"showExport" gorm:"comment:是否显示导出按钮"`
	ShowImport     bool   `json:"showImport" gorm:"comment:是否显示导入按钮"`
	RowSelection   bool   `json:"rowSelection" gorm:"comment:是否显示可选框"`
	ShowBatchDel   bool   `json:"showBatchDel" gorm:"comment:是否显示批量删除按钮"`
	BatchDelUri    string `json:"batchDelUri" gorm:"size:100;comment:批量删除API接口地址"`
	ExportUri      string `json:"exportUri" gorm:"size:100;comment:导出API接口地址"`
	ImportUri      string `json:"importUri" gorm:"size:100;comment:导入API接口地址"`
	ImportMulti    bool   `json:"importMulti" gorm:"comment:导入多个文件"`
	ImportMaxCount int32  `json:"importMaxCount" gorm:"comment:上传最大数量"`
	ImportFormID   string `json:"importFormID" gorm:"size:36;comment:导入表单"`
}

func PBToPageToolBar

func PBToPageToolBar(in *apipb.PageToolBar) *PageToolBar

type QueryRequest

type QueryRequest struct {
	model.CommonRequest
	PageName string                 `json:"pageName" form:"pageName" uri:"pageName"`
	Data     map[string]interface{} `json:"data" form:"data" uri:"data"`
}

type QueryResponse

type QueryResponse struct {
	model.CommonResponse
	Data []map[string]interface{} `json:"data"`
}

type Service

type Service struct {
	model.Model
	TenantID           string      `gorm:"size:36;index"`
	ProjectID          string      `gorm:"index;size:36"`
	Name               string      `json:"name" gorm:"size:100;comment:服务名称" `
	DisplayName        string      `json:"displayName" gorm:"size:100;comment:服务显示名称" `
	Package            string      `json:"package" gorm:"size:50"`
	Params             string      `json:"params" gorm:"size:500;comment:自定义参数"`
	CodeFiles          []*CodeFile `json:"codeFiles"`
	ServiceFunctionals []*ServiceFunctional
}

func GetAllService

func GetAllService(req *apipb.QueryServiceRequest) (list []*Service, err error)

func GetServiceByID

func GetServiceByID(id string, all bool) (*Service, error)

func PBToService

func PBToService(in *apipb.ServiceInfo) *Service

func PBToServices

func PBToServices(in []*apipb.ServiceInfo) []*Service

func (*Service) Sort

func (s *Service) Sort()

type ServiceFunctional

type ServiceFunctional struct {
	commonmodel.Model
	//服务ID
	ServiceID string `json:"serviceID" gorm:"size:36;index" `
	//功能模版ID
	FunctionalTemplateID string `json:"functionalTemplateID" gorm:"size:36;index" `
	//元数据ID
	MetadataID string `json:"metadataID" gorm:"size:36;index" `
	//自定义参数
	Params string `json:"params" gorm:"size:500" `
	//生成配置文件
	GenConfig bool `json:"genConfig"`
	Enable    bool `json:"enable"`
}

func PBToServiceFunctional

func PBToServiceFunctional(in *apipb.ServiceFunctionalInfo) *ServiceFunctional

func PBToServiceFunctionals

func PBToServiceFunctionals(in []*apipb.ServiceFunctionalInfo) []*ServiceFunctional

type SystemObject

type SystemObject struct {
	commonmodel.Model
	//是否启用
	Enable bool `json:"enable" gorm:"index" `
	//名称
	Name string `json:"name" gorm:"size:200;index" `
	//显示名称
	DisplayName string `json:"displayName" gorm:"size:100" `
	//编程语言
	Language string `json:"language" gorm:"size:50;index" `
	//类型 1-类 2-结构体 3-方法 4-代码
	Type int32 `json:"type" gorm:"index;comment:1-类 2-结构体 3-方法 4-代码" `
	//代码
	Code string `json:"code" gorm:"size:2000" `
	//备注
	Description string `json:"description" gorm:"size:500" `
}

func GetAllSystemObjects

func GetAllSystemObjects(req *apipb.GetAllSystemObjectRequest) (list []*SystemObject, err error)

func GetSystemObjectByID

func GetSystemObjectByID(id string) (*SystemObject, error)

func GetSystemObjectByIDs

func GetSystemObjectByIDs(ids []string) ([]*SystemObject, error)

func PBToSystemObject

func PBToSystemObject(in *apipb.SystemObjectInfo) *SystemObject

func PBToSystemObjects

func PBToSystemObjects(in []*apipb.SystemObjectInfo) []*SystemObject

type Template

type Template struct {
	model.Model
	TenantID    string `gorm:"size:36;index"`
	Name        string `json:"name" gorm:"size:100;index"`
	Language    string `json:"language" gorm:"size:50;index"`
	Content     string `json:"content"`
	Description string `json:"description" gorm:"size:200;"`
	Group       string `json:"group" gorm:"size:50;index"`
}

func GetAllTemplates

func GetAllTemplates(req *apipb.QueryTemplateRequest) (tpls []*Template, err error)

func GetTemplateById

func GetTemplateById(id string) (tpl Template, err error)

func PBToTemplate

func PBToTemplate(in *apipb.TemplateInfo) *Template

func PBToTemplates

func PBToTemplates(in []*apipb.TemplateInfo) []*Template

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL