Documentation ¶
Index ¶
- Constants
- type Attribute
- type DataModel
- func (d DataModel) AddAttribute(a Attribute) error
- func (d DataModel) AddAttributes(list []Attribute) error
- func (d DataModel) Exist(query interface{}) bool
- func (d DataModel) FindOne(query, selector interface{}) (dm DataModel, err error)
- func (d DataModel) FindPageFilter(page, limit int, query, selector interface{}, fields ...string) ([]DataModel, error)
- func (d DataModel) FindSimpleOne(query, selector interface{}) (dm DataModel, err error)
- func (d DataModel) Insert() (id int64, err error)
- func (d DataModel) Remove() error
- func (d DataModel) RemoveAttribute(a Attribute) error
- func (d DataModel) RemoveAttributes(list []Attribute) error
- func (d DataModel) ToJson() string
- func (d DataModel) TotalCount(query, selector interface{}) (int, error)
- func (d DataModel) Update() error
- func (d DataModel) UpdateAppRelation() error
Constants ¶
View Source
const ( DataModelPermissionALL = "Model_ALL" DataModelPermissionCreate = "Model_CREATE" DataModelPermissionSelect = "Model_SELECT" DataModelPermissionEdit = "Model_EDIT" DataModelPermissionDelete = "Model_DELETE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct { Type string `json:"type,omitempty" bson:"type,omitempty"` //数据类型 Name string `json:"name,omitempty" bson:"name,omitempty"` //attribute是数组时,数组内元素对象 ModelName string `json:"model_name,omitempty" bson:"model_name,omitempty"` ModelId int64 `json:"model_id,omitempty" bson:"model_id,omitempty"` Default string `json:"default,omitempty" bson:"default,omitempty"` //默认值 Required bool `json:"required" bson:"required,omitempty"` //是否必填 RequestPara 使用 Comments string `json:"comments,omitempty" bson:"comments,omitempty"` //属性说明 UpdateTime int64 `json:"update_time,omitempty" bson:"update_time,omitempty"` }
type DataModel ¶
type DataModel struct { Id int64 `json:"id,omitempty" bson:"_id,omitempty"` Name string `json:"name,omitempty" bson:"name,omitempty"` //过滤中文名 Alias string `json:"alias,omitempty" bson:"alias,omitempty"` Desc string `json:"desc,omitempty" bson:"desc,omitempty"` //模型说明 CreateTime int64 `json:"create_time,omitempty" bson:"create_time,omitempty"` Attributes []Attribute `json:"attributes,omitempty" bson:"attributes,omitempty"` //模型的属性表 Apps []model_app.Application `json:"apps,omitempty" bson:"apps,omitempty"` //不存入数据库 Owner model_user.User `json:"owner,omitempty" bson:"owner,omitempty"` //模型负责人(初始为创建人) ParentId int64 `json:"parent_id,omitempty" bson:"parent_id,omitempty"` Parent interface{} `json:"parent,omitempty" bson:"parent,omitempty"` }
TODO 历史版本记录
func (DataModel) AddAttribute ¶
func (DataModel) AddAttributes ¶
func (DataModel) FindPageFilter ¶
func (DataModel) FindSimpleOne ¶
func (DataModel) RemoveAttribute ¶
func (DataModel) RemoveAttributes ¶
func (DataModel) TotalCount ¶
func (DataModel) UpdateAppRelation ¶
Click to show internal directories.
Click to hide internal directories.