package model import ( "dy-admin/internal/pcmserver/common" ) type Api struct { common.Model Path string `json:"path" form:"path" gorm:"size:128;comment:地址"` Action string `json:"action" form:"action" gorm:"size:16;comment:请求类型"` Type string `json:"type" form:"type" gorm:"size:16;comment:接口类型[SYS BUS]"` Description string `json:"description" form:"description" gorm:"size:128;comment:api中文描述"` ApiGroup string `json:"apiGroup" form:"apiGroup" gorm:"size:32;comment:api组"` common.ModelTime } func (Api) TableName() string { return "sys_apis" } func (Api) AllowOrderField() map[string]struct{} { orderMap := make(map[string]struct{}, 6) orderMap["id"] = struct{}{} orderMap["path"] = struct{}{} orderMap["api_group"] = struct{}{} orderMap["description"] = struct{}{} orderMap["method"] = struct{}{} orderMap["type"] = struct{}{} return orderMap } func DefaultAPIs() []Api { return []Api{ {Path: "/sys/v1/menu/role/tree", Action: "GET"}, {Path: "/sys/v1/user/setSelfInfo", Action: "PUT"}, {Path: "/sys/v1/user/changePassword", Action: "PUT"}, {Path: "/sys/v1/operation", Action: "POST"}, {Path: "/sys/v1/user/getInfo", Action: "GET"}, {Path: "/sys/v1/dept/tree", Action: "GET"}, {Path: "/sys/v1/dept/one", Action: "GET"}, } }