(ctx context.Context, input *system_apikey_dto.Create)
| 203 | } |
| 204 | |
| 205 | func (i *imlAPIKeyModule) Create(ctx context.Context, input *system_apikey_dto.Create) error { |
| 206 | if input.Id == "" { |
| 207 | input.Id = uuid.NewString() |
| 208 | } |
| 209 | return i.transaction.Transaction(ctx, func(ctx context.Context) error { |
| 210 | err := i.apikeyService.Create(ctx, &system_apikey.Create{ |
| 211 | Id: input.Id, |
| 212 | Name: input.Name, |
| 213 | Value: input.Value, |
| 214 | Expired: input.Expired, |
| 215 | }) |
| 216 | if err != nil { |
| 217 | return err |
| 218 | } |
| 219 | client, err := i.clusterServer.GatewayClient(ctx, cluster.DefaultClusterID) |
| 220 | if err != nil { |
| 221 | return err |
| 222 | } |
| 223 | return i.online(ctx, client) |
| 224 | }) |
| 225 | } |
| 226 | |
| 227 | func (i *imlAPIKeyModule) Update(ctx context.Context, id string, input *system_apikey_dto.Update) error { |
| 228 | return i.transaction.Transaction(ctx, func(ctx context.Context) error { |
nothing calls this directly
no test coverage detected