Skip to content

Commit

Permalink
Merge pull request #272 from actiontech/issue-269
Browse files Browse the repository at this point in the history
Issue 269
  • Loading branch information
ColdWaterLW authored Jul 8, 2024
2 parents 2f2e7dc + 0d69ec3 commit bdbb282
Show file tree
Hide file tree
Showing 22 changed files with 2,306 additions and 1,055 deletions.
11 changes: 2 additions & 9 deletions api/dms/service/v1/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package v1

import (
"mime/multipart"

base "github.com/actiontech/dms/pkg/dms-common/api/base/v1"
)

Expand Down Expand Up @@ -29,16 +30,8 @@ type GetStaticLogoReply struct {
File []byte
}

// swagger:parameters Personalization
// swagger:model
type PersonalizationReq struct {
// title
// Required: false
// in: formData
Title string `json:"title" form:"title"`

// file upload
// Required: false
// in: formData
// swagger:file
File *multipart.FileHeader `json:"file" form:"file"`
}
4 changes: 1 addition & 3 deletions api/dms/service/v1/company_notice.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ type GetCompanyNoticeReply struct {
base.GenericResp
}

// swagger:parameters UpdateCompanyNotice
// swagger:model
type UpdateCompanyNoticeReq struct {
// Update a companynotice
// in:body
UpdateCompanyNotice UpdateCompanyNotice `json:"company_notice" validate:"required"`
}

Expand Down
38 changes: 10 additions & 28 deletions api/dms/service/v1/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ type GetOauth2ConfigurationReply struct {
base.GenericResp
}

// swagger:parameters UpdateOauth2Configuration
// swagger:model
type Oauth2ConfigurationReq struct {
// update oauth2 configuration
// in:body
Oauth2Configuration Oauth2Configuration `json:"oauth2" validate:"required"`
}
type Oauth2Configuration struct {
Expand Down Expand Up @@ -65,7 +63,7 @@ type GetOauth2TipsResData struct {
LoginTip string `json:"login_tip"`
}

// swagger:parameters BindOauth2User
// swagger:model
type BindOauth2UserReq struct {
UserName string `json:"user_name" form:"user_name" validate:"required"`
Pwd string `json:"pwd" form:"pwd" validate:"required"`
Expand Down Expand Up @@ -109,10 +107,8 @@ type LDAPConfigurationResData struct {
LdapUserEmailRdnKey string `json:"ldap_user_email_rdn_key"`
}

// swagger:parameters UpdateLDAPConfiguration
// swagger:model
type UpdateLDAPConfigurationReq struct {
// update ldap configuration
// in:body
LDAPConfiguration LDAPConfiguration `json:"ldap" validate:"required"`
}

Expand Down Expand Up @@ -144,10 +140,8 @@ type SMTPConfigurationResData struct {
IsSkipVerify bool `json:"is_skip_verify"`
}

// swagger:parameters UpdateSMTPConfiguration
// swagger:model
type UpdateSMTPConfigurationReq struct {
// update smtp configuration
// in:body
UpdateSMTPConfiguration UpdateSMTPConfiguration `json:"smtp_configuration" validate:"required"`
}

Expand All @@ -160,10 +154,8 @@ type UpdateSMTPConfiguration struct {
IsSkipVerify *bool `json:"is_skip_verify" form:"is_skip_verify" description:"是否启用邮件通知"`
}

// swagger:parameters TestSMTPConfiguration
// swagger:model
type TestSMTPConfigurationReq struct {
// test smtp configuration
// in:body
TestSMTPConfiguration TestSMTPConfiguration `json:"test_smtp_configuration" validate:"required,email"`
}

Expand Down Expand Up @@ -200,10 +192,8 @@ type WeChatConfigurationResData struct {
ProxyIP string `json:"proxy_ip"`
}

// swagger:parameters UpdateWeChatConfiguration
// swagger:model
type UpdateWeChatConfigurationReq struct {
// update wechat configuration
// in:body
UpdateWeChatConfiguration UpdateWeChatConfiguration `json:"update_wechat_configuration"`
}

Expand All @@ -216,10 +206,8 @@ type UpdateWeChatConfiguration struct {
ProxyIP *string `json:"proxy_ip" from:"proxy_ip" description:"企业微信代理服务器IP"`
}

// swagger:parameters TestWeChatConfiguration
// swagger:model
type TestWeChatConfigurationReq struct {
// test wechat configuration
// in:body
TestWeChatConfiguration TestWeChatConfiguration `json:"test_wechat_configuration"`
}

Expand Down Expand Up @@ -253,10 +241,8 @@ type FeishuConfigurationResData struct {
IsFeishuNotificationEnabled bool `json:"is_feishu_notification_enabled"`
}

// swagger:parameters UpdateFeishuConfiguration
// swagger:model
type UpdateFeishuConfigurationReq struct {
// update feishu configuration
// in:body
UpdateFeishuConfiguration UpdateFeishuConfiguration `json:"update_feishu_configuration"`
}

Expand All @@ -266,10 +252,8 @@ type UpdateFeishuConfiguration struct {
IsFeishuNotificationEnabled *bool `json:"is_feishu_notification_enabled" from:"is_feishu_notification_enabled" description:"是否启用飞书推送"`
}

// swagger:parameters TestFeishuConfiguration
// swagger:model
type TestFeishuConfigurationReq struct {
// test feishu configuration
// in:body
TestFeishuConfiguration TestFeishuConfiguration `json:"test_feishu_configuration" validate:"required"`
}

Expand Down Expand Up @@ -325,10 +309,8 @@ type WebHookConfigurationData struct {
URL *string `json:"url" description:"回调API URL"`
}

// swagger:parameters UpdateWebHookConfiguration
// swagger:model
type UpdateWebHookConfigurationReq struct {
// test webhook configuration
// in:body
UpdateWebHookConfiguration WebHookConfigurationData `json:"webhook_config"`
}

Expand Down
8 changes: 2 additions & 6 deletions api/dms/service/v1/data_export_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ import (
base "github.com/actiontech/dms/pkg/dms-common/api/base/v1"
)

// swagger:parameters AddDataExportTask
// swagger:model
type AddDataExportTaskReq struct {
// project id
// Required: true
// in:path
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// add data export workflow
// in:body
DataExportTasks []DataExportTask `json:"data_export_tasks"`
}

Expand Down
27 changes: 7 additions & 20 deletions api/dms/service/v1/data_export_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ import (
base "github.com/actiontech/dms/pkg/dms-common/api/base/v1"
)

// swagger:parameters AddDataExportWorkflow
// swagger:model
type AddDataExportWorkflowReq struct {
// project id
// Required: true
// in:path
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// add data export workflow
// in:body
DataExportWorkflow DataExportWorkflow `json:"data_export_workflow"`
}

Expand Down Expand Up @@ -202,17 +198,12 @@ type RejectDataExportWorkflowPayload struct {
Reason string `json:"reason" validate:"required"`
}

// swagger:parameters RejectDataExportWorkflow
// swagger:model
type RejectDataExportWorkflowReq struct {
// project id
// Required: true
// in:path
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// Required: true
// in:path
// swagger:ignore
DataExportWorkflowUid string `param:"data_export_workflow_uid" json:"data_export_workflow_uid" validate:"required"`
// Required: true
// in:body
Payload RejectDataExportWorkflowPayload `json:"payload" validate:"required"`
}

Expand All @@ -221,13 +212,9 @@ type CancelDataExportWorkflowPayload struct {
DataExportWorkflowUids []string `json:"data_export_workflow_uids" validate:"required"`
}

// swagger:parameters CancelDataExportWorkflow
// swagger:model
type CancelDataExportWorkflowReq struct {
// project id
// Required: true
// in:path
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// Required: true
// in:body
Payload CancelDataExportWorkflowPayload `json:"payload" validate:"required"`
}
26 changes: 6 additions & 20 deletions api/dms/service/v1/database_source_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,10 @@ type DatabaseSourceService struct {
SQLEConfig *dmsCommonV1.SQLEConfig `json:"sqle_config"`
}

// swagger:parameters AddDatabaseSourceService
// swagger:model
type AddDatabaseSourceServiceReq struct {
// project id
// Required: true
// in:path
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// add database source service
// in:body
DatabaseSourceService DatabaseSourceService `json:"database_source_service"`
}

Expand All @@ -110,17 +106,12 @@ type AddDatabaseSourceServiceReply struct {
base.GenericResp
}

// swagger:parameters UpdateDatabaseSourceService
// swagger:model
type UpdateDatabaseSourceServiceReq struct {
// project id
// Required: true
// in:path
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// Required: true
// in:path
// swagger:ignore
DatabaseSourceServiceUid string `param:"database_source_service_uid" json:"database_source_service_uid" validate:"required"`
// update database source service
// in:body
DatabaseSourceService DatabaseSourceService `json:"database_source_service" validate:"required"`
}

Expand Down Expand Up @@ -160,13 +151,8 @@ type ListDatabaseSourceServiceTipsReq struct {
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
}

// swagger:parameters SyncDatabaseSourceService
// swagger:model
type SyncDatabaseSourceServiceReq struct {
// project id
// Required: true
// in:path
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// Required: true
// in:path
DatabaseSourceServiceUid string `param:"database_source_service_uid" json:"database_source_service_uid" validate:"required"`
}
43 changes: 10 additions & 33 deletions api/dms/service/v1/db_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@ type DBService struct {
IsEnableMasking bool `json:"is_enable_masking"`
}

// swagger:parameters AddDBService
// swagger:model AddDBServiceReq
type AddDBServiceReq struct {
// project id
// Required: true
// in:path
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// Add new db service
// in:body
DBService *DBService `json:"db_service" validate:"required"`
}

Expand Down Expand Up @@ -85,14 +81,10 @@ func (u *AddDBServiceReply) String() string {
return fmt.Sprintf("AddDBServiceReply{Uid:%s}", u.Data.Uid)
}

// swagger:parameters CheckDBServiceIsConnectable
// swagger:model
type CheckDBServiceIsConnectableReq struct {
// project id
// Required: true
// in:path
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// check db_service is connectable
// in:body
DBService dmsCommonV1.CheckDbConnectable `json:"db_service"`
}

Expand All @@ -109,14 +101,9 @@ type CheckDBServiceIsConnectableReply struct {
base.GenericResp
}

// swagger:parameters CheckDBServiceIsConnectableById
// swagger:model
type CheckDBServiceIsConnectableByIdReq struct {
// project id
// Required: true
// in:path
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// db service uid
// in:path
DBServiceUid string `param:"db_service_uid" json:"db_service_uid" validate:"required"`
}

Expand All @@ -138,18 +125,12 @@ func (u *DelDBServiceReq) String() string {
return fmt.Sprintf("DelDBServiceReq{Uid:%s}", u.DBServiceUid)
}

// swagger:parameters UpdateDBService
// swagger:model
type UpdateDBServiceReq struct {
// project id
// Required: true
// in:path
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// db_service_uid
// Required: true
// in:path
// swagger:ignore
DBServiceUid string `param:"db_service_uid" json:"db_service_uid" validate:"required"`
// Update a DB service
// in:body
DBService *UpdateDBService `json:"db_service" validate:"required"`
}

Expand Down Expand Up @@ -315,14 +296,10 @@ type ImportDBService struct {
IsEnableMasking bool `json:"is_enable_masking"`
}

// swagger:parameters ImportDBServicesOfOneProject
// swagger:model
type ImportDBServicesOfOneProjectReq struct {
// project id
// Required: true
// in:path
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// new db services
// in:body
DBServices []ImportDBService `json:"db_services" validate:"required"`
}

Expand Down
Loading

0 comments on commit bdbb282

Please sign in to comment.