block_chain_controller.go
2.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
package controllers
import (
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application/blockChain/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/application/blockChain/service"
)
type BlockChainController struct {
beego.BaseController
}
//func (controller *BlockChainController) CreateBlockChain() {
// blockChainService := service.NewBlockChainService(nil)
// createBlockChainCommand := &command.CreateBlockChainCommand{}
// controller.Unmarshal(createBlockChainCommand)
// data, err := blockChainService.CreateBlockChain(createBlockChainCommand)
// controller.Response(data, err)
//}
//
//func (controller *BlockChainController) UpdateBlockChain() {
// blockChainService := service.NewBlockChainService(nil)
// updateBlockChainCommand := &command.UpdateBlockChainCommand{}
// controller.Unmarshal(updateBlockChainCommand)
// blockChainId, _ := controller.GetString(":blockChainId")
// updateBlockChainCommand.BlockChainId = blockChainId
// data, err := blockChainService.UpdateBlockChain(updateBlockChainCommand)
// controller.Response(data, err)
//}
//
//func (controller *BlockChainController) GetBlockChain() {
// blockChainService := service.NewBlockChainService(nil)
// getBlockChainQuery := &query.GetBlockChainQuery{}
// blockChainId, _ := controller.GetString(":blockChainId")
// getBlockChainQuery.BlockChainId = blockChainId
// data, err := blockChainService.GetBlockChain(getBlockChainQuery)
// controller.Response(data, err)
//}
//
//func (controller *BlockChainController) RemoveBlockChain() {
// blockChainService := service.NewBlockChainService(nil)
// removeBlockChainCommand := &command.RemoveBlockChainCommand{}
// controller.Unmarshal(removeBlockChainCommand)
// blockChainId, _ := controller.GetString(":blockChainId")
// removeBlockChainCommand.BlockChainId = blockChainId
// data, err := blockChainService.RemoveBlockChain(removeBlockChainCommand)
// controller.Response(data, err)
//}
func (controller *BlockChainController) ListBlockChain() {
blockChainService := service.NewBlockChainService(nil)
listBlockChainQuery := &query.ListBlockChainQuery{}
Must(controller.Unmarshal(listBlockChainQuery))
listBlockChainQuery.OperateInfo = ParseOperateInfo(controller.BaseController)
data, err := blockChainService.ListBlockChain(listBlockChainQuery)
controller.Response(data, err)
}
func (controller *BlockChainController) GetBlockChainToken() {
blockChainService := service.NewBlockChainService(nil)
listBlockChainQuery := &query.GetBlockChainTokenQuery{}
Must(controller.Unmarshal(listBlockChainQuery))
//listBlockChainQuery.OperateInfo = ParseOperateInfo(controller.BaseController)
data, err := blockChainService.GetBlockChainToken(listBlockChainQuery)
controller.Response(data, err)
}