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

Function updateHandler

service/service/iml.go:200–236  ·  view source on GitHub ↗
(e *service.Service, i *Edit)

Source from the content-addressed store, hash-verified

198 }
199}
200func updateHandler(e *service.Service, i *Edit) {
201 if i.Name != nil {
202 e.Name = *i.Name
203 }
204 if i.Description != nil {
205 e.Description = *i.Description
206 }
207 if i.ServiceType != nil {
208 e.ServiceType = (*i.ServiceType).Int()
209 }
210 if i.Kind != nil {
211 e.Kind = (*i.Kind).Int()
212 }
213 if i.Catalogue != nil {
214 e.Catalogue = *i.Catalogue
215 }
216 if i.Logo != nil {
217 e.Logo = *i.Logo
218 }
219 if i.AdditionalConfig != nil {
220 cfg, _ := json.Marshal(*i.AdditionalConfig)
221 e.AdditionalConfig = string(cfg)
222 }
223 if i.ApprovalType != nil {
224 e.ApprovalType = (*i.ApprovalType).Int()
225 }
226 if i.State != nil {
227 e.State = *i.State
228 }
229 if i.EnableMCP != nil {
230 e.EnableMCP = *i.EnableMCP
231 }
232 //if i.Prefix != nil {
233 // e.Prefix = *i.Prefix
234 //}
235 e.UpdateAt = time.Now()
236}

Callers

nothing calls this directly

Calls 2

MarshalMethod · 0.80
IntMethod · 0.45

Tested by

no test coverage detected