Skip to content

Commit

Permalink
Merge pull request #254 from openinfradev/change_basepath_swagger
Browse files Browse the repository at this point in the history
trivial. change swagger base path to "/" from "/api/1.0/"
  • Loading branch information
cho4036 authored Mar 4, 2024
2 parents 3704bb4 + b34eb3d commit b43aca2
Show file tree
Hide file tree
Showing 17 changed files with 349 additions and 349 deletions.
154 changes: 77 additions & 77 deletions api/swagger/docs.go

Large diffs are not rendered by default.

154 changes: 77 additions & 77 deletions api/swagger/swagger.json

Large diffs are not rendered by default.

154 changes: 77 additions & 77 deletions api/swagger/swagger.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func init() {
// @name Authorization

// @host tks-api-dev.taco-cat.xyz
// @BasePath /api/1.0/
// @BasePath /
func main() {
log.Info("*** Arguments *** ")
for i, s := range viper.AllSettings() {
Expand Down
10 changes: 5 additions & 5 deletions internal/delivery/http/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (h *AlertHandler) CreateAlert(w http.ResponseWriter, r *http.Request) {
// @Param sortOrder query string false "sortOrder"
// @Param filters query []string false "filters"
// @Success 200 {object} domain.GetAlertsResponse
// @Router /organizations/{organizationId}/alerts [get]
// @Router /api/1.0/organizations/{organizationId}/alerts [get]
// @Security JWT
func (h *AlertHandler) GetAlerts(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -155,7 +155,7 @@ func (h *AlertHandler) GetAlerts(w http.ResponseWriter, r *http.Request) {
// @Param organizationId path string true "organizationId"
// @Param alertId path string true "alertId"
// @Success 200 {object} domain.GetAlertResponse
// @Router /organizations/{organizationId}/alerts/{alertId} [get]
// @Router /api/1.0/organizations/{organizationId}/alerts/{alertId} [get]
// @Security JWT
func (h *AlertHandler) GetAlert(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -202,7 +202,7 @@ func (h *AlertHandler) GetAlert(w http.ResponseWriter, r *http.Request) {
// @Param organizationId path string true "organizationId"
// @Param body body domain.UpdateAlertRequest true "Update cloud setting request"
// @Success 200 {object} nil
// @Router /organizations/{organizationId}/alerts/{alertId} [put]
// @Router /api/1.0/organizations/{organizationId}/alerts/{alertId} [put]
// @Security JWT
func (h *AlertHandler) UpdateAlert(w http.ResponseWriter, r *http.Request) {
ErrorJSON(w, r, fmt.Errorf("Need implementation"))
Expand All @@ -217,7 +217,7 @@ func (h *AlertHandler) UpdateAlert(w http.ResponseWriter, r *http.Request) {
// @Param organizationId path string true "organizationId"
// @Param alertId path string true "alertId"
// @Success 200 {object} nil
// @Router /organizations/{organizationId}/alerts/{alertId} [delete]
// @Router /api/1.0/organizations/{organizationId}/alerts/{alertId} [delete]
// @Security JWT
func (h *AlertHandler) DeleteAlert(w http.ResponseWriter, r *http.Request) {
ErrorJSON(w, r, fmt.Errorf("Need implementation"))
Expand All @@ -241,7 +241,7 @@ func (h *AlertHandler) AlertTest(w http.ResponseWriter, r *http.Request) {
// @Produce json
// @Param organizationId path string true "organizationId"
// @Success 200 {object} nil
// @Router /organizations/{organizationId}/alerts/{alertId}/actions [post]
// @Router /api/1.0/organizations/{organizationId}/alerts/{alertId}/actions [post]
// @Security JWT
func (h *AlertHandler) CreateAlertAction(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down
12 changes: 6 additions & 6 deletions internal/delivery/http/app-group.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewAppGroupHandler(h usecase.Usecase) *AppGroupHandler {
// @Produce json
// @Param body body domain.CreateAppGroupRequest true "create appgroup request"
// @Success 200 {object} domain.CreateAppGroupResponse
// @Router /app-groups [post]
// @Router /api/1.0/app-groups [post]
// @Security JWT
func (h *AppGroupHandler) CreateAppGroup(w http.ResponseWriter, r *http.Request) {
input := domain.CreateAppGroupRequest{}
Expand Down Expand Up @@ -72,7 +72,7 @@ func (h *AppGroupHandler) CreateAppGroup(w http.ResponseWriter, r *http.Request)
// @Param sortOrder query string false "sortOrder"
// @Param filters query []string false "filters"
// @Success 200 {object} domain.GetAppGroupsResponse
// @Router /app-groups [get]
// @Router /api/1.0/app-groups [get]
// @Security JWT
func (h *AppGroupHandler) GetAppGroups(w http.ResponseWriter, r *http.Request) {
urlParams := r.URL.Query()
Expand Down Expand Up @@ -114,7 +114,7 @@ func (h *AppGroupHandler) GetAppGroups(w http.ResponseWriter, r *http.Request) {
// @Produce json
// @Param appGroupId path string true "appGroupId"
// @Success 200 {object} domain.GetAppGroupResponse
// @Router /app-groups/{appGroupId} [get]
// @Router /api/1.0/app-groups/{appGroupId} [get]
// @Security JWT
func (h *AppGroupHandler) GetAppGroup(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -150,7 +150,7 @@ func (h *AppGroupHandler) GetAppGroup(w http.ResponseWriter, r *http.Request) {
// @Produce json
// @Param object body string true "body"
// @Success 200 {object} nil
// @Router /app-groups [delete]
// @Router /api/1.0/app-groups [delete]
// @Security JWT
func (h *AppGroupHandler) DeleteAppGroup(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -185,7 +185,7 @@ func (h *AppGroupHandler) DeleteAppGroup(w http.ResponseWriter, r *http.Request)
// @Param appGroupId path string true "appGroupId"
// @Param applicationType query string true "applicationType"
// @Success 200 {object} domain.GetApplicationsResponse
// @Router /app-groups/{appGroupId}/applications [get]
// @Router /api/1.0/app-groups/{appGroupId}/applications [get]
// @Security JWT
func (h *AppGroupHandler) GetApplications(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -236,7 +236,7 @@ func (h *AppGroupHandler) GetApplications(w http.ResponseWriter, r *http.Request
// @Produce json
// @Param object body domain.CreateApplicationRequest true "body"
// @Success 200 {object} nil
// @Router /app-groups/{appGroupId}/applications [post]
// @Router /api/1.0/app-groups/{appGroupId}/applications [post]
// @Security JWT
func (h *AppGroupHandler) CreateApplication(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down
28 changes: 14 additions & 14 deletions internal/delivery/http/app-serve-app.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func NewAppServeAppHandler(h usecase.Usecase) *AppServeAppHandler {
// @Param projectId path string true "Project ID"
// @Param object body domain.CreateAppServeAppRequest true "Request body to create app"
// @Success 200 {object} string
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps [post]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps [post]
// @Security JWT
func (h *AppServeAppHandler) CreateAppServeApp(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -229,7 +229,7 @@ func (h *AppServeAppHandler) CreateAppServeApp(w http.ResponseWriter, r *http.Re
// @Param sortOrder query string false "sortOrder"
// @Param filters query []string false "filters"
// @Success 200 {object} []domain.AppServeApp
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps [get]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps [get]
// @Security JWT
func (h *AppServeAppHandler) GetAppServeApps(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -281,7 +281,7 @@ func (h *AppServeAppHandler) GetAppServeApps(w http.ResponseWriter, r *http.Requ
// @Param projectId path string true "Project ID"
// @Param appId path string true "App ID"
// @Success 200 {object} domain.GetAppServeAppResponse
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId} [get]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId} [get]
// @Security JWT
func (h *AppServeAppHandler) GetAppServeApp(w http.ResponseWriter, r *http.Request) {
//////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -344,7 +344,7 @@ func (h *AppServeAppHandler) GetAppServeApp(w http.ResponseWriter, r *http.Reque
// @Param projectId path string true "Project ID"
// @Param appId path string true "App ID"
// @Success 200 {object} domain.GetAppServeAppTaskResponse
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/latest-task [get]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/latest-task [get]
// @Security JWT
func (h *AppServeAppHandler) GetAppServeAppLatestTask(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -388,7 +388,7 @@ func (h *AppServeAppHandler) GetAppServeAppLatestTask(w http.ResponseWriter, r *
// @Param projectId path string true "Project ID"
// @Param stackId query string true "Stack ID"
// @Success 200 {object} int64
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/count [get]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/count [get]
// @Security JWT
func (h *AppServeAppHandler) GetNumOfAppsOnStack(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -430,7 +430,7 @@ func (h *AppServeAppHandler) GetNumOfAppsOnStack(w http.ResponseWriter, r *http.
// @Param sortOrder query string false "sortOrder"
// @Param filters query []string false "filters"
// @Success 200 {object} []domain.AppServeApp
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/tasks [get]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/tasks [get]
// @Security JWT
func (h *AppServeAppHandler) GetAppServeAppTasksByAppId(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -477,7 +477,7 @@ func (h *AppServeAppHandler) GetAppServeAppTasksByAppId(w http.ResponseWriter, r
// @Param appId path string true "App ID"
// @Param taskId path string true "Task ID"
// @Success 200 {object} domain.GetAppServeAppTaskResponse
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/tasks/{taskId} [get]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/tasks/{taskId} [get]
// @Security JWT
func (h *AppServeAppHandler) GetAppServeAppTaskDetail(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -643,7 +643,7 @@ func makeStage(task *domain.AppServeAppTask, app *domain.AppServeApp, pl string)
// @Param organizationId path string true "Organization ID"
// @Param projectId path string true "Project ID"
// @Success 200 {object} bool
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/exist [get]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/exist [get]
// @Security JWT
func (h *AppServeAppHandler) IsAppServeAppExist(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -685,7 +685,7 @@ func (h *AppServeAppHandler) IsAppServeAppExist(w http.ResponseWriter, r *http.R
// @Param projectId path string true "Project ID"
// @Param name path string true "name"
// @Success 200 {object} bool
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/name/{name}/existence [get]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/name/{name}/existence [get]
// @Security JWT
func (h *AppServeAppHandler) IsAppServeAppNameExist(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -726,7 +726,7 @@ func (h *AppServeAppHandler) IsAppServeAppNameExist(w http.ResponseWriter, r *ht
// @Param appId path string true "App ID"
// @Param object body domain.UpdateAppServeAppRequest true "Request body to update app"
// @Success 200 {object} string
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId} [put]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId} [put]
// @Security JWT
func (h *AppServeAppHandler) UpdateAppServeApp(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -836,7 +836,7 @@ func (h *AppServeAppHandler) UpdateAppServeApp(w http.ResponseWriter, r *http.Re
// @Param appId path string true "App ID"
// @Param body body domain.UpdateAppServeAppStatusRequest true "Request body to update app status"
// @Success 200 {object} string
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/status [patch]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/status [patch]
// @Security JWT
func (h *AppServeAppHandler) UpdateAppServeAppStatus(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -880,7 +880,7 @@ func (h *AppServeAppHandler) UpdateAppServeAppStatus(w http.ResponseWriter, r *h
// @Param appId path string true "appId"
// @Param body body domain.UpdateAppServeAppEndpointRequest true "Request body to update app endpoint"
// @Success 200 {object} string
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/endpoint [patch]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/endpoint [patch]
// @Security JWT
func (h *AppServeAppHandler) UpdateAppServeAppEndpoint(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -928,7 +928,7 @@ func (h *AppServeAppHandler) UpdateAppServeAppEndpoint(w http.ResponseWriter, r
// @Param projectId path string true "Project ID"
// @Param appId path string true "App ID"
// @Success 200 {object} string
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId} [delete]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId} [delete]
// @Security JWT
func (h *AppServeAppHandler) DeleteAppServeApp(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -966,7 +966,7 @@ func (h *AppServeAppHandler) DeleteAppServeApp(w http.ResponseWriter, r *http.Re
// @Param appId path string true "App ID"
// @Param object body domain.RollbackAppServeAppRequest true "Request body to rollback app"
// @Success 200 {object} string
// @Router /organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/rollback [post]
// @Router /api/1.0/organizations/{organizationId}/projects/{projectId}/app-serve-apps/{appId}/rollback [post]
// @Security JWT
func (h *AppServeAppHandler) RollbackAppServeApp(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down
8 changes: 4 additions & 4 deletions internal/delivery/http/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewAuditHandler(h usecase.Usecase) *AuditHandler {
// @Produce json
// @Param body body domain.CreateAuditRequest true "create audit request"
// @Success 200 {object} domain.CreateAuditResponse
// @Router /organizations/{organizationId}/audits [post]
// @Router /api/1.0/organizations/{organizationId}/audits [post]
// @Security JWT
func (h *AuditHandler) CreateAudit(w http.ResponseWriter, r *http.Request) {
ErrorJSON(w, r, fmt.Errorf("need implementation"))
Expand All @@ -52,7 +52,7 @@ func (h *AuditHandler) CreateAudit(w http.ResponseWriter, r *http.Request) {
// @Param filter query []string false "filters"
// @Param or query []string false "filters"
// @Success 200 {object} domain.GetAuditsResponse
// @Router /organizations/{organizationId}/audits [get]
// @Router /api/1.0/organizations/{organizationId}/audits [get]
// @Security JWT
func (h *AuditHandler) GetAudits(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -93,7 +93,7 @@ func (h *AuditHandler) GetAudits(w http.ResponseWriter, r *http.Request) {
// @Produce json
// @Param auditId path string true "auditId"
// @Success 200 {object} domain.GetAuditResponse
// @Router /organizations/{organizationId}/audits/{auditId} [get]
// @Router /api/1.0/organizations/{organizationId}/audits/{auditId} [get]
// @Security JWT
func (h *AuditHandler) GetAudit(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
Expand Down Expand Up @@ -133,7 +133,7 @@ func (h *AuditHandler) GetAudit(w http.ResponseWriter, r *http.Request) {
// @Produce json
// @Param auditId path string true "auditId"
// @Success 200 {object} nil
// @Router /organizations/{organizationId}/audits/{auditId} [delete]
// @Router /api/1.0/organizations/{organizationId}/audits/{auditId} [delete]
// @Security JWT
func (h *AuditHandler) DeleteAudit(w http.ResponseWriter, r *http.Request) {
ErrorJSON(w, r, fmt.Errorf("need implementation"))
Expand Down
Loading

0 comments on commit b43aca2

Please sign in to comment.