MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / createEntityHandler

Function createEntityHandler

service/service/iml.go:176–199  ·  view source on GitHub ↗
(i *Create)

Source from the content-addressed store, hash-verified

174}
175
176func createEntityHandler(i *Create) *service.Service {
177 cfg, _ := json.Marshal(i.AdditionalConfig)
178 now := time.Now()
179 return &service.Service{
180 Id: 0,
181 UUID: i.Id,
182 Name: i.Name,
183 CreateAt: now,
184 UpdateAt: now,
185 Description: i.Description,
186 Logo: i.Logo,
187 Prefix: i.Prefix,
188 Team: i.Team,
189 ServiceType: i.ServiceType.Int(),
190 ApprovalType: i.ApprovalType.Int(),
191 Kind: i.Kind.Int(),
192 AdditionalConfig: string(cfg),
193 State: i.State,
194 Catalogue: i.Catalogue,
195 AsServer: i.AsServer,
196 AsApp: i.AsApp,
197 EnableMCP: i.EnableMCP,
198 }
199}
200func updateHandler(e *service.Service, i *Edit) {
201 if i.Name != nil {
202 e.Name = *i.Name

Callers

nothing calls this directly

Calls 2

MarshalMethod · 0.80
IntMethod · 0.45

Tested by

no test coverage detected