cooperation_controller.go
3.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
package mobile_client
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/mobile/cooperation/service"
)
// Controller
type CooperationController struct {
baseController
}
/***** CompanyDividends 企业端分红 *****/
func (controller *CooperationController) GetDividendContracts() {
svr := service.CompanyStatisticsService{}
cmd := &command.GetDividendContractsCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.GetDividendContracts(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) DividendsStatistics() {
svr := service.CompanyStatisticsService{}
cmd := &command.DividendsStatisticsCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.DividendsStatistics(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) SearchDividendsEstimates() {
svr := service.CompanyStatisticsService{}
cmd := &command.SearchDividendsEstimatesCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.SearchDividendsEstimates(cmd)
controller.Response(data, err)
}
/***** CompanyStatistics 企业端统计 *****/
func (controller *CooperationController) IndexStatistics() {
svr := service.CompanyStatisticsService{}
cmd := &command.IndexStatisticsCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.IndexStatistics(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) CooperationPersonStatistics() {
svr := service.CompanyStatisticsService{}
cmd := &command.CooperationPersonStatisticsCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.CooperationPersonStatistics(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) GoodsStatistics() {
svr := service.CompanyStatisticsService{}
cmd := &command.GoodsStatisticsCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.GoodsStatistics(cmd)
controller.Response(data, err)
}
func (controller *CooperationController) CooperationDividendsStatistics() {
svr := service.CompanyStatisticsService{}
cmd := &command.CooperationDividendsStatisticsCommand{}
err := controller.Unmarshal(cmd)
if err != nil {
controller.Response(nil, err)
return
}
cmd.Operator = controller.GetOperator()
data, err := svr.CooperationDividendsStatistics(cmd)
controller.Response(data, err)
}