GetApiById 根据ID获取API
(ctx context.Context, id int)
| 41 | |
| 42 | // GetApiById 根据ID获取API |
| 43 | func (a *apiService) GetApiById(ctx context.Context, id int) (*domain.Api, error) { |
| 44 | if id <= 0 { |
| 45 | a.l.Warn("API ID无效", zap.Int("ID", id)) |
| 46 | return nil, errors.New("api id无效") |
| 47 | } |
| 48 | |
| 49 | return a.repo.GetApiById(ctx, id) |
| 50 | } |
| 51 | |
| 52 | // UpdateApi 更新API信息 |
| 53 | func (a *apiService) UpdateApi(ctx context.Context, api *domain.Api) error { |
nothing calls this directly
no test coverage detected