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

Method Save

service/upstream/iml.go:111–125  ·  view source on GitHub ↗
(ctx context.Context, u *SaveUpstream)

Source from the content-addressed store, hash-verified

109}
110
111func (i *imlUpstreamService) Save(ctx context.Context, u *SaveUpstream) error {
112 now := time.Now()
113 userId := utils.UserId(ctx)
114 return i.store.Save(ctx, &upstream.Upstream{
115 UUID: u.UUID,
116 Name: u.Name,
117 Service: u.Service,
118 Team: u.Team,
119 Remark: u.Remark,
120 Creator: userId,
121 Updater: userId,
122 CreateAt: now,
123 UpdateAt: now,
124 })
125}
126
127func (i *imlUpstreamService) Delete(ctx context.Context, id string) error {
128 _, err := i.store.DeleteWhere(ctx, map[string]interface{}{"uuid": id})

Callers

nothing calls this directly

Calls 1

SaveMethod · 0.65

Tested by

no test coverage detected