package permission import ( "git.sxidc.com/go-framework/baize/framework/core/domain" "git.sxidc.com/go-framework/baize/framework/core/domain/entity" ) const ( FieldName = "Name" FieldDescription = "Description" FieldResource = "Resource" FieldAction = "Action" ) var ( ColumnName = domain.ColumnName(FieldName) ColumnDescription = domain.ColumnName(FieldDescription) ColumnResource = domain.ColumnName(FieldResource) ColumnAction = domain.ColumnName(FieldAction) ) var fieldMap = map[string]string{ FieldName: "权限名称", FieldDescription: "权限描述", FieldResource: "resource", FieldAction: "action", } type Entity struct { entity.Base Name string `sqlmapping:"column:name" sqlresult:"column:name" check:"required,lte=256,when=create/update"` Description string `sqlmapping:"column:description;updateClear" sqlresult:"column:description"` Resource string `sqlmapping:"column:resource" sqlresult:"column:resource" check:"required,when=create/update"` Action string `sqlmapping:"column:action" sqlresult:"column:action" check:"required,lte=128,when=create/update"` PermissionGroupIDs []string `sqlmapping:"-" sqlresult:"-"` RoleIDs []string `sqlmapping:"-" sqlresult:"-"` entity.UserIDFields entity.TimeFields } func (e *Entity) DomainCNName() string { return "权限" } func (e *Entity) DomainCamelName() string { return "Permission" } func (e *Entity) GetFieldMap() map[string]string { return fieldMap }