icesimba.mail.go
1.05 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
package main
import (
"common"
"fmt"
// . "sdkredis"
"flag"
. "client/icesimba.mail/apis"
db "client/icesimba.mail/database"
)
func main() {
// defer db.SqlDB.Close()
//redis 初始化
//RedisInit(nil)
//// 连接redis
//redisConn := RedisClient.GetConn()
//defer RedisClose(redisConn)
//RedisRPush(redisConn, "test", "555555")
//config := common.NewConfig("/root/sdkPlatform/bin/sdkRoute.conf") //C:/GoProject/src/sdkPlatform/bin/sdkRoute.conf
configPath := flag.String("config", "./sdkRoute.conf", "config path")
flag.Parse()
fmt.Printf("config[%v]", *configPath)
config := common.NewConfig(*configPath)
//数据库
db.Init(config.DBMysql)
sdkhttp := common.NewHttp(config)
sdkhttp.RegisterFunc("RefreshReward", RefreshRewardsApi)
sdkhttp.RegisterFunc("IsRewardExist", IsRewardExistApi)
sdkhttp.RegisterFunc("QueryReward", QueryRewardsApi)
sdkhttp.RegisterFunc("GainReward", GainRewardsApi)
sdkhttp.RegisterFunc("CheckReward", CheckRewardsApi)
sdkhttp.RegisterFunc("AlmanacReward", AlmanacRewardApi)
sdkhttp.Activate("icesimba.mail")
}