作者 陈志颖

feat:添加日志下载

2020/11/22 20:04:49.106 [I] [???:0] http server Running on http://:8082
2020/11/22 20:16:14.979 [I] [???:0] http server Running on http://:8082
2020/11/22 20:16:34.647 [D] [server.go:1925] | ::1| 404 | 1.616744ms| nomatch| GET  /logs
2020/11/22 20:16:35.142 [D] [server.go:1925] | ::1| 404 | 432.829µs| nomatch| GET  /favicon.ico
2020/11/22 20:16:39.116 [D] [server.go:2843] ====>Recv User:<nil> RequestId:GET./log.1606047399115973000
Auth=
BodyData:{}
2020/11/22 20:16:39.116 [D] [server.go:2843] <====Send RequestId:GET./log.1606047399115973000 BodyData:null
2020/11/22 20:16:39.116 [D] [server.go:1925] | ::1| 200 | 4.493459ms| match| GET  /log r:/log
2020/11/22 20:17:28.006 [D] [server.go:1925] | ::1| 404 | 427.795µs| nomatch| GET  /logs
2020/11/22 20:17:34.775 [D] [server.go:2843] ====>Recv User:<nil> RequestId:GET./log.1606047454775197000
Auth=
BodyData:{}
2020/11/22 20:17:34.775 [D] [server.go:2843] <====Send RequestId:GET./log.1606047454775197000 BodyData:null
2020/11/22 20:17:34.776 [D] [server.go:1925] | ::1| 200 | 831.181µs| match| GET  /log r:/log
... ...
... ... @@ -38,6 +38,7 @@ func main() {
// excel文件路径映射
beego.SetStaticPath("/download", "download")
beego.SetStaticPath("/logs", "log")
beego.Run()
}
... ...
... ... @@ -915,7 +915,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang
// 计算倒计时
var t1 = time.Now().Local()
var t2 = activityFound.Deadline
var t2 = activityFound.Deadline.Local()
updateExchangeCashActivityCommand.CountDown = int64(math.Ceil(t2.Sub(t1).Hours() / 24))
// 倒计时结束处理
... ...
... ... @@ -9,7 +9,7 @@ var ABILITY_SERVICE_HOST = "https://suplus-worth-app-gateway-dev.fjmaimaimai.com
var MMM_OPEN_API_SERVICE_HOST = "http://mmm-open-api-dev.fjmaimaimai.com"
//var LOG_LEVEL = "debug"
var LOG_File = "app.log"
var LOG_File = "logs/app.log"
func init() {
if os.Getenv("LOG_LEVEL") != "" {
... ...
... ... @@ -520,6 +520,10 @@ func (controller *SuMoneyController) ImportExchangeList () {
return
}
func (controller *SuMoneyController) LogFile() {
controller.Ctx.Output.Download("logs/app.log","app.log")
}
// 导出素币兑换清单,选择导出(ids),增加导出失败信息
func (controller *SuMoneyController) ExportExchangeList() {
cashPoolService := service.NewCashPoolService(nil)
... ...
... ... @@ -38,4 +38,6 @@ func init() {
beego.Router("/cash-pool/activity/exchange-list/import", &controllers.SuMoneyController{}, "Post:ImportExchangeList") // 导入素币兑换清单
beego.Router("/cash-pool/activity/exchange-list/export", &controllers.SuMoneyController{}, "Post:ExportExchangeList") // 导出素币兑换清单
beego.Router("/cash-pool/activity/exchange-list/ranking", &controllers.SuMoneyController{}, "Post:ExchangeCashListRanking") // 兑换素币清单排行榜
beego.Router("/log", &controllers.SuMoneyController{}, "Get:LogFile") // 系统日志
}
... ...