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

Method CreateApi

internal/service/api.go:33–40  ·  view source on GitHub ↗

CreateApi 创建新的API

(ctx context.Context, api *domain.Api)

Source from the content-addressed store, hash-verified

31
32// CreateApi 创建新的API
33func (a *apiService) CreateApi(ctx context.Context, api *domain.Api) error {
34 if api == nil {
35 a.l.Warn("API不能为空")
36 return errors.New("api不能为空")
37 }
38
39 return a.repo.CreateApi(ctx, api)
40}
41
42// GetApiById 根据ID获取API
43func (a *apiService) GetApiById(ctx context.Context, id int) (*domain.Api, error) {

Callers

nothing calls this directly

Calls 1

CreateApiMethod · 0.65

Tested by

no test coverage detected