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

Method CreateApi

internal/repository/api.go:32–37  ·  view source on GitHub ↗

CreateApi 创建新的API

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

Source from the content-addressed store, hash-verified

30
31// CreateApi 创建新的API
32func (a *apiRepository) CreateApi(ctx context.Context, api *domain.Api) error {
33 if api == nil {
34 return dao.ErrInvalidMenu // 添加空指针检查
35 }
36 return a.dao.CreateApi(ctx, a.apiToDAO(api))
37}
38
39// GetApiById 根据ID获取API
40func (a *apiRepository) GetApiById(ctx context.Context, id int) (*domain.Api, error) {

Callers

nothing calls this directly

Calls 2

apiToDAOMethod · 0.95
CreateApiMethod · 0.65

Tested by

no test coverage detected