12345678910111213141516171819202122232425262728293031323334353637 |
- package model
- type Api struct {
- ServiceId int `json:"serviceId" gorm:"size:4;not null;comment:服务ID"` // 服务ID
- Name string `json:"name" gorm:"size:256;comment:标题"` // 标题
- Path string `json:"path" gorm:"size:256;comment:地址"` // 地址
- Action string `json:"action" gorm:"size:16;comment:请求类型"` // 请求类型
- RoleKey string `json:"roleKey" gorm:"size:128;comment:角色编码" swaggerignore:"true"` // 角色编码
- }
- type BeegoApi struct {
- ServiceId int `json:"serviceId" orm:"size(4)" example:"1"` // 服务ID
- Name string `json:"name" orm:"size(256)" example:"test"` // 标题
- Path string `json:"path" orm:"size(256)" example:"/test"` // 地址
- Action string `json:"action" orm:"size(16)" example:"Get"` // 请求类型
- RoleKey string `json:"roleKey" orm:"size(128)" swaggerignore:"true"` // 角色编码
- }
- // SetCreateBy 设置创建人id
- func (e *Api) SetApi(ServiceId int, Name, Path, Action, RoleKey string) {
- e.ServiceId = ServiceId
- e.Name = Name
- e.Path = Path
- e.Action = Action
- e.RoleKey = RoleKey
- }
- // SetCreateBy 设置创建人id
- func (e *BeegoApi) SetApi(ServiceId int, Name, Path, Action, RoleKey string) {
- e.ServiceId = ServiceId
- e.Name = Name
- e.Path = Path
- e.Action = Action
- e.RoleKey = RoleKey
- }
|