business_table_controller.go
2.2 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
package controllers
import (
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/application/table/command"
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/application/table/query"
"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/application/table/service"
)
func (controller *TableController) ShowBusinessDatabases() {
tableService := service.NewTableService(nil)
cmd := &query.ShowBusinessDatabasesRequest{}
Must(controller.Unmarshal(cmd))
data, err := tableService.ShowBusinessDatabases(ParseContext(controller.BaseController), cmd)
controller.Response(data, err)
}
func (controller *TableController) ShowBusinessTables() {
tableService := service.NewTableService(nil)
cmd := &query.ShowTablesRequest{}
Must(controller.Unmarshal(cmd))
data, err := tableService.ShowBusinessTables(ParseContext(controller.BaseController), cmd)
controller.Response(data, err)
}
func (controller *TableController) QueryBusinessTable() {
tableService := service.NewTableService(nil)
cmd := &query.ShowTableDataRequest{}
Must(controller.Unmarshal(cmd))
data, err := tableService.QueryBusinessTable(ParseContext(controller.BaseController), cmd)
controller.Response(data, err)
}
func (controller *TableController) UpdateBusinessTable() {
tableService := service.NewTableService(nil)
cmd := &command.UpdateBusinessTableRequest{}
Must(controller.Unmarshal(cmd))
data, err := tableService.UpdateBusinessTable(ParseContext(controller.BaseController), cmd)
controller.Response(data, err)
}
func (controller *TableController) GenerateBusinessTable() {
tableService := service.NewTableService(nil)
cmd := &command.GenerateBusinessTableRequest{}
Must(controller.Unmarshal(cmd))
data, err := tableService.GenerateBusinessTable(ParseContext(controller.BaseController), cmd)
controller.Response(data, err)
}
func (controller *TableController) GenerateBusinessTablesView() {
tableService := service.NewTableService(nil)
cmd := &command.GenerateBusinessTableViewRequest{}
Must(controller.Unmarshal(cmd))
data, err := tableService.GenerateBusinessTablesView(ParseContext(controller.BaseController), cmd)
controller.Response(data, err)
}