common_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
39
40
41
42
package controllers
import (
"io/ioutil"
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/common/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/common/service"
)
type CommonController struct {
beego.BaseController
}
func (controller *CommonController) GetDictionaryByCode() {
commonService := service.NewCommonService(nil)
queryParam := &query.GetDictionaryByCodeQuery{}
_ = controller.Unmarshal(queryParam)
data, err := commonService.GetDictionaryByCode(queryParam)
controller.Response(data, err)
}
func (controller *CommonController) LatestVersionInfo() {
commonService := service.NewCommonService(nil)
queryParam := &query.GetDictionaryByCodeQuery{}
_ = controller.Unmarshal(queryParam)
data, err := commonService.LatestVersionInfo()
controller.Response(data, err)
}
func (controller *CommonController) AppSharing() {
commonService := service.NewCommonService(nil)
queryParam := &query.GetDictionaryByCodeQuery{}
_ = controller.Unmarshal(queryParam)
data, err := commonService.AppSharing()
controller.Response(data, err)
}
func (controller *CommonController) LogData() {
bytes, _ := ioutil.ReadFile("./app.log")
controller.Ctx.WriteString(string(bytes))
}