作者 tangxvhui

更新

@@ -29,11 +29,11 @@ func dayEndTime(t time.Time) time.Time { @@ -29,11 +29,11 @@ func dayEndTime(t time.Time) time.Time {
29 return t2 29 return t2
30 } 30 }
31 31
32 -func dayZeroTime(t time.Time) time.Time {  
33 - y, m, d := t.Local().Date()  
34 - t2 := time.Date(y, m, d, 0, 0, 0, 0, time.Local)  
35 - return t2  
36 -} 32 +// func dayZeroTime(t time.Time) time.Time {
  33 +// y, m, d := t.Local().Date()
  34 +// t2 := time.Date(y, m, d, 0, 0, 0, 0, time.Local)
  35 +// return t2
  36 +// }
37 37
38 func (srv TaskService) CreateTaskTest(param *command.CreateTaskCommand) error { 38 func (srv TaskService) CreateTaskTest(param *command.CreateTaskCommand) error {
39 transactionContext, err := factory.CreateTransactionContext(nil) 39 transactionContext, err := factory.CreateTransactionContext(nil)
@@ -8,7 +8,7 @@ import ( @@ -8,7 +8,7 @@ import (
8 ) 8 )
9 9
10 type UserAuth struct { 10 type UserAuth struct {
11 - jwt.StandardClaims 11 + jwt.StandardClaims `json:"-"`
12 UserId int64 `json:"userId"` 12 UserId int64 `json:"userId"`
13 CompanyId int64 `json:"companyId"` 13 CompanyId int64 `json:"companyId"`
14 CompanyName string `json:"companyName"` 14 CompanyName string `json:"companyName"`
@@ -21,7 +21,7 @@ func TestGenerateToken(t *testing.T) { @@ -21,7 +21,7 @@ func TestGenerateToken(t *testing.T) {
21 21
22 func TestParsetToken1(t *testing.T) { 22 func TestParsetToken1(t *testing.T) {
23 ut := UserAuth{} 23 ut := UserAuth{}
24 - str := `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM2MjQ3MTYsImlzcyI6InBlcmZvcm1hbmNlIiwidXNlcklkIjozNDIyMTg1MzQwMTIyNjI0LCJjb21wYW55SWQiOjgsImNvbXBhbnlOYW1lIjoiIiwicGhvbmUiOiIxMzA2NjY2NzcxMCIsInBsYXRmb3JtSWQiOjI5LCJuYW1lIjoiIiwiYWRtaW5UeXBlIjoxfQ.JLvIwDeY6mArmQE7NGs0u01NFArhedA6MphU94z_R04` 24 + str := `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM2OTY4NjIsImlzcyI6InBlcmZvcm1hbmNlIiwidXNlcklkIjozNDIyMTg1MzQwMTIyNjI0LCJjb21wYW55SWQiOjgsImNvbXBhbnlOYW1lIjoiIiwicGhvbmUiOiIxMzA2NjY2NzcxMCIsInBsYXRmb3JtSWQiOjI5LCJuYW1lIjoiIiwiYWRtaW5UeXBlIjoxfQ.M_0HuXFGfZWdVFivDMsnuEaVtzHA6TOYeR3XAjr4lWo`
25 tk, err := ut.ParseAccessToken(str) 25 tk, err := ut.ParseAccessToken(str)
26 t.Logf("err:%s", err) 26 t.Logf("err:%s", err)
27 t.Logf("%+v", tk) 27 t.Logf("%+v", tk)