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

Function createEntityHandler

service/ai-api/iml.go:68–87  ·  view source on GitHub ↗
(i *Create)

Source from the content-addressed store, hash-verified

66 return []map[string]interface{}{{"uuid": i.ID}}
67}
68func createEntityHandler(i *Create) *api.AiAPIInfo {
69 now := time.Now()
70 cfg, _ := json.Marshal(i.AdditionalConfig)
71 return &api.AiAPIInfo{
72 Uuid: i.ID,
73 Name: i.Name,
74 Service: i.Service,
75 Path: i.Path,
76 Description: i.Description,
77 Timeout: i.Timeout,
78 Retry: i.Retry,
79 Model: i.Model,
80 Provider: i.Provider,
81 Disable: i.Disable,
82 Type: i.Type,
83 CreateAt: now,
84 UpdateAt: now,
85 AdditionalConfig: string(cfg),
86 }
87}
88func updateHandler(e *api.AiAPIInfo, i *Edit) {
89 if i.Name != nil {
90 e.Name = *i.Name

Callers

nothing calls this directly

Calls 1

MarshalMethod · 0.80

Tested by

no test coverage detected