MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / GetApiById

Method GetApiById

internal/service/api.go:43–50  ·  view source on GitHub ↗

GetApiById 根据ID获取API

(ctx context.Context, id int)

Source from the content-addressed store, hash-verified

41
42// GetApiById 根据ID获取API
43func (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信息
53func (a *apiService) UpdateApi(ctx context.Context, api *domain.Api) error {

Callers

nothing calls this directly

Calls 1

GetApiByIdMethod · 0.65

Tested by

no test coverage detected