cooperation_application_controller.go
2.4 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
package web_client
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationApplication/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type CooperationApplicationController struct {
baseController
}
func (controller *CooperationApplicationController) GetCooperationApplication() {
cooperationApplicationService := service.NewCooperationApplicationService(nil)
getCooperationApplicationQuery := &query.GetCooperationApplicationQuery{}
applicationId, _ := controller.GetInt(":applicationId")
getCooperationApplicationQuery.CooperationApplicationId = applicationId
getCooperationApplicationQuery.Operator = controller.GetOperator()
data, err := cooperationApplicationService.GetCooperationApplication(getCooperationApplicationQuery)
controller.Response(data, err)
}
func (controller *CooperationApplicationController) ListCooperationApplication() {
cooperationApplicationService := service.NewCooperationApplicationService(nil)
listCooperationApplicationQuery := &query.ListCooperationApplicationQuery{}
err := controller.Unmarshal(listCooperationApplicationQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
listCooperationApplicationQuery.Operator = controller.GetOperator()
cnt, data, err := cooperationApplicationService.ListCooperationApplication(listCooperationApplicationQuery)
controller.ReturnPageListData(cnt, data, err, listCooperationApplicationQuery.PageNumber)
}
func (controller *CooperationApplicationController) AuditCooperationApplication() {
cooperationApplicationService := service.NewCooperationApplicationService(nil)
auditCooperationApplicationCommand := &command.AuditCooperationApplicationCommand{}
err := controller.Unmarshal(auditCooperationApplicationCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
controller.Response(nil, err)
return
}
auditCooperationApplicationCommand.Operator = controller.GetOperator()
data, err := cooperationApplicationService.AuditCooperationApplication(auditCooperationApplicationCommand)
controller.Response(data, err)
}