作者 陈志颖

refactor:优化日志查看

@@ -36,9 +36,9 @@ func main() { @@ -36,9 +36,9 @@ func main() {
36 } 36 }
37 }() 37 }()
38 38
39 - // excel文件路径映射  
40 - beego.SetStaticPath("/download", "download")  
41 - beego.SetStaticPath("/logs", "log") 39 + //// excel文件路径映射
  40 + //beego.SetStaticPath("/download", "download")
  41 + //beego.SetStaticPath("/logs", "log")
42 42
43 beego.Run() 43 beego.Run()
44 } 44 }
@@ -102,7 +102,7 @@ func (repository *SuMoneyTransactionRecordRepository) Find(queryOptions map[stri @@ -102,7 +102,7 @@ func (repository *SuMoneyTransactionRecordRepository) Find(queryOptions map[stri
102 if uid, ok := queryOptions["uid"]; ok && (uid != int64(0)) { 102 if uid, ok := queryOptions["uid"]; ok && (uid != int64(0)) {
103 query = query.Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid) 103 query = query.Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid)
104 } 104 }
105 - if employeeMatchName, ok := queryOptions["employeeMatchName"]; ok && (employeeMatchName.(string) != "") { 105 + if employeeMatchName, ok := queryOptions["employeeMatchName"]; ok && (employeeMatchName != "") {
106 query = query.Where(`(su_money_transaction_record.employee->>'employeeName')::text LIKE ?`, fmt.Sprintf("%%%s%%", employeeMatchName.(string))) 106 query = query.Where(`(su_money_transaction_record.employee->>'employeeName')::text LIKE ?`, fmt.Sprintf("%%%s%%", employeeMatchName.(string)))
107 } 107 }
108 if recordType, ok := queryOptions["recordType"]; ok && (recordType != 0) { 108 if recordType, ok := queryOptions["recordType"]; ok && (recordType != 0) {
@@ -3,6 +3,7 @@ package beego @@ -3,6 +3,7 @@ package beego
3 import ( 3 import (
4 "github.com/astaxie/beego" 4 "github.com/astaxie/beego"
5 "github.com/linmadan/egglib-go/web/beego/filters" 5 "github.com/linmadan/egglib-go/web/beego/filters"
  6 + "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/constant"
6 . "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/log" 7 . "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/log"
7 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/port/beego/middleware" 8 "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/port/beego/middleware"
8 _ "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/port/beego/routers" 9 _ "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/port/beego/routers"
@@ -20,4 +21,8 @@ func init() { @@ -20,4 +21,8 @@ func init() {
20 21
21 timeLocal, _ := time.LoadLocation("Asia/Chongqing") 22 timeLocal, _ := time.LoadLocation("Asia/Chongqing")
22 time.Local = timeLocal 23 time.Local = timeLocal
  24 +
  25 + // excel文件路径映射
  26 + beego.SetStaticPath("/download", "download")
  27 + beego.SetStaticPath("/log", constant.LOG_File)
23 } 28 }