(ctx *gin.Context, teamID string, input *service_dto.CreateApp)
| 748 | } |
| 749 | |
| 750 | func (i *imlAppController) CreateApp(ctx *gin.Context, teamID string, input *service_dto.CreateApp) (*service_dto.App, error) { |
| 751 | app, err := i.module.CreateApp(ctx, teamID, input) |
| 752 | if err != nil { |
| 753 | return nil, err |
| 754 | } |
| 755 | _, err = i.authModule.AddAuthorization(ctx, app.Id, &application_authorization_dto.CreateAuthorization{ |
| 756 | Name: "Default API Key", |
| 757 | Driver: "apikey", |
| 758 | Position: "Header", |
| 759 | TokenName: "Authorization", |
| 760 | ExpireTime: 0, |
| 761 | Config: map[string]interface{}{ |
| 762 | "apikey": uuid.New().String(), |
| 763 | }, |
| 764 | }) |
| 765 | if err != nil { |
| 766 | i.module.DeleteApp(ctx, app.Id) |
| 767 | return nil, err |
| 768 | } |
| 769 | return app, nil |
| 770 | } |
| 771 | func (i *imlAppController) UpdateApp(ctx *gin.Context, appId string, input *service_dto.UpdateApp) (*service_dto.App, error) { |
| 772 | return i.module.UpdateApp(ctx, appId, input) |
| 773 | } |
nothing calls this directly
no test coverage detected