| 66 | return []map[string]interface{}{{"uuid": i.ID}} |
| 67 | } |
| 68 | func 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 | } |
| 88 | func updateHandler(e *api.AiAPIInfo, i *Edit) { |
| 89 | if i.Name != nil { |
| 90 | e.Name = *i.Name |