Skip to content

Commit

Permalink
fix conflict during rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
cho4036 committed Mar 15, 2024
1 parent 22acb2c commit 481e019
Show file tree
Hide file tree
Showing 26 changed files with 155 additions and 153 deletions.
12 changes: 6 additions & 6 deletions internal/delivery/http/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ func (h *AlertHandler) GetAlerts(w http.ResponseWriter, r *http.Request) {
var out domain.GetAlertsResponse
out.Alerts = make([]domain.AlertResponse, len(alerts))
for i, alert := range alerts {
if err := serializer.Map(alert, &out.Alerts[i]); err != nil {
if err := serializer.Map(r.Context(), alert, &out.Alerts[i]); err != nil {
log.Info(r.Context(), err)
}

outAlertActions := make([]domain.AlertActionResponse, len(alert.AlertActions))
for j, alertAction := range alert.AlertActions {
if err := serializer.Map(alertAction, &outAlertActions[j]); err != nil {
if err := serializer.Map(r.Context(), alertAction, &outAlertActions[j]); err != nil {
log.Info(r.Context(), err)
}
}
Expand All @@ -142,7 +142,7 @@ func (h *AlertHandler) GetAlerts(w http.ResponseWriter, r *http.Request) {
}
}

if out.Pagination, err = pg.Response(); err != nil {
if out.Pagination, err = pg.Response(r.Context()); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -182,12 +182,12 @@ func (h *AlertHandler) GetAlert(w http.ResponseWriter, r *http.Request) {
}

var out domain.GetAlertResponse
if err := serializer.Map(alert, &out.Alert); err != nil {
if err := serializer.Map(r.Context(), alert, &out.Alert); err != nil {
log.Info(r.Context(), err)
}
outAlertActions := make([]domain.AlertActionResponse, len(alert.AlertActions))
for j, alertAction := range alert.AlertActions {
if err := serializer.Map(alertAction, &outAlertActions[j]); err != nil {
if err := serializer.Map(r.Context(), alertAction, &outAlertActions[j]); err != nil {
log.Info(r.Context(), err)
continue
}
Expand Down Expand Up @@ -274,7 +274,7 @@ func (h *AlertHandler) CreateAlertAction(w http.ResponseWriter, r *http.Request)
log.Info(r.Context(), "alert : ", helper.ModelToJson(input))

var dto model.AlertAction
if err = serializer.Map(input, &dto); err != nil {
if err = serializer.Map(r.Context(), input, &dto); err != nil {
log.Info(r.Context(), err)
}
dto.AlertId = alertId
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 @@ -45,7 +45,7 @@ func (h *AppGroupHandler) CreateAppGroup(w http.ResponseWriter, r *http.Request)
}

var dto model.AppGroup
if err = serializer.Map(input, &dto); err != nil {
if err = serializer.Map(r.Context(), input, &dto); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -96,13 +96,13 @@ func (h *AppGroupHandler) GetAppGroups(w http.ResponseWriter, r *http.Request) {
var out domain.GetAppGroupsResponse
out.AppGroups = make([]domain.AppGroupResponse, len(appGroups))
for i, appGroup := range appGroups {
if err := serializer.Map(appGroup, &out.AppGroups[i]); err != nil {
if err := serializer.Map(r.Context(), appGroup, &out.AppGroups[i]); err != nil {
log.Info(r.Context(), err)
continue
}
}

if out.Pagination, err = pg.Response(); err != nil {
if out.Pagination, err = pg.Response(r.Context()); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -139,7 +139,7 @@ func (h *AppGroupHandler) GetAppGroup(w http.ResponseWriter, r *http.Request) {
}

var out domain.GetAppGroupResponse
if err := serializer.Map(appGroup, &out.AppGroup); err != nil {
if err := serializer.Map(r.Context(), appGroup, &out.AppGroup); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -225,7 +225,7 @@ func (h *AppGroupHandler) GetApplications(w http.ResponseWriter, r *http.Request
var out domain.GetApplicationsResponse
out.Applications = make([]domain.ApplicationResponse, len(applications))
for i, application := range applications {
if err := serializer.Map(application, &out.Applications[i]); err != nil {
if err := serializer.Map(r.Context(), application, &out.Applications[i]); err != nil {
log.Info(r.Context(), err)
continue
}
Expand Down Expand Up @@ -266,7 +266,7 @@ func (h *AppGroupHandler) CreateApplication(w http.ResponseWriter, r *http.Reque
}

var dto model.Application
if err := serializer.Map(input, &dto); err != nil {
if err := serializer.Map(r.Context(), input, &dto); err != nil {
log.Info(r.Context(), err)
}
dto.AppGroupId = appGroupId
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 @@ -118,7 +118,7 @@ func (h *AppServeAppHandler) CreateAppServeApp(w http.ResponseWriter, r *http.Re
(appReq).SetDefaultValue()

var app model.AppServeApp
if err = serializer.Map(appReq, &app); err != nil {
if err = serializer.Map(r.Context(), appReq, &app); err != nil {
ErrorJSON(w, r, httpErrors.NewBadRequestError(err, "", ""))
return
}
Expand All @@ -134,7 +134,7 @@ func (h *AppServeAppHandler) CreateAppServeApp(w http.ResponseWriter, r *http.Re
app.CreatedAt = now

var task model.AppServeAppTask
if err = serializer.Map(appReq, &task); err != nil {
if err = serializer.Map(r.Context(), appReq, &task); err != nil {
ErrorJSON(w, r, httpErrors.NewBadRequestError(err, "", ""))
return
}
Expand Down Expand Up @@ -209,7 +209,7 @@ func (h *AppServeAppHandler) CreateAppServeApp(w http.ResponseWriter, r *http.Re
}

var out domain.CreateAppServeAppResponse
if err = serializer.Map(app, &out); err != nil {
if err = serializer.Map(r.Context(), app, &out); err != nil {
ErrorJSON(w, r, err)
return
}
Expand Down Expand Up @@ -268,13 +268,13 @@ func (h *AppServeAppHandler) GetAppServeApps(w http.ResponseWriter, r *http.Requ
var out domain.GetAppServeAppsResponse
out.AppServeApps = make([]domain.AppServeAppResponse, len(apps))
for i, app := range apps {
if err := serializer.Map(app, &out.AppServeApps[i]); err != nil {
if err := serializer.Map(r.Context(), app, &out.AppServeApps[i]); err != nil {
log.Info(r.Context(), err)
continue
}
}

if out.Pagination, err = pg.Response(); err != nil {
if out.Pagination, err = pg.Response(r.Context()); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -338,7 +338,7 @@ func (h *AppServeAppHandler) GetAppServeApp(w http.ResponseWriter, r *http.Reque
app.AppServeAppTasks = newTasks

var out domain.GetAppServeAppResponse
if err := serializer.Map(app, &out.AppServeApp); err != nil {
if err := serializer.Map(r.Context(), app, &out.AppServeApp); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -388,7 +388,7 @@ func (h *AppServeAppHandler) GetAppServeAppLatestTask(w http.ResponseWriter, r *
}

var out domain.GetAppServeAppTaskResponse
if err := serializer.Map(task, &out.AppServeAppTask); err != nil {
if err := serializer.Map(r.Context(), task, &out.AppServeAppTask); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -478,13 +478,13 @@ func (h *AppServeAppHandler) GetAppServeAppTasksByAppId(w http.ResponseWriter, r
var out domain.GetAppServeAppTasksResponse
out.AppServeAppTasks = make([]domain.AppServeAppTaskResponse, len(tasks))
for i, task := range tasks {
if err := serializer.Map(task, &out.AppServeAppTasks[i]); err != nil {
if err := serializer.Map(r.Context(), task, &out.AppServeAppTasks[i]); err != nil {
log.Info(r.Context(), err)
continue
}
}

if out.Pagination, err = pg.Response(); err != nil {
if out.Pagination, err = pg.Response(r.Context()); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -552,10 +552,10 @@ func (h *AppServeAppHandler) GetAppServeAppTaskDetail(w http.ResponseWriter, r *
}

var out domain.GetAppServeAppTaskResponse
if err := serializer.Map(app, &out.AppServeApp); err != nil {
if err := serializer.Map(r.Context(), app, &out.AppServeApp); err != nil {
log.Info(r.Context(), err)
}
if err := serializer.Map(task, &out.AppServeAppTask); err != nil {
if err := serializer.Map(r.Context(), task, &out.AppServeAppTask); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -809,18 +809,18 @@ func (h *AppServeAppHandler) UpdateAppServeApp(w http.ResponseWriter, r *http.Re
// break
// }
//}
//if err = serializer.Map(latestTask, &task); err != nil {
//if err = serializer.Map(r.Context(), latestTask, &task); err != nil {
// ErrorJSON(w, r, httpErrors.NewBadRequestError(err, "", ""))
// return
//}

var latestTask = app.AppServeAppTasks[0]
if err = serializer.Map(latestTask, &task); err != nil {
if err = serializer.Map(r.Context(), latestTask, &task); err != nil {
//ErrorJSON(w, r, httpErrors.NewBadRequestError(err, "", ""))
return
}

if err = serializer.Map(appReq, &task); err != nil {
if err = serializer.Map(r.Context(), appReq, &task); err != nil {
//ErrorJSON(w, r, httpErrors.NewBadRequestError(err, "", ""))
return
}
Expand Down
6 changes: 3 additions & 3 deletions internal/delivery/http/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ func (h *AuditHandler) GetAudits(w http.ResponseWriter, r *http.Request) {
var out domain.GetAuditsResponse
out.Audits = make([]domain.AuditResponse, len(audits))
for i, audit := range audits {
if err := serializer.Map(audit, &out.Audits[i]); err != nil {
if err := serializer.Map(r.Context(), audit, &out.Audits[i]); err != nil {
log.Info(r.Context(), err)
}
}

if out.Pagination, err = pg.Response(); err != nil {
if out.Pagination, err = pg.Response(r.Context()); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -113,7 +113,7 @@ func (h *AuditHandler) GetAudit(w http.ResponseWriter, r *http.Request) {
log.Info(r.Context(), audit)

var out domain.GetAuditResponse
if err := serializer.Map(audit, &out.Audit); err != nil {
if err := serializer.Map(r.Context(), audit, &out.Audit); err != nil {
log.Info(r.Context(), err)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/delivery/http/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (h *AuthHandler) Login(w http.ResponseWriter, r *http.Request) {
}

var out domain.LoginResponse
if err = serializer.Map(user, &out.User); err != nil {
if err = serializer.Map(r.Context(), user, &out.User); err != nil {
log.Error(r.Context(), err)
}

Expand Down
14 changes: 7 additions & 7 deletions internal/delivery/http/cloud-account.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (h *CloudAccountHandler) CreateCloudAccount(w http.ResponseWriter, r *http.
}

var dto model.CloudAccount
if err = serializer.Map(input, &dto); err != nil {
if err = serializer.Map(r.Context(), input, &dto); err != nil {
log.Info(r.Context(), err)
}
dto.OrganizationId = organizationId
Expand Down Expand Up @@ -107,13 +107,13 @@ func (h *CloudAccountHandler) GetCloudAccounts(w http.ResponseWriter, r *http.Re
var out domain.GetCloudAccountsResponse
out.CloudAccounts = make([]domain.CloudAccountResponse, len(cloudAccounts))
for i, cloudAccount := range cloudAccounts {
if err := serializer.Map(cloudAccount, &out.CloudAccounts[i]); err != nil {
if err := serializer.Map(r.Context(), cloudAccount, &out.CloudAccounts[i]); err != nil {
log.Info(r.Context(), err)
continue
}
}

if out.Pagination, err = pg.Response(); err != nil {
if out.Pagination, err = pg.Response(r.Context()); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -153,7 +153,7 @@ func (h *CloudAccountHandler) GetCloudAccount(w http.ResponseWriter, r *http.Req
}

var out domain.GetCloudAccountResponse
if err := serializer.Map(cloudAccount, &out.CloudAccount); err != nil {
if err := serializer.Map(r.Context(), cloudAccount, &out.CloudAccount); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -200,7 +200,7 @@ func (h *CloudAccountHandler) UpdateCloudAccount(w http.ResponseWriter, r *http.
}

var dto model.CloudAccount
if err = serializer.Map(input, &dto); err != nil {
if err = serializer.Map(r.Context(), input, &dto); err != nil {
log.Info(r.Context(), err)
}
dto.ID = cloudAccountId
Expand Down Expand Up @@ -250,7 +250,7 @@ func (h *CloudAccountHandler) DeleteCloudAccount(w http.ResponseWriter, r *http.
}

var dto model.CloudAccount
if err = serializer.Map(input, &dto); err != nil {
if err = serializer.Map(r.Context(), input, &dto); err != nil {
log.Info(r.Context(), err)
}
dto.ID = parsedId
Expand Down Expand Up @@ -416,7 +416,7 @@ func (h *CloudAccountHandler) GetResourceQuota(w http.ResponseWriter, r *http.Re
}

var out domain.GetCloudAccountResourceQuotaResponse
if err := serializer.Map(resourceQuota, &out.ResourceQuota); err != nil {
if err := serializer.Map(r.Context(), resourceQuota, &out.ResourceQuota); err != nil {
log.Info(r.Context(), err)
}
out.Available = available
Expand Down
10 changes: 5 additions & 5 deletions internal/delivery/http/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (h *ClusterHandler) GetClusters(w http.ResponseWriter, r *http.Request) {
var out domain.GetClustersResponse
out.Clusters = make([]domain.ClusterResponse, len(clusters))
for i, cluster := range clusters {
if err := serializer.Map(cluster, &out.Clusters[i]); err != nil {
if err := serializer.Map(r.Context(), cluster, &out.Clusters[i]); err != nil {
log.Info(r.Context(), err)
continue
}
Expand All @@ -67,7 +67,7 @@ func (h *ClusterHandler) GetClusters(w http.ResponseWriter, r *http.Request) {

}

if out.Pagination, err = pg.Response(); err != nil {
if out.Pagination, err = pg.Response(r.Context()); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -100,7 +100,7 @@ func (h *ClusterHandler) GetCluster(w http.ResponseWriter, r *http.Request) {
}

var out domain.GetClusterResponse
if err := serializer.Map(cluster, &out.Cluster); err != nil {
if err := serializer.Map(r.Context(), cluster, &out.Cluster); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -158,7 +158,7 @@ func (h *ClusterHandler) CreateCluster(w http.ResponseWriter, r *http.Request) {
}

var dto model.Cluster
if err = serializer.Map(input, &dto); err != nil {
if err = serializer.Map(r.Context(), input, &dto); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -212,7 +212,7 @@ func (h *ClusterHandler) ImportCluster(w http.ResponseWriter, r *http.Request) {
}

var dto model.Cluster
if err = serializer.Map(input, &dto); err != nil {
if err = serializer.Map(r.Context(), input, &dto); err != nil {
log.Info(r.Context(), err)
}
dto.SetDefaultConf()
Expand Down
8 changes: 4 additions & 4 deletions internal/delivery/http/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (h *DashboardHandler) GetCharts(w http.ResponseWriter, r *http.Request) {
var out domain.GetDashboardChartsResponse
out.Charts = make([]domain.DashboardChartResponse, len(charts))
for i, chart := range charts {
if err := serializer.Map(chart, &out.Charts[i]); err != nil {
if err := serializer.Map(r.Context(), chart, &out.Charts[i]); err != nil {
log.Info(r.Context(), err)
continue
}
Expand Down Expand Up @@ -153,7 +153,7 @@ func (h *DashboardHandler) GetChart(w http.ResponseWriter, r *http.Request) {
}

var out domain.DashboardChartResponse
if err := serializer.Map(charts[0], &out); err != nil {
if err := serializer.Map(r.Context(), charts[0], &out); err != nil {
log.Info(r.Context(), err)
}

Expand Down Expand Up @@ -193,7 +193,7 @@ func (h *DashboardHandler) GetStacks(w http.ResponseWriter, r *http.Request) {
var out domain.GetDashboardStacksResponse
out.Stacks = make([]domain.DashboardStackResponse, len(stacks))
for i, stack := range stacks {
if err := serializer.Map(stack, &out.Stacks[i]); err != nil {
if err := serializer.Map(r.Context(), stack, &out.Stacks[i]); err != nil {
log.Info(r.Context(), err)
continue
}
Expand Down Expand Up @@ -231,7 +231,7 @@ func (h *DashboardHandler) GetResources(w http.ResponseWriter, r *http.Request)
return
}
var out domain.GetDashboardResourcesResponse
if err := serializer.Map(resources, &out.Resources); err != nil {
if err := serializer.Map(r.Context(), resources, &out.Resources); err != nil {
log.Info(r.Context(), err)
}

Expand Down
Loading

0 comments on commit 481e019

Please sign in to comment.