DeleteApi 删除指定ID的API
(ctx context.Context, id int)
| 61 | |
| 62 | // DeleteApi 删除指定ID的API |
| 63 | func (a *apiService) DeleteApi(ctx context.Context, id int) error { |
| 64 | if id <= 0 { |
| 65 | a.l.Warn("API ID无效", zap.Int("ID", id)) |
| 66 | return errors.New("api id无效") |
| 67 | } |
| 68 | |
| 69 | return a.repo.DeleteApi(ctx, id) |
| 70 | } |
| 71 | |
| 72 | // ListApis 分页获取API列表 |
| 73 | func (a *apiService) ListApis(ctx context.Context, page, pageSize int) ([]*domain.Api, int, error) { |