contract_undertaker_feedback_controller.go
5.6 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
package controllers
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/contractUndertakerFeedback/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/contractUndertakerFeedback/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application/contractUndertakerFeedback/service"
)
type ContractUndertakerFeedbackController struct {
BaseController
}
func (controller *ContractUndertakerFeedbackController) CreateContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
createContractUndertakerFeedbackCommand := &command.CreateContractUndertakerFeedbackCommand{}
_ = controller.Unmarshal(createContractUndertakerFeedbackCommand)
header := controller.GetRequestHeader(controller.Ctx)
createContractUndertakerFeedbackCommand.CompanyId = header.CompanyId
createContractUndertakerFeedbackCommand.OrgId = header.OrgId
createContractUndertakerFeedbackCommand.UserId = header.UserId
createContractUndertakerFeedbackCommand.UserBaseId = header.UserBaseId
data, err := contractUndertakerFeedbackService.CreateContractUndertakerFeedback(createContractUndertakerFeedbackCommand)
controller.Response(data, err)
}
func (controller *ContractUndertakerFeedbackController) UpdateContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
updateContractUndertakerFeedbackCommand := &command.UpdateContractUndertakerFeedbackCommand{}
_ = controller.Unmarshal(updateContractUndertakerFeedbackCommand)
header := controller.GetRequestHeader(controller.Ctx)
updateContractUndertakerFeedbackCommand.CompanyId = header.CompanyId
updateContractUndertakerFeedbackCommand.OrgId = header.OrgId
updateContractUndertakerFeedbackCommand.UserId = header.UserId
updateContractUndertakerFeedbackCommand.UserBaseId = header.UserBaseId
contractUndertakerFeedbackId := controller.GetString(":contractUndertakerFeedbackId")
updateContractUndertakerFeedbackCommand.FeedbackId = contractUndertakerFeedbackId
data, err := contractUndertakerFeedbackService.UpdateContractUndertakerFeedback(updateContractUndertakerFeedbackCommand)
controller.Response(data, err)
}
func (controller *ContractUndertakerFeedbackController) GetContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
getContractUndertakerFeedbackQuery := &query.GetContractUndertakerFeedbackQuery{}
header := controller.GetRequestHeader(controller.Ctx)
getContractUndertakerFeedbackQuery.CompanyId = header.CompanyId
getContractUndertakerFeedbackQuery.OrgId = header.OrgId
getContractUndertakerFeedbackQuery.UserId = header.UserId
getContractUndertakerFeedbackQuery.UserBaseId = header.UserBaseId
contractUndertakerFeedbackId := controller.GetString(":contractUndertakerFeedbackId")
getContractUndertakerFeedbackQuery.FeedbackId = contractUndertakerFeedbackId
data, err := contractUndertakerFeedbackService.GetContractUndertakerFeedback(getContractUndertakerFeedbackQuery)
controller.Response(data, err)
}
func (controller *ContractUndertakerFeedbackController) RemoveContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
removeContractUndertakerFeedbackCommand := &command.RemoveContractUndertakerFeedbackCommand{}
_ = controller.Unmarshal(removeContractUndertakerFeedbackCommand)
header := controller.GetRequestHeader(controller.Ctx)
removeContractUndertakerFeedbackCommand.CompanyId = header.CompanyId
removeContractUndertakerFeedbackCommand.OrgId = header.OrgId
removeContractUndertakerFeedbackCommand.UserId = header.UserId
removeContractUndertakerFeedbackCommand.UserBaseId = header.UserBaseId
contractUndertakerFeedbackId := controller.GetString(":contractUndertakerFeedbackId")
removeContractUndertakerFeedbackCommand.FeedbackId = contractUndertakerFeedbackId
data, err := contractUndertakerFeedbackService.RemoveContractUndertakerFeedback(removeContractUndertakerFeedbackCommand)
controller.Response(data, err)
}
func (controller *ContractUndertakerFeedbackController) SearchContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
searchContractUndertakerFeedbackQuery := &query.SearchContractUndertakerFeedbackQuery{}
_ = controller.Unmarshal(searchContractUndertakerFeedbackQuery)
data, err := contractUndertakerFeedbackService.SearchContractUndertakerFeedback(searchContractUndertakerFeedbackQuery)
controller.Response(data, err)
}
func (controller *ContractUndertakerFeedbackController) ListContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
listContractUndertakerFeedbackQuery := &query.ListContractUndertakerFeedbackQuery{}
header := controller.GetRequestHeader(controller.Ctx)
listContractUndertakerFeedbackQuery.CompanyId = header.CompanyId
listContractUndertakerFeedbackQuery.OrgId = header.OrgId
listContractUndertakerFeedbackQuery.UserId = header.UserId
listContractUndertakerFeedbackQuery.UserBaseId = header.UserBaseId
pageSize, _ := controller.GetInt64("pageSize")
listContractUndertakerFeedbackQuery.PageSize = pageSize
pageNumber, _ := controller.GetInt64("pageNumber")
listContractUndertakerFeedbackQuery.PageNumber = pageNumber
underTakerUid := controller.GetString(":underTakerUid")
listContractUndertakerFeedbackQuery.UnderTakerUid = underTakerUid
data, err := contractUndertakerFeedbackService.ListContractUndertakerFeedback(listContractUndertakerFeedbackQuery)
controller.Response(data, err)
}