contract_undertaker_feedback_controller.go
3.9 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
package controllers
import (
"github.com/linmadan/egglib-go/web/beego"
"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 {
beego.BaseController
}
func (controller *ContractUndertakerFeedbackController) CreateContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
createContractUndertakerFeedbackCommand := &command.CreateContractUndertakerFeedbackCommand{}
controller.Unmarshal(createContractUndertakerFeedbackCommand)
data, err := contractUndertakerFeedbackService.CreateContractUndertakerFeedback(createContractUndertakerFeedbackCommand)
controller.Response(data, err)
}
func (controller *ContractUndertakerFeedbackController) UpdateContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
updateContractUndertakerFeedbackCommand := &command.UpdateContractUndertakerFeedbackCommand{}
controller.Unmarshal(updateContractUndertakerFeedbackCommand)
contractUndertakerFeedbackId, _ := controller.GetString(":contractUndertakerFeedbackId")
updateContractUndertakerFeedbackCommand.ContractUndertakerFeedbackId = contractUndertakerFeedbackId
data, err := contractUndertakerFeedbackService.UpdateContractUndertakerFeedback(updateContractUndertakerFeedbackCommand)
controller.Response(data, err)
}
func (controller *ContractUndertakerFeedbackController) GetContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
getContractUndertakerFeedbackQuery := &query.GetContractUndertakerFeedbackQuery{}
contractUndertakerFeedbackId, _ := controller.GetString(":contractUndertakerFeedbackId")
getContractUndertakerFeedbackQuery.ContractUndertakerFeedbackId = contractUndertakerFeedbackId
data, err := contractUndertakerFeedbackService.GetContractUndertakerFeedback(getContractUndertakerFeedbackQuery)
controller.Response(data, err)
}
func (controller *ContractUndertakerFeedbackController) RemoveContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
removeContractUndertakerFeedbackCommand := &command.RemoveContractUndertakerFeedbackCommand{}
controller.Unmarshal(removeContractUndertakerFeedbackCommand)
contractUndertakerFeedbackId, _ := controller.GetString(":contractUndertakerFeedbackId")
removeContractUndertakerFeedbackCommand.ContractUndertakerFeedbackId = contractUndertakerFeedbackId
data, err := contractUndertakerFeedbackService.RemoveContractUndertakerFeedback(removeContractUndertakerFeedbackCommand)
controller.Response(data, err)
}
func (controller *ContractUndertakerFeedbackController) SearchContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
searchContractUndertakerFeedbackQuery := &query.SearchContractUndertakerFeedbackQuery{}
data, err := contractUndertakerFeedbackService.SearchContractUndertakerFeedback(searchContractUndertakerFeedbackQuery)
controller.Response(data, err)
}
func (controller *ContractUndertakerFeedbackController) ListContractUndertakerFeedback() {
contractUndertakerFeedbackService := service.NewContractUndertakerFeedbackService(nil)
listContractUndertakerFeedbackQuery := &query.ListContractUndertakerFeedbackQuery{}
offset, _ := controller.GetInt("offset")
listContractUndertakerFeedbackQuery.Offset = offset
limit, _ := controller.GetInt("limit")
listContractUndertakerFeedbackQuery.Limit = limit
data, err := contractUndertakerFeedbackService.ListContractUndertakerFeedback(listContractUndertakerFeedbackQuery)
controller.Response(data, err)
}