MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / CreateApp

Method CreateApp

controller/service/iml.go:750–770  ·  view source on GitHub ↗
(ctx *gin.Context, teamID string, input *service_dto.CreateApp)

Source from the content-addressed store, hash-verified

748}
749
750func (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}
771func (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}

Callers

nothing calls this directly

Calls 4

CreateAppMethod · 0.65
AddAuthorizationMethod · 0.65
DeleteAppMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected