| 10 | ) |
| 11 | |
| 12 | type Api struct { |
| 13 | ID int `json:"id" gorm:"primaryKey;column:id;comment:主键ID"` |
| 14 | Name string `json:"name" gorm:"column:name;type:varchar(50);not null;comment:API名称"` |
| 15 | Path string `json:"path" gorm:"column:path;type:varchar(255);not null;comment:API路径"` |
| 16 | Method int `json:"method" gorm:"column:method;type:tinyint(1);not null;comment:HTTP请求方法(1:GET,2:POST,3:PUT,4:DELETE)"` |
| 17 | Description string `json:"description" gorm:"column:description;type:varchar(500);comment:API描述"` |
| 18 | Version string `json:"version" gorm:"column:version;type:varchar(20);default:v1;comment:API版本"` |
| 19 | Category int `json:"category" gorm:"column:category;type:tinyint(1);not null;comment:API分类(1:系统,2:业务)"` |
| 20 | IsPublic int `json:"is_public" gorm:"column:is_public;type:tinyint(1);default:0;comment:是否公开(0:否,1:是)"` |
| 21 | CreateTime int64 `json:"create_time" gorm:"column:create_time;autoCreateTime;comment:创建时间"` |
| 22 | UpdateTime int64 `json:"update_time" gorm:"column:update_time;autoUpdateTime;comment:更新时间"` |
| 23 | IsDeleted int `json:"is_deleted" gorm:"column:is_deleted;type:tinyint(1);default:0;comment:是否删除(0:否,1:是)"` |
| 24 | } |
| 25 | |
| 26 | type ApiDAO interface { |
| 27 | CreateApi(ctx context.Context, api *Api) error |
nothing calls this directly
no outgoing calls
no test coverage detected