demo.go
909 Bytes
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
package controllers
import (
"apigame/configs"
"apigame/models"
"apigame/service/code-msg"
"apigame/util/zjson"
"fmt"
)
// DemoController 绑定控制器
type DemoController struct {
BaseController
}
// Demo demo
func (c *DemoController) Demo() {
req := new(models.ReqDemo)
if !c.GetPostData(req) {
return
}
rsp := models.RspDemo{}
fmt.Println("DemoController.demo")
{
list := make([]configs.RoomRankRobotConfig, 0)
list = append(list, configs.RoomRankRobotConfig{
Id: 1,
MinScore: 10,
TotalScore: 30,
TotalRate: 10,
})
list = append(list, configs.RoomRankRobotConfig{
Id: 2,
MinScore: 20,
TotalScore: 50,
TotalRate: 6,
})
list = append(list, configs.RoomRankRobotConfig{
Id: 3,
MinScore: 50,
TotalScore: 200,
TotalRate: 5,
})
fmt.Println(zjson.Str(list))
}
c.RetRspCodeData(code_msg.RECODE_OK, rsp)
}