dividends_order_controller.go
6.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package controllers
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/dividendsOrder/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/dividendsOrder/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/dividendsOrder/service"
)
type DividendsOrderController struct {
BaseController
}
func (controller *DividendsOrderController) CreateDividendsOrder() {
dividendsOrderService := service.NewDividendsOrderService(nil)
createDividendsOrderCommand := &command.CreateDividendsOrderCommand{}
_ = controller.Unmarshal(createDividendsOrderCommand)
header := controller.GetRequestHeader(controller.Ctx)
createDividendsOrderCommand.CompanyId = header.CompanyId
createDividendsOrderCommand.OrgId = header.OrgId
createDividendsOrderCommand.UserId = header.UserId
createDividendsOrderCommand.UserBaseId = header.UserBaseId
data, err := dividendsOrderService.CreateDividendsOrder(createDividendsOrderCommand)
controller.Response(data, err)
}
func (controller *DividendsOrderController) UpdateDividendsOrder() {
dividendsOrderService := service.NewDividendsOrderService(nil)
updateDividendsOrderCommand := &command.UpdateDividendsOrderCommand{}
_ = controller.Unmarshal(updateDividendsOrderCommand)
header := controller.GetRequestHeader(controller.Ctx)
updateDividendsOrderCommand.CompanyId = header.CompanyId
updateDividendsOrderCommand.OrgId = header.OrgId
updateDividendsOrderCommand.UserId = header.UserId
updateDividendsOrderCommand.UserBaseId = header.UserBaseId
dividendsOrderId := controller.GetString(":dividendsOrderId")
updateDividendsOrderCommand.DividendsOrderId = dividendsOrderId
data, err := dividendsOrderService.UpdateDividendsOrder(updateDividendsOrderCommand)
controller.Response(data, err)
}
func (controller *DividendsOrderController) GetDividendsOrder() {
dividendsOrderService := service.NewDividendsOrderService(nil)
getDividendsOrderQuery := &query.GetDividendsOrderQuery{}
header := controller.GetRequestHeader(controller.Ctx)
getDividendsOrderQuery.CompanyId = header.CompanyId
getDividendsOrderQuery.OrgId = header.OrgId
getDividendsOrderQuery.UserId = header.UserId
getDividendsOrderQuery.UserBaseId = header.UserBaseId
dividendsOrderId, _ := controller.GetInt64(":dividendsOrderId")
getDividendsOrderQuery.DividendsOrderId = dividendsOrderId
data, err := dividendsOrderService.GetDividendsOrder(getDividendsOrderQuery)
controller.Response(data, err)
}
func (controller *DividendsOrderController) RemoveDividendsOrder() {
dividendsOrderService := service.NewDividendsOrderService(nil)
removeDividendsOrderCommand := &command.RemoveDividendsOrderCommand{}
_ = controller.Unmarshal(removeDividendsOrderCommand)
header := controller.GetRequestHeader(controller.Ctx)
removeDividendsOrderCommand.CompanyId = header.CompanyId
removeDividendsOrderCommand.OrgId = header.OrgId
removeDividendsOrderCommand.UserId = header.UserId
removeDividendsOrderCommand.UserBaseId = header.UserBaseId
dividendsOrderId := controller.GetString(":dividendsOrderId")
removeDividendsOrderCommand.DividendsOrderId = dividendsOrderId
data, err := dividendsOrderService.RemoveDividendsOrder(removeDividendsOrderCommand)
controller.Response(data, err)
}
func (controller *DividendsOrderController) BatchRemoveDividendsOrder() {
dividendsOrderService := service.NewDividendsOrderService(nil)
batchRemoveDividendsOrderCommand := &command.BatchRemoveDividendsOrderCommand{}
_ = controller.Unmarshal(batchRemoveDividendsOrderCommand)
header := controller.GetRequestHeader(controller.Ctx)
batchRemoveDividendsOrderCommand.CompanyId = header.CompanyId
batchRemoveDividendsOrderCommand.OrgId = header.OrgId
batchRemoveDividendsOrderCommand.UserId = header.UserId
batchRemoveDividendsOrderCommand.UserBaseId = header.UserBaseId
data, err := dividendsOrderService.BatchRemoveDividendsOrder(batchRemoveDividendsOrderCommand)
controller.Response(data, err)
}
func (controller *DividendsOrderController) SearchDividendsOrder() {
dividendsOrderService := service.NewDividendsOrderService(nil)
searchDividendsOrderQuery := &query.SearchDividendsOrderQuery{}
_ = controller.Unmarshal(searchDividendsOrderQuery)
header := controller.GetRequestHeader(controller.Ctx)
searchDividendsOrderQuery.CompanyId = header.CompanyId
searchDividendsOrderQuery.OrgId = header.OrgId
searchDividendsOrderQuery.UserId = header.UserId
searchDividendsOrderQuery.UserBaseId = header.UserBaseId
data, err := dividendsOrderService.SearchDividendsOrder(searchDividendsOrderQuery)
controller.Response(data, err)
}
func (controller *DividendsOrderController) SearchDividendsOrderNumber() {
dividendsOrderService := service.NewDividendsOrderService(nil)
searchDividendsOrderNumberQuery := &query.SearchDividendsOrderNumberQuery{}
_ = controller.Unmarshal(searchDividendsOrderNumberQuery)
header := controller.GetRequestHeader(controller.Ctx)
searchDividendsOrderNumberQuery.CompanyId = header.CompanyId
searchDividendsOrderNumberQuery.OrgId = header.OrgId
searchDividendsOrderNumberQuery.UserId = header.UserId
searchDividendsOrderNumberQuery.UserBaseId = header.UserBaseId
data, err := dividendsOrderService.SearchDividendsOrderNumber(searchDividendsOrderNumberQuery)
controller.Response(data, err)
}
func (controller *DividendsOrderController) ListDividendsOrders() {
dividendsOrderService := service.NewDividendsOrderService(nil)
listDividendsOrdersQuery := &query.ListDividendsOrdersQuery{}
header := controller.GetRequestHeader(controller.Ctx)
listDividendsOrdersQuery.CompanyId = header.CompanyId
listDividendsOrdersQuery.OrgId = header.OrgId
listDividendsOrdersQuery.UserId = header.UserId
listDividendsOrdersQuery.UserBaseId = header.UserBaseId
pageSize, _ := controller.GetInt64("pageSize")
listDividendsOrdersQuery.PageSize = pageSize
pageNumber, _ := controller.GetInt64("pageNumber")
listDividendsOrdersQuery.PageNumber = pageNumber
data, err := dividendsOrderService.ListDividendsOrders(listDividendsOrdersQuery)
controller.Response(data, err)
}