hotime/example/main.go
2022-05-02 15:42:54 +08:00

46 lines
1.2 KiB
Go

package main
import (
. "code.hoteas.com/golang/hotime"
"code.hoteas.com/golang/hotime/dri/ddsms"
"code.hoteas.com/golang/hotime/dri/wechat"
"code.hoteas.com/golang/hotime/example/app"
"code.hoteas.com/golang/hotime/example/salesman"
//. "code.hoteas.com/golang/hotime/common"
"fmt"
"time"
)
func main() {
date, _ := time.Parse("2006-01-02 15:04", time.Now().Format("2006-01-02")+" 14:00")
fmt.Println(date, date.Unix())
//fmt.Println("0123456"[1:7])
appIns := Init("config/config.json")
app.InitApp(appIns)
//初始化短信
ddsms.DDY.Init(appIns.Config.GetString("smsKey"))
//初始化公众号配置
wechat.H5Program.Init(appIns.Config.GetString("wechatAppID"), appIns.Config.GetString("wechatAppSecret"))
//初始化小程序
wechat.MiniProgram.Init(appIns.Config.GetString("wechatMiniAppID"), appIns.Config.GetString("wechatMiniAppSecret"))
appIns.SetConnectListener(func(that *Context) (isFinished bool) {
//that.Session("admin_id", 1)
return isFinished
})
//appIns.SetConnectListener(func(that *Context) (isFinished bool) {
//
// return isFinished
//})
//appIns.Db.Action(func(db db.HoTimeDB) (isSuccess bool) {
// return isSuccess
//})
appIns.Run(Router{
"salesman": salesman.Project,
"app": app.Project,
})
}