正在显示
29 个修改的文件
包含
316 行增加
和
82 行删除
@@ -29,7 +29,7 @@ type CreateCompanyCommand struct { | @@ -29,7 +29,7 @@ type CreateCompanyCommand struct { | ||
29 | } | 29 | } |
30 | 30 | ||
31 | func (createCompanyCommand *CreateCompanyCommand) Valid(validation *validation.Validation) { | 31 | func (createCompanyCommand *CreateCompanyCommand) Valid(validation *validation.Validation) { |
32 | - validation.SetError("CustomValid", "未实现的自定义认证") | 32 | + |
33 | } | 33 | } |
34 | 34 | ||
35 | func (createCompanyCommand *CreateCompanyCommand) ValidateCommand() error { | 35 | func (createCompanyCommand *CreateCompanyCommand) ValidateCommand() error { |
@@ -19,7 +19,7 @@ type AuditCooperationApplicationCommand struct { | @@ -19,7 +19,7 @@ type AuditCooperationApplicationCommand struct { | ||
19 | } | 19 | } |
20 | 20 | ||
21 | func (auditCooperationApplicationCommand *AuditCooperationApplicationCommand) Valid(validation *validation.Validation) { | 21 | func (auditCooperationApplicationCommand *AuditCooperationApplicationCommand) Valid(validation *validation.Validation) { |
22 | - validation.SetError("CustomValid", "未实现的自定义认证") | 22 | + |
23 | } | 23 | } |
24 | 24 | ||
25 | func (auditCooperationApplicationCommand *AuditCooperationApplicationCommand) ValidateCommand() error { | 25 | func (auditCooperationApplicationCommand *AuditCooperationApplicationCommand) ValidateCommand() error { |
@@ -16,7 +16,7 @@ type GetCooperationApplicationQuery struct { | @@ -16,7 +16,7 @@ type GetCooperationApplicationQuery struct { | ||
16 | } | 16 | } |
17 | 17 | ||
18 | func (getCooperationApplicationQuery *GetCooperationApplicationQuery) Valid(validation *validation.Validation) { | 18 | func (getCooperationApplicationQuery *GetCooperationApplicationQuery) Valid(validation *validation.Validation) { |
19 | - validation.SetError("CustomValid", "未实现的自定义认证") | 19 | + |
20 | } | 20 | } |
21 | 21 | ||
22 | func (getCooperationApplicationQuery *GetCooperationApplicationQuery) ValidateQuery() error { | 22 | func (getCooperationApplicationQuery *GetCooperationApplicationQuery) ValidateQuery() error { |
@@ -85,7 +85,7 @@ type CreateCooperationContractCommand struct { | @@ -85,7 +85,7 @@ type CreateCooperationContractCommand struct { | ||
85 | } | 85 | } |
86 | 86 | ||
87 | func (createCooperationContractCommand *CreateCooperationContractCommand) Valid(validation *validation.Validation) { | 87 | func (createCooperationContractCommand *CreateCooperationContractCommand) Valid(validation *validation.Validation) { |
88 | - validation.SetError("CustomValid", "未实现的自定义认证") | 88 | + |
89 | } | 89 | } |
90 | 90 | ||
91 | func (createCooperationContractCommand *CreateCooperationContractCommand) ValidateCommand() error { | 91 | func (createCooperationContractCommand *CreateCooperationContractCommand) ValidateCommand() error { |
@@ -86,7 +86,7 @@ type UpdateCooperationContractCommand struct { | @@ -86,7 +86,7 @@ type UpdateCooperationContractCommand struct { | ||
86 | } | 86 | } |
87 | 87 | ||
88 | func (updateCooperationContractCommand *UpdateCooperationContractCommand) Valid(validation *validation.Validation) { | 88 | func (updateCooperationContractCommand *UpdateCooperationContractCommand) Valid(validation *validation.Validation) { |
89 | - validation.SetError("CustomValid", "未实现的自定义认证") | 89 | + |
90 | } | 90 | } |
91 | 91 | ||
92 | func (updateCooperationContractCommand *UpdateCooperationContractCommand) ValidateCommand() error { | 92 | func (updateCooperationContractCommand *UpdateCooperationContractCommand) ValidateCommand() error { |
@@ -8,7 +8,7 @@ import ( | @@ -8,7 +8,7 @@ import ( | ||
8 | 8 | ||
9 | type GetCooperationContractQuery struct { | 9 | type GetCooperationContractQuery struct { |
10 | // 共创合约ID | 10 | // 共创合约ID |
11 | - CooperationContractId int64 `json:"cooperationContractId" valid:"Required"` | 11 | + CooperationContractId int `json:"cooperationContractId" valid:"Required"` |
12 | } | 12 | } |
13 | 13 | ||
14 | func (getCooperationContractQuery *GetCooperationContractQuery) Valid(validation *validation.Validation) { | 14 | func (getCooperationContractQuery *GetCooperationContractQuery) Valid(validation *validation.Validation) { |
@@ -27,7 +27,7 @@ func (cooperationModeService *CooperationModeService) CreateCooperationMode(crea | @@ -27,7 +27,7 @@ func (cooperationModeService *CooperationModeService) CreateCooperationMode(crea | ||
27 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 27 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
28 | } | 28 | } |
29 | data := struct { | 29 | data := struct { |
30 | - CooperationModeId int `json:"cooperationModeId,string," valid:"Required"` | 30 | + CooperationModeId int `json:"cooperationModeId,string,"` |
31 | command.CreateCooperationModeCommand | 31 | command.CreateCooperationModeCommand |
32 | }{ | 32 | }{ |
33 | CooperationModeId: result.CooperationModeId, | 33 | CooperationModeId: result.CooperationModeId, |
@@ -2,6 +2,7 @@ package command | @@ -2,6 +2,7 @@ package command | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | + | ||
5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" |
6 | 7 | ||
7 | "github.com/beego/beego/v2/core/validation" | 8 | "github.com/beego/beego/v2/core/validation" |
@@ -17,7 +18,7 @@ type MenuFavoriteCommand struct { | @@ -17,7 +18,7 @@ type MenuFavoriteCommand struct { | ||
17 | } | 18 | } |
18 | 19 | ||
19 | func (menuFavoriteCommand *MenuFavoriteCommand) Valid(validation *validation.Validation) { | 20 | func (menuFavoriteCommand *MenuFavoriteCommand) Valid(validation *validation.Validation) { |
20 | - validation.SetError("CustomValid", "未实现的自定义认证") | 21 | + |
21 | } | 22 | } |
22 | 23 | ||
23 | func (menuFavoriteCommand *MenuFavoriteCommand) ValidateCommand() error { | 24 | func (menuFavoriteCommand *MenuFavoriteCommand) ValidateCommand() error { |
@@ -22,7 +22,7 @@ type MenuUpdateCommand struct { | @@ -22,7 +22,7 @@ type MenuUpdateCommand struct { | ||
22 | } | 22 | } |
23 | 23 | ||
24 | func (menuUpdateQuery *MenuUpdateCommand) Valid(validation *validation.Validation) { | 24 | func (menuUpdateQuery *MenuUpdateCommand) Valid(validation *validation.Validation) { |
25 | - validation.SetError("CustomValid", "未实现的自定义认证") | 25 | + |
26 | } | 26 | } |
27 | 27 | ||
28 | func (menuUpdateQuery *MenuUpdateCommand) ValidateQuery() error { | 28 | func (menuUpdateQuery *MenuUpdateCommand) ValidateQuery() error { |
@@ -15,7 +15,7 @@ type RemoveDividendsOrderCommand struct { | @@ -15,7 +15,7 @@ type RemoveDividendsOrderCommand struct { | ||
15 | } | 15 | } |
16 | 16 | ||
17 | func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) Valid(validation *validation.Validation) { | 17 | func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) Valid(validation *validation.Validation) { |
18 | - validation.SetError("CustomValid", "未实现的自定义认证") | 18 | + |
19 | } | 19 | } |
20 | 20 | ||
21 | func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) ValidateCommand() error { | 21 | func (removeDividendsOrderCommand *RemoveDividendsOrderCommand) ValidateCommand() error { |
@@ -15,7 +15,7 @@ type GetDividendsOrderQuery struct { | @@ -15,7 +15,7 @@ type GetDividendsOrderQuery struct { | ||
15 | } | 15 | } |
16 | 16 | ||
17 | func (getDividendsOrderQuery *GetDividendsOrderQuery) Valid(validation *validation.Validation) { | 17 | func (getDividendsOrderQuery *GetDividendsOrderQuery) Valid(validation *validation.Validation) { |
18 | - validation.SetError("CustomValid", "未实现的自定义认证") | 18 | + |
19 | } | 19 | } |
20 | 20 | ||
21 | func (getDividendsOrderQuery *GetDividendsOrderQuery) ValidateQuery() error { | 21 | func (getDividendsOrderQuery *GetDividendsOrderQuery) ValidateQuery() error { |
@@ -14,7 +14,7 @@ type ListDividendsOrdersQuery struct { | @@ -14,7 +14,7 @@ type ListDividendsOrdersQuery struct { | ||
14 | } | 14 | } |
15 | 15 | ||
16 | func (listDividendsOrdersQuery *ListDividendsOrdersQuery) Valid(validation *validation.Validation) { | 16 | func (listDividendsOrdersQuery *ListDividendsOrdersQuery) Valid(validation *validation.Validation) { |
17 | - validation.SetError("CustomValid", "未实现的自定义认证") | 17 | + |
18 | } | 18 | } |
19 | 19 | ||
20 | func (listDividendsOrdersQuery *ListDividendsOrdersQuery) ValidateQuery() error { | 20 | func (listDividendsOrdersQuery *ListDividendsOrdersQuery) ValidateQuery() error { |
@@ -21,7 +21,7 @@ type SearchDividendsOrderQuery struct { | @@ -21,7 +21,7 @@ type SearchDividendsOrderQuery struct { | ||
21 | } | 21 | } |
22 | 22 | ||
23 | func (searchDividendsOrderQuery *SearchDividendsOrderQuery) Valid(validation *validation.Validation) { | 23 | func (searchDividendsOrderQuery *SearchDividendsOrderQuery) Valid(validation *validation.Validation) { |
24 | - validation.SetError("CustomValid", "未实现的自定义认证") | 24 | + |
25 | } | 25 | } |
26 | 26 | ||
27 | func (searchDividendsOrderQuery *SearchDividendsOrderQuery) ValidateQuery() error { | 27 | func (searchDividendsOrderQuery *SearchDividendsOrderQuery) ValidateQuery() error { |
@@ -67,7 +67,6 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide | @@ -67,7 +67,6 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDivide | ||
67 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 67 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
68 | } | 68 | } |
69 | return updateDividendsReturnedOrderCommand, nil | 69 | return updateDividendsReturnedOrderCommand, nil |
70 | - | ||
71 | } | 70 | } |
72 | 71 | ||
73 | func NewDividendsReturnedOrderService(options map[string]interface{}) *DividendsReturnedOrderService { | 72 | func NewDividendsReturnedOrderService(options map[string]interface{}) *DividendsReturnedOrderService { |
@@ -15,7 +15,7 @@ type OrgGetQuery struct { | @@ -15,7 +15,7 @@ type OrgGetQuery struct { | ||
15 | } | 15 | } |
16 | 16 | ||
17 | func (orgGetQuery *OrgGetQuery) Valid(validation *validation.Validation) { | 17 | func (orgGetQuery *OrgGetQuery) Valid(validation *validation.Validation) { |
18 | - validation.SetError("CustomValid", "未实现的自定义认证") | 18 | + |
19 | } | 19 | } |
20 | 20 | ||
21 | func (orgGetQuery *OrgGetQuery) ValidateQuery() error { | 21 | func (orgGetQuery *OrgGetQuery) ValidateQuery() error { |
@@ -2,6 +2,7 @@ package query | @@ -2,6 +2,7 @@ package query | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | + | ||
5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" |
6 | 7 | ||
7 | "github.com/beego/beego/v2/core/validation" | 8 | "github.com/beego/beego/v2/core/validation" |
@@ -15,7 +16,7 @@ type RoleMenuBeforeEditQuery struct { | @@ -15,7 +16,7 @@ type RoleMenuBeforeEditQuery struct { | ||
15 | } | 16 | } |
16 | 17 | ||
17 | func (roleMenuBeforeEditQuery *RoleMenuBeforeEditQuery) Valid(validation *validation.Validation) { | 18 | func (roleMenuBeforeEditQuery *RoleMenuBeforeEditQuery) Valid(validation *validation.Validation) { |
18 | - validation.SetError("CustomValid", "未实现的自定义认证") | 19 | + |
19 | } | 20 | } |
20 | 21 | ||
21 | func (roleMenuBeforeEditQuery *RoleMenuBeforeEditQuery) ValidateQuery() error { | 22 | func (roleMenuBeforeEditQuery *RoleMenuBeforeEditQuery) ValidateQuery() error { |
@@ -2,6 +2,7 @@ package query | @@ -2,6 +2,7 @@ package query | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "fmt" | 4 | "fmt" |
5 | + | ||
5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" | 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" |
6 | 7 | ||
7 | "github.com/beego/beego/v2/core/validation" | 8 | "github.com/beego/beego/v2/core/validation" |
@@ -15,7 +16,7 @@ type RoleUserBeforeEditQuery struct { | @@ -15,7 +16,7 @@ type RoleUserBeforeEditQuery struct { | ||
15 | } | 16 | } |
16 | 17 | ||
17 | func (roleUserBeforeEditQuery *RoleUserBeforeEditQuery) Valid(validation *validation.Validation) { | 18 | func (roleUserBeforeEditQuery *RoleUserBeforeEditQuery) Valid(validation *validation.Validation) { |
18 | - //validation.SetError("CustomValid", "未实现的自定义认证") | 19 | + |
19 | } | 20 | } |
20 | 21 | ||
21 | func (roleUserBeforeEditQuery *RoleUserBeforeEditQuery) ValidateQuery() error { | 22 | func (roleUserBeforeEditQuery *RoleUserBeforeEditQuery) ValidateQuery() error { |
@@ -15,7 +15,7 @@ type RoleUserInfoQuery struct { | @@ -15,7 +15,7 @@ type RoleUserInfoQuery struct { | ||
15 | } | 15 | } |
16 | 16 | ||
17 | func (roleUserInfoQuery *RoleUserInfoQuery) Valid(validation *validation.Validation) { | 17 | func (roleUserInfoQuery *RoleUserInfoQuery) Valid(validation *validation.Validation) { |
18 | - validation.SetError("CustomValid", "未实现的自定义认证") | 18 | + |
19 | } | 19 | } |
20 | 20 | ||
21 | func (roleUserInfoQuery *RoleUserInfoQuery) ValidateQuery() error { | 21 | func (roleUserInfoQuery *RoleUserInfoQuery) ValidateQuery() error { |
@@ -33,7 +33,7 @@ type CompanyUserAddCommand struct { | @@ -33,7 +33,7 @@ type CompanyUserAddCommand struct { | ||
33 | } | 33 | } |
34 | 34 | ||
35 | func (companyUserAddCommand *CompanyUserAddCommand) Valid(validation *validation.Validation) { | 35 | func (companyUserAddCommand *CompanyUserAddCommand) Valid(validation *validation.Validation) { |
36 | - validation.SetError("CustomValid", "未实现的自定义认证") | 36 | + |
37 | } | 37 | } |
38 | 38 | ||
39 | func (companyUserAddCommand *CompanyUserAddCommand) ValidateCommand() error { | 39 | func (companyUserAddCommand *CompanyUserAddCommand) ValidateCommand() error { |
@@ -17,7 +17,7 @@ type CompanyUserEnableCommand struct { | @@ -17,7 +17,7 @@ type CompanyUserEnableCommand struct { | ||
17 | } | 17 | } |
18 | 18 | ||
19 | func (companyUserEnableCommand *CompanyUserEnableCommand) Valid(validation *validation.Validation) { | 19 | func (companyUserEnableCommand *CompanyUserEnableCommand) Valid(validation *validation.Validation) { |
20 | - validation.SetError("CustomValid", "未实现的自定义认证") | 20 | + |
21 | } | 21 | } |
22 | 22 | ||
23 | func (companyUserEnableCommand *CompanyUserEnableCommand) ValidateCommand() error { | 23 | func (companyUserEnableCommand *CompanyUserEnableCommand) ValidateCommand() error { |
@@ -14,7 +14,7 @@ type CompanyUserResetPasswordCommand struct { | @@ -14,7 +14,7 @@ type CompanyUserResetPasswordCommand struct { | ||
14 | } | 14 | } |
15 | 15 | ||
16 | func (companyUserResetPasswordCommand *CompanyUserResetPasswordCommand) Valid(validation *validation.Validation) { | 16 | func (companyUserResetPasswordCommand *CompanyUserResetPasswordCommand) Valid(validation *validation.Validation) { |
17 | - validation.SetError("CustomValid", "未实现的自定义认证") | 17 | + |
18 | } | 18 | } |
19 | 19 | ||
20 | func (companyUserResetPasswordCommand *CompanyUserResetPasswordCommand) ValidateCommand() error { | 20 | func (companyUserResetPasswordCommand *CompanyUserResetPasswordCommand) ValidateCommand() error { |
@@ -42,7 +42,7 @@ type Role struct { | @@ -42,7 +42,7 @@ type Role struct { | ||
42 | } | 42 | } |
43 | 43 | ||
44 | func (companyUserUpdateCommand *CompanyUserUpdateCommand) Valid(validation *validation.Validation) { | 44 | func (companyUserUpdateCommand *CompanyUserUpdateCommand) Valid(validation *validation.Validation) { |
45 | - validation.SetError("CustomValid", "未实现的自定义认证") | 45 | + |
46 | } | 46 | } |
47 | 47 | ||
48 | func (companyUserUpdateCommand *CompanyUserUpdateCommand) ValidateCommand() error { | 48 | func (companyUserUpdateCommand *CompanyUserUpdateCommand) ValidateCommand() error { |
@@ -196,3 +196,35 @@ func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderGet(param | @@ -196,3 +196,35 @@ func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderGet(param | ||
196 | err = gateway.GetResponseData(result, &data) | 196 | err = gateway.GetResponseData(result, &data) |
197 | return &data, err | 197 | return &data, err |
198 | } | 198 | } |
199 | + | ||
200 | +// DividendsReturnedOrderBatchRemove 批量移除分红退货单 | ||
201 | +func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderBatchRemove(param ReqDividendsReturnedOrderRemove) ( | ||
202 | + *DataDividendsReturnedOrderRemove, error) { | ||
203 | + url := gateway.baseUrL + "/dividends-returned-orders/batch-remove" | ||
204 | + method := "POST" | ||
205 | + req := gateway.CreateRequest(url, method) | ||
206 | + log.Logger.Debug("向业务模块请求数据:批量移除分红退货单。", map[string]interface{}{ | ||
207 | + "api": method + ":" + url, | ||
208 | + "param": param, | ||
209 | + }) | ||
210 | + req, err := req.JSONBody(param) | ||
211 | + if err != nil { | ||
212 | + return nil, fmt.Errorf("请求批量移除分红退货单失败:%w", err) | ||
213 | + } | ||
214 | + | ||
215 | + byteResult, err := req.Bytes() | ||
216 | + if err != nil { | ||
217 | + return nil, fmt.Errorf("获取批量移除分红退货单失败:%w", err) | ||
218 | + } | ||
219 | + log.Logger.Debug("获取业务模块请求数据:批量移除分红退货单。", map[string]interface{}{ | ||
220 | + "result": string(byteResult), | ||
221 | + }) | ||
222 | + var result service_gateway.GatewayResponse | ||
223 | + err = json.Unmarshal(byteResult, &result) | ||
224 | + if err != nil { | ||
225 | + return nil, fmt.Errorf("解析移除分红退货单:%w", err) | ||
226 | + } | ||
227 | + var data DataDividendsReturnedOrderRemove | ||
228 | + err = gateway.GetResponseData(result, &data) | ||
229 | + return &data, err | ||
230 | +} |
1 | +package web_client | ||
2 | + | ||
3 | +import ( | ||
4 | + "github.com/linmadan/egglib-go/web/beego" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/command" | ||
6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/query" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/service" | ||
8 | +) | ||
9 | + | ||
10 | +type CooperationContractController struct { | ||
11 | + beego.BaseController | ||
12 | +} | ||
13 | + | ||
14 | +func (controller *CooperationContractController) CreateCooperationContract() { | ||
15 | + cooperationContractService := service.NewCooperationContractService(nil) | ||
16 | + createCooperationContractCommand := &command.CreateCooperationContractCommand{} | ||
17 | + controller.Unmarshal(createCooperationContractCommand) | ||
18 | + data, err := cooperationContractService.CreateCooperationContract(createCooperationContractCommand) | ||
19 | + controller.Response(data, err) | ||
20 | +} | ||
21 | + | ||
22 | +func (controller *CooperationContractController) UpdateCooperationContract() { | ||
23 | + cooperationContractService := service.NewCooperationContractService(nil) | ||
24 | + updateCooperationContractCommand := &command.UpdateCooperationContractCommand{} | ||
25 | + controller.Unmarshal(updateCooperationContractCommand) | ||
26 | + contractId, _ := controller.GetInt(":contractId") | ||
27 | + updateCooperationContractCommand.CooperationContract.CooperationContractId = contractId | ||
28 | + data, err := cooperationContractService.UpdateCooperationContract(updateCooperationContractCommand) | ||
29 | + controller.Response(data, err) | ||
30 | +} | ||
31 | + | ||
32 | +func (controller *CooperationContractController) GetCooperationContract() { | ||
33 | + cooperationContractService := service.NewCooperationContractService(nil) | ||
34 | + getCooperationContractQuery := &query.GetCooperationContractQuery{} | ||
35 | + contractId, _ := controller.GetInt(":contractId") | ||
36 | + getCooperationContractQuery.CooperationContractId = contractId | ||
37 | + data, err := cooperationContractService.GetCooperationContract(getCooperationContractQuery) | ||
38 | + controller.Response(data, err) | ||
39 | +} | ||
40 | + | ||
41 | +func (controller *CooperationContractController) ListCooperationContract() { | ||
42 | + cooperationContractService := service.NewCooperationContractService(nil) | ||
43 | + listCooperationContractQuery := &query.ListCooperationContractQuery{} | ||
44 | + data, err := cooperationContractService.ListCooperationContract(listCooperationContractQuery) | ||
45 | + controller.Response(data, err) | ||
46 | +} | ||
47 | + | ||
48 | +func (controller *CooperationContractController) EnableCooperationContract() { | ||
49 | + cooperationContractService := service.NewCooperationContractService(nil) | ||
50 | + enableCooperationContractCommand := &command.EnableCooperationContractCommand{} | ||
51 | + controller.Unmarshal(enableCooperationContractCommand) | ||
52 | + data, err := cooperationContractService.EnableCooperationContract(enableCooperationContractCommand) | ||
53 | + controller.Response(data, err) | ||
54 | +} |
@@ -4,7 +4,7 @@ import ( | @@ -4,7 +4,7 @@ import ( | ||
4 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationMode/command" | 4 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationMode/command" |
5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationMode/query" | 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationMode/query" |
6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationMode/service" | 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationMode/service" |
7 | - "strconv" | 7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" |
8 | ) | 8 | ) |
9 | 9 | ||
10 | type CooperationModeController struct { | 10 | type CooperationModeController struct { |
@@ -12,85 +12,59 @@ type CooperationModeController struct { | @@ -12,85 +12,59 @@ type CooperationModeController struct { | ||
12 | } | 12 | } |
13 | 13 | ||
14 | func (controller *CooperationModeController) CreateCooperationMode() { | 14 | func (controller *CooperationModeController) CreateCooperationMode() { |
15 | - svr := service.CooperationModeService{} | ||
16 | - cmd := &command.CreateCooperationModeCommand{} | ||
17 | - err := controller.Unmarshal(cmd) | 15 | + cooperationModeService := service.NewCooperationModeService(nil) |
16 | + createCooperationModeCommand := &command.CreateCooperationModeCommand{} | ||
17 | + err := controller.Unmarshal(createCooperationModeCommand) | ||
18 | if err != nil { | 18 | if err != nil { |
19 | - controller.Response(nil, err) | ||
20 | - return | 19 | + log.Logger.Debug("json err:" + err.Error()) |
21 | } | 20 | } |
22 | - cmd.Operator = controller.GetOperator() | ||
23 | - data, err := svr.CreateCooperationMode(cmd) | 21 | + createCooperationModeCommand.Operator = controller.GetOperator() |
22 | + data, err := cooperationModeService.CreateCooperationMode(createCooperationModeCommand) | ||
24 | controller.Response(data, err) | 23 | controller.Response(data, err) |
25 | } | 24 | } |
26 | 25 | ||
27 | func (controller *CooperationModeController) UpdateCooperationMode() { | 26 | func (controller *CooperationModeController) UpdateCooperationMode() { |
28 | - svr := service.CooperationModeService{} | ||
29 | - cmd := &command.UpdateCooperationModeCommand{} | ||
30 | - err := controller.Unmarshal(cmd) | 27 | + cooperationModeService := service.NewCooperationModeService(nil) |
28 | + updateCooperationModeCommand := &command.UpdateCooperationModeCommand{} | ||
29 | + err := controller.Unmarshal(updateCooperationModeCommand) | ||
31 | if err != nil { | 30 | if err != nil { |
32 | - controller.Response(nil, err) | ||
33 | - return | 31 | + log.Logger.Debug("json err:" + err.Error()) |
34 | } | 32 | } |
35 | - cooperationModeId := controller.GetString(":cooperationModeId") | ||
36 | - cmd.CooperationModeId, _ = strconv.Atoi(cooperationModeId) | ||
37 | - cmd.Operator = controller.GetOperator() | ||
38 | - data, err := svr.UpdateCooperationMode(cmd) | 33 | + modeId, _ := controller.GetInt(":modeId") |
34 | + updateCooperationModeCommand.Operator = controller.GetOperator() | ||
35 | + updateCooperationModeCommand.CooperationModeId = modeId | ||
36 | + data, err := cooperationModeService.UpdateCooperationMode(updateCooperationModeCommand) | ||
39 | controller.Response(data, err) | 37 | controller.Response(data, err) |
40 | } | 38 | } |
41 | 39 | ||
42 | func (controller *CooperationModeController) GetCooperationMode() { | 40 | func (controller *CooperationModeController) GetCooperationMode() { |
43 | - svr := service.CooperationModeService{} | ||
44 | - cmd := &query.GetCooperationModeQuery{} | ||
45 | - err := controller.Unmarshal(cmd) | ||
46 | - if err != nil { | ||
47 | - controller.Response(nil, err) | ||
48 | - return | ||
49 | - } | ||
50 | - cooperationModeId := controller.GetString(":cooperationModeId") | ||
51 | - cmd.CooperationModeId, _ = strconv.Atoi(cooperationModeId) | ||
52 | - cmd.Operator = controller.GetOperator() | ||
53 | - data, err := svr.GetCooperationMode(cmd) | 41 | + cooperationModeService := service.NewCooperationModeService(nil) |
42 | + getCooperationModeQuery := &query.GetCooperationModeQuery{} | ||
43 | + modeId, _ := controller.GetInt(":modeId") | ||
44 | + getCooperationModeQuery.CooperationModeId = modeId | ||
45 | + getCooperationModeQuery.Operator = controller.GetOperator() | ||
46 | + data, err := cooperationModeService.GetCooperationMode(getCooperationModeQuery) | ||
54 | controller.Response(data, err) | 47 | controller.Response(data, err) |
55 | } | 48 | } |
56 | 49 | ||
57 | func (controller *CooperationModeController) RemoveCooperationMode() { | 50 | func (controller *CooperationModeController) RemoveCooperationMode() { |
58 | - svr := service.CooperationModeService{} | ||
59 | - cmd := &command.RemoveCooperationModeCommand{} | ||
60 | - err := controller.Unmarshal(cmd) | ||
61 | - if err != nil { | ||
62 | - controller.Response(nil, err) | ||
63 | - return | ||
64 | - } | ||
65 | - cooperationModeId := controller.GetString(":cooperationModeId") | ||
66 | - cmd.CooperationModeId, _ = strconv.Atoi(cooperationModeId) | ||
67 | - cmd.Operator = controller.GetOperator() | ||
68 | - data, err := svr.RemoveCooperationMode(cmd) | 51 | + cooperationModeService := service.NewCooperationModeService(nil) |
52 | + removeCooperationModeCommand := &command.RemoveCooperationModeCommand{} | ||
53 | + modeId, _ := controller.GetInt(":modeId") | ||
54 | + removeCooperationModeCommand.Operator = controller.GetOperator() | ||
55 | + removeCooperationModeCommand.CooperationModeId = modeId | ||
56 | + data, err := cooperationModeService.RemoveCooperationMode(removeCooperationModeCommand) | ||
69 | controller.Response(data, err) | 57 | controller.Response(data, err) |
70 | } | 58 | } |
71 | 59 | ||
72 | -func (controller *CooperationModeController) SearchCooperationMode() { | ||
73 | - svr := service.CooperationModeService{} | ||
74 | - cmd := &query.ListCooperationModeQuery{} | ||
75 | - err := controller.Unmarshal(cmd) | ||
76 | - if err != nil { | ||
77 | - controller.Response(nil, err) | ||
78 | - return | ||
79 | - } | ||
80 | - cmd.Operator = controller.GetOperator() | ||
81 | - cnt, data, err := svr.ListCooperationMode(cmd) | ||
82 | - controller.returnPageListData(cnt, data, err, cmd.PageNumber) | ||
83 | -} | ||
84 | - | ||
85 | func (controller *CooperationModeController) ListCooperationMode() { | 60 | func (controller *CooperationModeController) ListCooperationMode() { |
86 | - svr := service.CooperationModeService{} | ||
87 | - cmd := &query.ListCooperationModeQuery{} | ||
88 | - err := controller.Unmarshal(cmd) | 61 | + cooperationModeService := service.NewCooperationModeService(nil) |
62 | + listCooperationModeQuery := &query.ListCooperationModeQuery{} | ||
63 | + err := controller.Unmarshal(listCooperationModeQuery) | ||
89 | if err != nil { | 64 | if err != nil { |
90 | - controller.Response(nil, err) | ||
91 | - return | 65 | + log.Logger.Debug("json err:" + err.Error()) |
92 | } | 66 | } |
93 | - cmd.Operator = controller.GetOperator() | ||
94 | - _, data, err := svr.ListCooperationMode(cmd) | ||
95 | - controller.Response(data, err) | 67 | + listCooperationModeQuery.Operator = controller.GetOperator() |
68 | + cnt, data, err := cooperationModeService.ListCooperationMode(listCooperationModeQuery) | ||
69 | + controller.returnPageListData(cnt, data, err, listCooperationModeQuery.PageNumber) | ||
96 | } | 70 | } |
1 | +package web_client | ||
2 | + | ||
3 | +import ( | ||
4 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/command" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/query" | ||
6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/service" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" | ||
8 | +) | ||
9 | + | ||
10 | +type DividendsOrderController struct { | ||
11 | + baseController | ||
12 | +} | ||
13 | + | ||
14 | +func (controller *DividendsOrderController) CreateDividendsOrder() { | ||
15 | + dividendsOrderService := service.NewDividendsOrderService(nil) | ||
16 | + createDividendsOrderCommand := &command.CreateDividendsOrderCommand{} | ||
17 | + err := controller.Unmarshal(createDividendsOrderCommand) | ||
18 | + if err != nil { | ||
19 | + log.Logger.Debug("json err:" + err.Error()) | ||
20 | + } | ||
21 | + data, err := dividendsOrderService.CreateDividendsOrder(createDividendsOrderCommand) | ||
22 | + controller.Response(data, err) | ||
23 | +} | ||
24 | + | ||
25 | +func (controller *DividendsOrderController) UpdateDividendsOrder() { | ||
26 | + dividendsOrderService := service.NewDividendsOrderService(nil) | ||
27 | + updateDividendsOrderCommand := &command.UpdateDividendsOrderCommand{} | ||
28 | + err := controller.Unmarshal(updateDividendsOrderCommand) | ||
29 | + if err != nil { | ||
30 | + log.Logger.Debug("json err:" + err.Error()) | ||
31 | + } | ||
32 | + orderId, _ := controller.GetInt(":orderId") | ||
33 | + updateDividendsOrderCommand.DividendsOrderID = orderId | ||
34 | + data, err := dividendsOrderService.UpdateDividendsOrder(updateDividendsOrderCommand) | ||
35 | + controller.Response(data, err) | ||
36 | +} | ||
37 | + | ||
38 | +func (controller *DividendsOrderController) RemoveDividendsOrder() { | ||
39 | + dividendsOrderService := service.NewDividendsOrderService(nil) | ||
40 | + removeDividendsOrderCommand := &command.RemoveDividendsOrderCommand{} | ||
41 | + err := controller.Unmarshal(removeDividendsOrderCommand) | ||
42 | + if err != nil { | ||
43 | + log.Logger.Debug("json err:" + err.Error()) | ||
44 | + } | ||
45 | + removeDividendsOrderCommand.Operator = controller.GetOperator() | ||
46 | + data, err := dividendsOrderService.RemoveDividendsOrder(removeDividendsOrderCommand) | ||
47 | + controller.Response(data, err) | ||
48 | +} | ||
49 | + | ||
50 | +func (controller *DividendsOrderController) GetDividendsOrder() { | ||
51 | + dividendsOrderService := service.NewDividendsOrderService(nil) | ||
52 | + getDividendsOrderQuery := &query.GetDividendsOrderQuery{} | ||
53 | + orderId, _ := controller.GetInt(":orderId") | ||
54 | + getDividendsOrderQuery.DividendsOrderId = orderId | ||
55 | + getDividendsOrderQuery.Operator = controller.GetOperator() | ||
56 | + data, err := dividendsOrderService.GetDividendsOrder(getDividendsOrderQuery) | ||
57 | + controller.Response(data, err) | ||
58 | +} | ||
59 | + | ||
60 | +func (controller *DividendsOrderController) SearchDividendsOrder() { | ||
61 | + dividendsOrderService := service.NewDividendsOrderService(nil) | ||
62 | + searchDividendsOrderQuery := &query.SearchDividendsOrderQuery{} | ||
63 | + err := controller.Unmarshal(searchDividendsOrderQuery) | ||
64 | + if err != nil { | ||
65 | + log.Logger.Debug("json err:" + err.Error()) | ||
66 | + } | ||
67 | + searchDividendsOrderQuery.Operator = controller.GetOperator() | ||
68 | + cnt, data, err := dividendsOrderService.SearchDividendsOrder(searchDividendsOrderQuery) | ||
69 | + controller.returnPageListData(int64(cnt), data, err, searchDividendsOrderQuery.PageNumber) | ||
70 | +} |
1 | +package web_client | ||
2 | + | ||
3 | +import ( | ||
4 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/query" | ||
6 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/service" | ||
7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" | ||
8 | +) | ||
9 | + | ||
10 | +type DividendsReturnedOrderController struct { | ||
11 | + baseController | ||
12 | +} | ||
13 | + | ||
14 | +func (controller *DividendsReturnedOrderController) CreateDividendsReturnedOrder() { | ||
15 | + dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil) | ||
16 | + createDividendsReturnedOrderCommand := &command.CreateDividendsReturnedOrderCommand{} | ||
17 | + err := controller.Unmarshal(createDividendsReturnedOrderCommand) | ||
18 | + if err != nil { | ||
19 | + log.Logger.Debug("json err:" + err.Error()) | ||
20 | + } | ||
21 | + createDividendsReturnedOrderCommand.Operator = controller.GetOperator() | ||
22 | + data, err := dividendsReturnedOrderService.CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand) | ||
23 | + controller.Response(data, err) | ||
24 | +} | ||
25 | + | ||
26 | +func (controller *DividendsReturnedOrderController) UpdateDividendsReturnedOrder() { | ||
27 | + dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil) | ||
28 | + updateDividendsReturnedOrderCommand := &command.UpdateDividendsReturnedOrderCommand{} | ||
29 | + err := controller.Unmarshal(updateDividendsReturnedOrderCommand) | ||
30 | + if err != nil { | ||
31 | + log.Logger.Debug("json err:" + err.Error()) | ||
32 | + } | ||
33 | + projectId, _ := controller.GetInt(":projectId") | ||
34 | + updateDividendsReturnedOrderCommand.DividendsReturnedOrderID = projectId | ||
35 | + updateDividendsReturnedOrderCommand.Operator = controller.GetOperator() | ||
36 | + data, err := dividendsReturnedOrderService.UpdateDividendsReturnedOrder(updateDividendsReturnedOrderCommand) | ||
37 | + controller.Response(data, err) | ||
38 | +} | ||
39 | + | ||
40 | +func (controller *DividendsReturnedOrderController) RemoveDividendsReturnedOrder() { | ||
41 | + dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil) | ||
42 | + removeDividendsReturnedOrderCommand := &command.RemoveDividendsReturnedOrderCommand{} | ||
43 | + err := controller.Unmarshal(removeDividendsReturnedOrderCommand) | ||
44 | + if err != nil { | ||
45 | + log.Logger.Debug("json err:" + err.Error()) | ||
46 | + } | ||
47 | + projectId, _ := controller.GetInt(":projectId") | ||
48 | + removeDividendsReturnedOrderCommand.DividendsReturnedOrderID = projectId | ||
49 | + removeDividendsReturnedOrderCommand.Operator = controller.GetOperator() | ||
50 | + data, err := dividendsReturnedOrderService.RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand) | ||
51 | + controller.Response(data, err) | ||
52 | +} | ||
53 | + | ||
54 | +func (controller *DividendsReturnedOrderController) GetDividendsReturnedOrder() { | ||
55 | + dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil) | ||
56 | + getDividendsReturnedOrderQuery := &query.GetDividendsReturnedOrderQuery{} | ||
57 | + projectId, _ := controller.GetInt(":projectId") | ||
58 | + getDividendsReturnedOrderQuery.DividendsReturnedOrderID = projectId | ||
59 | + getDividendsReturnedOrderQuery.Operator = controller.GetOperator() | ||
60 | + data, err := dividendsReturnedOrderService.GetDividendsReturnedOrder(getDividendsReturnedOrderQuery) | ||
61 | + controller.Response(data, err) | ||
62 | +} | ||
63 | + | ||
64 | +func (controller *DividendsReturnedOrderController) SearchDividendsReturnedOrder() { | ||
65 | + dividendsReturnedOrderService := service.NewDividendsReturnedOrderService(nil) | ||
66 | + searchDividendsReturnedOrderQuery := &query.SearchDividendsReturnedOrderQuery{} | ||
67 | + err := controller.Unmarshal(searchDividendsReturnedOrderQuery) | ||
68 | + if err != nil { | ||
69 | + log.Logger.Debug("json err:" + err.Error()) | ||
70 | + } | ||
71 | + searchDividendsReturnedOrderQuery.Operator = controller.GetOperator() | ||
72 | + cnt, data, err := dividendsReturnedOrderService.SearchDividendsReturnedOrder(searchDividendsReturnedOrderQuery) | ||
73 | + controller.returnPageListData(int64(cnt), data, err, searchDividendsReturnedOrderQuery.PageNumber) | ||
74 | +} |
1 | +package routers | ||
2 | + | ||
3 | +import ( | ||
4 | + "github.com/beego/beego/v2/server/web" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client" | ||
6 | +) | ||
7 | + | ||
8 | +func init() { | ||
9 | + web.Router("/v1/web/cooperation-modes/", &web_client.CooperationModeController{}, "Post:CreateCooperationMode") | ||
10 | + web.Router("/v1/web/cooperation-modes/:modeId", &web_client.CooperationModeController{}, "Put:UpdateCooperationMode") | ||
11 | + web.Router("/v1/web/cooperation-modes/:modeId", &web_client.CooperationModeController{}, "Get:GetCooperationMode") | ||
12 | + web.Router("/v1/web/cooperation-modes/:modeId", &web_client.CooperationModeController{}, "Delete:RemoveCooperationMode") | ||
13 | + web.Router("/v1/web/cooperation-modes/search", &web_client.CooperationModeController{}, "Post:ListCooperationMode") | ||
14 | +} |
1 | +package routers | ||
2 | + | ||
3 | +import ( | ||
4 | + "github.com/beego/beego/v2/server/web" | ||
5 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client" | ||
6 | +) | ||
7 | + | ||
8 | +func init() { | ||
9 | + web.Router("/v1/web/dividends-returned-order/", &web_client.DividendsReturnedOrderController{}, "Post:CreateDividendsReturnedOrder") | ||
10 | + web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Put:UpdateDividendsReturnedOrder") | ||
11 | + web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Delete:RemoveDividendsReturnedOrder") | ||
12 | + web.Router("/v1/web/dividends-returned-order/:projectId", &web_client.DividendsReturnedOrderController{}, "Get:GetDividendsReturnedOrder") | ||
13 | + web.Router("/v1/web/dividends-returned-order/search", &web_client.DividendsReturnedOrderController{}, "Post:SearchDividendsReturnedOrder") | ||
14 | +} |
-
请 注册 或 登录 后发表评论