menu_controller.go
1.3 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
package web_client
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/custommenu/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/custommenu/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/custommenu/service"
)
type MenuController struct {
baseController
}
func (controller *MenuController) MenuList() {
menuService := service.NewMenuService(nil)
menuListQuery := &query.MenuListQuery{}
controller.Unmarshal(menuListQuery)
menuListQuery.Operator = controller.GetOperator()
data, err := menuService.MenuList(menuListQuery)
controller.Response(data, err)
}
func (controller *MenuController) MenuUpdate() {
menuService := service.NewMenuService(nil)
menuUpdateQuery := &command.MenuUpdateCommand{}
controller.Unmarshal(menuUpdateQuery)
menuUpdateQuery.Operator = controller.GetOperator()
data, err := menuService.MenuUpdate(menuUpdateQuery)
controller.Response(data, err)
}
func (controller *MenuController) MenuFavorite() {
menuService := service.NewMenuService(nil)
menuFavoriteCommand := &command.MenuFavoriteCommand{}
controller.Unmarshal(menuFavoriteCommand)
menuFavoriteCommand.Operator = controller.GetOperator()
data, err := menuService.MenuFavorite(menuFavoriteCommand)
controller.Response(data, err)
}