Skip to content

Commit

Permalink
Merge pull request #324 from actiontech/sqle-ce-2752
Browse files Browse the repository at this point in the history
Sqle ce 2752
  • Loading branch information
iwanghc authored Nov 14, 2024
2 parents b07791e + 7ab1802 commit 9a60649
Show file tree
Hide file tree
Showing 7 changed files with 527 additions and 12 deletions.
51 changes: 41 additions & 10 deletions api/dms/service/v1/db_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

base "github.com/actiontech/dms/pkg/dms-common/api/base/v1"
"github.com/go-openapi/strfmt"

dmsCommonV1 "github.com/actiontech/dms/pkg/dms-common/api/dms/v1"
)
Expand Down Expand Up @@ -53,9 +54,9 @@ type DBService struct {

// swagger:model AddDBServiceReq
type AddDBServiceReq struct {
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
DBService *DBService `json:"db_service" validate:"required"`
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
DBService *DBService `json:"db_service" validate:"required"`
}

func (u *AddDBServiceReq) String() string {
Expand Down Expand Up @@ -87,8 +88,8 @@ func (u *AddDBServiceReply) String() string {
// swagger:model
type CheckDBServiceIsConnectableReq struct {
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
DBService dmsCommonV1.CheckDbConnectable `json:"db_service"`
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
DBService dmsCommonV1.CheckDbConnectable `json:"db_service"`
}

type CheckDBServiceIsConnectableReplyItem struct {
Expand All @@ -104,9 +105,29 @@ type CheckDBServiceIsConnectableReply struct {
base.GenericResp
}

// swagger:model
type CheckDBServicesIsConnectableReq struct {
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
DBServices []DbServiceConnections `json:"db_services"`
}

// swagger:model CheckDBServicesIsConnectableReply
type CheckDBServicesIsConnectableReply struct {
Data []DBServiceIsConnectableReply `json:"data"`
base.GenericResp
}

type DBServiceIsConnectableReply struct {
DBServiceUid string `param:"db_service_uid" json:"db_service_uid"`
ConnectionStatus string `json:"connection_status"`
TestConnectionTime strfmt.DateTime `json:"test_connection_time"`
ConnectErrorMessage string `json:"connect_error_message"`
}

// swagger:model
type CheckDBServiceIsConnectableByIdReq struct {
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
DBServiceUid string `param:"db_service_uid" json:"db_service_uid" validate:"required"`
}

Expand All @@ -133,8 +154,8 @@ type UpdateDBServiceReq struct {
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// swagger:ignore
DBServiceUid string `param:"db_service_uid" json:"db_service_uid" validate:"required"`
DBService *UpdateDBService `json:"db_service" validate:"required"`
DBServiceUid string `param:"db_service_uid" json:"db_service_uid" validate:"required"`
DBService *UpdateDBService `json:"db_service" validate:"required"`
}

func (u *UpdateDBServiceReq) String() string {
Expand Down Expand Up @@ -304,8 +325,8 @@ type ImportDBService struct {

// swagger:model
type ImportDBServicesOfOneProjectReq struct {
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
// swagger:ignore
ProjectUid string `param:"project_uid" json:"project_uid" validate:"required"`
DBServices []ImportDBService `json:"db_services" validate:"required"`
}

Expand All @@ -329,6 +350,10 @@ type ListGlobalDBServicesReq struct {
// Multiple of ["name"], default is ["name"]
// in:query
OrderBy dmsCommonV1.DBServiceOrderByField `query:"order_by" json:"order_by"`
// the db service connection
// enum: connect_success,connect_failed
// in:query
FilterLastConnectionTestStatus *string `query:"filter_last_connection_test_status" json:"filter_last_connection_test_status" validate:"omitempty,oneof=connect_success connect_failed"`
// the db service business name
// in:query
FilterByBusiness string `query:"filter_by_business" json:"filter_by_business"`
Expand Down Expand Up @@ -399,6 +424,12 @@ type ListGlobalDBService struct {
UnfinishedWorkflowNum int64 `json:"unfinished_workflow_num"`
// backup switch
EnableBackup bool `json:"enable_backup"`
// DB connection test time
LastConnectionTestTime strfmt.DateTime `json:"last_connection_test_time"`
// DB connect test status
LastConnectionTestStatus string `json:"last_connection_test_status"`
// DB connect test error message
LastConnectionTestErrorMessage string `json:"last_connection_test_error_message,omitempty"`
}

// swagger:model ListGlobalDBServicesTipsReply
Expand Down
15 changes: 15 additions & 0 deletions api/dms/service/v1/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,21 @@ type DBServiceConnectionReq struct {
DBServices []CheckDbsConnectable `json:"db_services"`
}

// swagger:model
type DBServicesConnectionReq struct {
DBServices []DbServiceConnections `json:"db_services"`
}

type DbServiceConnections struct {
DBServiceUid string `param:"db_service_uid" json:"db_service_uid"`
}

// swagger:model DBServicesConnectionReqReply
type DBServicesConnectionReqReply struct {
Data []DBServiceIsConnectableReply `json:"data"`
base.GenericResp
}

type DBServicesConnectionItem struct {
// Successful connection num
SuccessfulNum int `json:"successful_num"`
Expand Down
Loading

0 comments on commit 9a60649

Please sign in to comment.