cooperation_contract_change_log_controller.go
5.7 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
package controllers
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/cooperationContractChangeLog/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/cooperationContractChangeLog/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/cooperationContractChangeLog/service"
)
type CooperationContractChangeLogController struct {
BaseController
}
func (controller *CooperationContractChangeLogController) CreateCooperationContractChangeLog() {
cooperationContractChangeLogService := service.NewCooperationContractChangeLogService(nil)
createCooperationContractChangeLogCommand := &command.CreateCooperationContractChangeLogCommand{}
_ = controller.Unmarshal(createCooperationContractChangeLogCommand)
header := controller.GetRequestHeader(controller.Ctx)
createCooperationContractChangeLogCommand.CompanyId = header.CompanyId
createCooperationContractChangeLogCommand.OrgId = header.OrgId
createCooperationContractChangeLogCommand.UserId = header.UserId
createCooperationContractChangeLogCommand.UserBaseId = header.UserBaseId
data, err := cooperationContractChangeLogService.CreateCooperationContractChangeLog(createCooperationContractChangeLogCommand)
controller.Response(data, err)
}
func (controller *CooperationContractChangeLogController) UpdateCooperationContractChangeLog() {
cooperationContractChangeLogService := service.NewCooperationContractChangeLogService(nil)
updateCooperationContractChangeLogCommand := &command.UpdateCooperationContractChangeLogCommand{}
_ = controller.Unmarshal(updateCooperationContractChangeLogCommand)
header := controller.GetRequestHeader(controller.Ctx)
updateCooperationContractChangeLogCommand.CompanyId = header.CompanyId
updateCooperationContractChangeLogCommand.OrgId = header.OrgId
updateCooperationContractChangeLogCommand.UserId = header.UserId
updateCooperationContractChangeLogCommand.UserBaseId = header.UserBaseId
cooperationContractChangeLogId, _ := controller.GetInt64(":cooperationContractChangeLogId")
updateCooperationContractChangeLogCommand.CooperationContractChangeLogId = cooperationContractChangeLogId
data, err := cooperationContractChangeLogService.UpdateCooperationContractChangeLog(updateCooperationContractChangeLogCommand)
controller.Response(data, err)
}
func (controller *CooperationContractChangeLogController) GetCooperationContractChangeLog() {
cooperationContractChangeLogService := service.NewCooperationContractChangeLogService(nil)
getCooperationContractChangeLogQuery := &query.GetCooperationContractChangeLogQuery{}
header := controller.GetRequestHeader(controller.Ctx)
getCooperationContractChangeLogQuery.CompanyId = header.CompanyId
getCooperationContractChangeLogQuery.OrgId = header.OrgId
getCooperationContractChangeLogQuery.UserId = header.UserId
getCooperationContractChangeLogQuery.UserBaseId = header.UserBaseId
cooperationContractChangeLogId, _ := controller.GetInt64(":cooperationContractChangeLogId")
getCooperationContractChangeLogQuery.CooperationContractChangeLogId = cooperationContractChangeLogId
data, err := cooperationContractChangeLogService.GetCooperationContractChangeLog(getCooperationContractChangeLogQuery)
controller.Response(data, err)
}
func (controller *CooperationContractChangeLogController) RemoveCooperationContractChangeLog() {
cooperationContractChangeLogService := service.NewCooperationContractChangeLogService(nil)
removeCooperationContractChangeLogCommand := &command.RemoveCooperationContractChangeLogCommand{}
_ = controller.Unmarshal(removeCooperationContractChangeLogCommand)
header := controller.GetRequestHeader(controller.Ctx)
removeCooperationContractChangeLogCommand.CompanyId = header.CompanyId
removeCooperationContractChangeLogCommand.OrgId = header.OrgId
removeCooperationContractChangeLogCommand.UserId = header.UserId
removeCooperationContractChangeLogCommand.UserBaseId = header.UserBaseId
cooperationContractChangeLogId, _ := controller.GetInt64(":cooperationContractChangeLogId")
removeCooperationContractChangeLogCommand.CooperationContractChangeLogId = cooperationContractChangeLogId
data, err := cooperationContractChangeLogService.RemoveCooperationContractChangeLog(removeCooperationContractChangeLogCommand)
controller.Response(data, err)
}
func (controller *CooperationContractChangeLogController) ListCooperationContractChangeLog() {
cooperationContractChangeLogService := service.NewCooperationContractChangeLogService(nil)
listCooperationContractChangeLogQuery := &query.ListCooperationContractChangeLogQuery{}
header := controller.GetRequestHeader(controller.Ctx)
listCooperationContractChangeLogQuery.CompanyId = header.CompanyId
listCooperationContractChangeLogQuery.OrgId = header.OrgId
listCooperationContractChangeLogQuery.UserId = header.UserId
listCooperationContractChangeLogQuery.UserBaseId = header.UserBaseId
pageSize, _ := controller.GetInt64("pageSize")
listCooperationContractChangeLogQuery.PageSize = pageSize
pageNumber, _ := controller.GetInt64("pageNumber")
listCooperationContractChangeLogQuery.PageNumber = pageNumber
data, err := cooperationContractChangeLogService.ListCooperationContractChangeLog(listCooperationContractChangeLogQuery)
controller.Response(data, err)
}
func (controller *CooperationContractChangeLogController) SearchCooperationContractChangeLog() {
cooperationContractChangeLogService := service.NewCooperationContractChangeLogService(nil)
searchCooperationContractChangeLogQuery := &query.SearchCooperationContractChangeLogQuery{}
_ = controller.Unmarshal(searchCooperationContractChangeLogQuery)
data, err := cooperationContractChangeLogService.SearchCooperationContractChangeLog(searchCooperationContractChangeLogQuery)
controller.Response(data, err)
}