(e *api.AiAPIInfo)
| 57 | } |
| 58 | |
| 59 | func FromEntity(e *api.AiAPIInfo) *API { |
| 60 | cfg := make(map[string]interface{}) |
| 61 | if e.AdditionalConfig != "" { |
| 62 | _ = json.Unmarshal([]byte(e.AdditionalConfig), &cfg) |
| 63 | } |
| 64 | return &API{ |
| 65 | ID: e.Uuid, |
| 66 | Name: e.Name, |
| 67 | Service: e.Service, |
| 68 | Path: e.Path, |
| 69 | Description: e.Description, |
| 70 | Timeout: e.Timeout, |
| 71 | Retry: e.Retry, |
| 72 | Model: e.Model, |
| 73 | CreateAt: e.CreateAt, |
| 74 | UpdateAt: e.UpdateAt, |
| 75 | Creator: e.Creator, |
| 76 | Updater: e.Updater, |
| 77 | Disable: e.Disable, |
| 78 | UseToken: e.UseToken, |
| 79 | Provider: e.Provider, |
| 80 | Type: e.Type, |
| 81 | AdditionalConfig: cfg, |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | type APIUse struct { |
| 86 | API string |
nothing calls this directly
no outgoing calls
no test coverage detected