123456789101112131415161718192021222324252627282930313233 |
- package eta
- import (
- "eta/eta_mini_ht_api/models"
- )
- const (
- Columns = "chart_permission_id,permission_name,parent_id"
- SyncColumns = "chart_permission_id ,permission_name ,parent_id ,sort"
- )
- // ChartPermission represents the structure of the chart_permission table.
- type ChartPermission struct {
- ChartPermissionID int `gorm:"primaryKey;autoIncrement;column:chart_permission_id;comment:主键"`
- PermissionName string `gorm:"size:50;default:'';column:permission_name;comment:权限名"`
- ParentID int `gorm:"size:11;default:0;column:parent_id;comment:父级权限id"`
- ClassifyId int `gorm:"classify_id"`
- Sort int `gorm:"default:null"`
- }
- // TableName sets the insert table name for this struct type
- func (c *ChartPermission) TableName() string {
- return "chart_permission"
- }
- func GetSyncPermissionList() (chartPermissionList []ChartPermission, err error) {
- db := models.ETA()
- err = db.Select(SyncColumns).Find(&chartPermissionList).Error
- if err == nil && chartPermissionList == nil {
- chartPermissionList = []ChartPermission{}
- }
- return
- }
|