hotime/example/main.go
2022-01-10 13:23:39 +08:00

32 lines
680 B
Go

package main
import (
"../../hotime"
"../dri/ddsms"
"./app"
"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 := hotime.Init("config/config.json")
//RESTfull接口适配
appIns.SetConnectListener(func(context *hotime.Context) bool {
//支撑权限设置
return true
})
//makeCode := code.MakeCode{}
//fmt.Println(common.ObjToStr(makeCode.Db2JSON("admin","test",appIns.Db)))
if ddsms.DefaultDDY.ApiKey == "" {
ddsms.DefaultDDY.Init(appIns.Config.GetString("smsKey"))
}
appIns.Run(hotime.Router{
"app": app.Project,
})
}