| 174 | } |
| 175 | |
| 176 | func 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 | } |
| 200 | func updateHandler(e *service.Service, i *Edit) { |
| 201 | if i.Name != nil { |
| 202 | e.Name = *i.Name |