dividends_estimate_controller.go
9.5 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
package controllers
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/dividendsEstimate/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/dividendsEstimate/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/dividendsEstimate/service"
)
type DividendsEstimateController struct {
BaseController
}
func (controller *DividendsEstimateController) CreateDividendsEstimate() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
createDividendsEstimateCommand := &command.CreateDividendsEstimateCommand{}
_ = controller.Unmarshal(createDividendsEstimateCommand)
header := controller.GetRequestHeader(controller.Ctx)
createDividendsEstimateCommand.CompanyId = header.CompanyId
createDividendsEstimateCommand.OrgId = header.OrgId
createDividendsEstimateCommand.UserId = header.UserId
createDividendsEstimateCommand.UserBaseId = header.UserBaseId
data, err := dividendsEstimateService.CreateDividendsEstimate(createDividendsEstimateCommand)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) UpdateDividendsEstimate() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
updateDividendsEstimateCommand := &command.UpdateDividendsEstimateCommand{}
_ = controller.Unmarshal(updateDividendsEstimateCommand)
header := controller.GetRequestHeader(controller.Ctx)
updateDividendsEstimateCommand.CompanyId = header.CompanyId
updateDividendsEstimateCommand.OrgId = header.OrgId
updateDividendsEstimateCommand.UserId = header.UserId
updateDividendsEstimateCommand.UserBaseId = header.UserBaseId
dividendsEstimateId, _ := controller.GetInt64(":dividendsEstimateId")
updateDividendsEstimateCommand.DividendsEstimateId = dividendsEstimateId
data, err := dividendsEstimateService.UpdateDividendsEstimate(updateDividendsEstimateCommand)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) GetDividendsEstimate() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
getDividendsEstimateQuery := &query.GetDividendsEstimateQuery{}
header := controller.GetRequestHeader(controller.Ctx)
getDividendsEstimateQuery.CompanyId = header.CompanyId
getDividendsEstimateQuery.OrgId = header.OrgId
getDividendsEstimateQuery.UserId = header.UserId
getDividendsEstimateQuery.UserBaseId = header.UserBaseId
dividendsEstimateId := controller.GetString(":dividendsEstimateId")
getDividendsEstimateQuery.DividendsEstimateId = dividendsEstimateId
data, err := dividendsEstimateService.GetDividendsEstimate(getDividendsEstimateQuery)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) RemoveDividendsEstimate() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
removeDividendsEstimateCommand := &command.RemoveDividendsEstimateCommand{}
_ = controller.Unmarshal(removeDividendsEstimateCommand)
header := controller.GetRequestHeader(controller.Ctx)
removeDividendsEstimateCommand.CompanyId = header.CompanyId
removeDividendsEstimateCommand.OrgId = header.OrgId
removeDividendsEstimateCommand.UserId = header.UserId
removeDividendsEstimateCommand.UserBaseId = header.UserBaseId
dividendsEstimateId, _ := controller.GetInt64(":dividendsEstimateId")
removeDividendsEstimateCommand.DividendsEstimateId = dividendsEstimateId
data, err := dividendsEstimateService.RemoveDividendsEstimate(removeDividendsEstimateCommand)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) CancelDividendsEstimate() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
cancelDividendsEstimateCommand := &command.CancelDividendsEstimateCommand{}
_ = controller.Unmarshal(cancelDividendsEstimateCommand)
header := controller.GetRequestHeader(controller.Ctx)
cancelDividendsEstimateCommand.CompanyId = header.CompanyId
cancelDividendsEstimateCommand.OrgId = header.OrgId
cancelDividendsEstimateCommand.UserId = header.UserId
cancelDividendsEstimateCommand.UserBaseId = header.UserBaseId
dividendsEstimateId := controller.GetString(":dividendsEstimateId")
cancelDividendsEstimateCommand.DividendsEstimateId = dividendsEstimateId
data, err := dividendsEstimateService.CancelDividendsEstimate(cancelDividendsEstimateCommand)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) SearchDividendsEstimate() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
searchDividendsEstimateQuery := &query.SearchDividendsEstimateQuery{}
// 解析头部信息
header := controller.GetRequestHeader(controller.Ctx)
searchDividendsEstimateQuery.CompanyId = header.CompanyId
searchDividendsEstimateQuery.OrgId = header.OrgId
searchDividendsEstimateQuery.UserId = header.UserId
searchDividendsEstimateQuery.UserBaseId = header.UserBaseId
data, err := dividendsEstimateService.SearchDividendsEstimate(searchDividendsEstimateQuery)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) EstimateDividendsIncentives() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
estimateDividendsIncentivesCommand := &command.ConfirmDividendsIncentivesEstimateCommand{}
_ = controller.Unmarshal(estimateDividendsIncentivesCommand)
header := controller.GetRequestHeader(controller.Ctx)
estimateDividendsIncentivesCommand.CompanyId = header.CompanyId
estimateDividendsIncentivesCommand.OrgId = header.OrgId
estimateDividendsIncentivesCommand.UserId = header.UserId
estimateDividendsIncentivesCommand.UserBaseId = header.UserBaseId
data, err := dividendsEstimateService.EstimateDividendsIncentives(estimateDividendsIncentivesCommand)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) EstimateMoneyIncentives() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
estimateMoneyIncentivesCommand := &command.ConfirmMoneyIncentivesEstimateCommand{}
_ = controller.Unmarshal(estimateMoneyIncentivesCommand)
header := controller.GetRequestHeader(controller.Ctx)
estimateMoneyIncentivesCommand.CompanyId = header.CompanyId
estimateMoneyIncentivesCommand.OrgId = header.OrgId
estimateMoneyIncentivesCommand.UserId = header.UserId
estimateMoneyIncentivesCommand.UserBaseId = header.UserBaseId
data, err := dividendsEstimateService.EstimateMoneyIncentives(estimateMoneyIncentivesCommand)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) ListMoneyIncentives() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
listMoneyIncentivesQuery := &query.ListMoneyIncentivesEstimateQuery{}
header := controller.GetRequestHeader(controller.Ctx)
listMoneyIncentivesQuery.CompanyId = header.CompanyId
listMoneyIncentivesQuery.OrgId = header.OrgId
listMoneyIncentivesQuery.UserId = header.UserId
listMoneyIncentivesQuery.UserBaseId = header.UserBaseId
data, err := dividendsEstimateService.ListMoneyIncentives(listMoneyIncentivesQuery)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) SearchMoneyIncentives() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
searchMoneyIncentivesQuery := &query.SearchMoneyIncentivesEstimateQuery{}
header := controller.GetRequestHeader(controller.Ctx)
searchMoneyIncentivesQuery.CompanyId = header.CompanyId
searchMoneyIncentivesQuery.OrgId = header.OrgId
searchMoneyIncentivesQuery.UserId = header.UserId
searchMoneyIncentivesQuery.UserBaseId = header.UserBaseId
data, err := dividendsEstimateService.SearchMoneyIncentives(searchMoneyIncentivesQuery)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) ListDividendsIncentives() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
listDividendsIncentivesQuery := &query.ListDividendsIncentivesEstimateQuery{}
header := controller.GetRequestHeader(controller.Ctx)
listDividendsIncentivesQuery.CompanyId = header.CompanyId
listDividendsIncentivesQuery.OrgId = header.OrgId
listDividendsIncentivesQuery.UserId = header.UserId
listDividendsIncentivesQuery.UserBaseId = header.UserBaseId
data, err := dividendsEstimateService.ListDividendsIncentives(listDividendsIncentivesQuery)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) SearchDividendsIncentives() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
searchDividendsIncentivesQuery := &query.SearchDividendsIncentivesEstimateQuery{}
header := controller.GetRequestHeader(controller.Ctx)
searchDividendsIncentivesQuery.CompanyId = header.CompanyId
searchDividendsIncentivesQuery.OrgId = header.OrgId
searchDividendsIncentivesQuery.UserId = header.UserId
searchDividendsIncentivesQuery.UserBaseId = header.UserBaseId
data, err := dividendsEstimateService.SearchDividendsIncentives(searchDividendsIncentivesQuery)
controller.Response(data, err)
}
func (controller *DividendsEstimateController) ListDividendsEstimate() {
dividendsEstimateService := service.NewDividendsEstimateService(nil)
listDividendsEstimateQuery := &query.ListDividendsEstimateQuery{}
header := controller.GetRequestHeader(controller.Ctx)
listDividendsEstimateQuery.CompanyId = header.CompanyId
listDividendsEstimateQuery.OrgId = header.OrgId
listDividendsEstimateQuery.UserId = header.UserId
listDividendsEstimateQuery.UserBaseId = header.UserBaseId
pageSize, _ := controller.GetInt64("pageSize")
listDividendsEstimateQuery.PageSize = pageSize
pageNumber, _ := controller.GetInt64("pageNumber")
listDividendsEstimateQuery.PageNumber = pageNumber
data, err := dividendsEstimateService.ListDividendsEstimate(listDividendsEstimateQuery)
controller.Response(data, err)
}