From b0c07ddee23e2d54d03636f08af19f0934857cf4 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 25 八月 2023 10:32:56 +0800
Subject: [PATCH] Merge branch 'hotfix'
---
api/v1/followRecord.go | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/api/v1/followRecord.go b/api/v1/followRecord.go
index fef5098..0960dcf 100644
--- a/api/v1/followRecord.go
+++ b/api/v1/followRecord.go
@@ -6,6 +6,7 @@
"aps_crm/model/response"
"aps_crm/pkg/contextx"
"aps_crm/pkg/ecode"
+ "errors"
"github.com/gin-gonic/gin"
"time"
)
@@ -172,25 +173,37 @@
// checkTimeFormat
// 妫�鏌ユ椂闂存牸寮�
-func checkTimeFormat(t string) (*time.Time, error) {
+func checkTimeFormat(t string) (*model.CustomTime, error) {
+ if t == "" {
+ return nil, nil
+ }
+
location, err := time.LoadLocation("Asia/Shanghai")
if err != nil {
return nil, err
}
- tt, err := time.Parse("2006-01-02T15:04:05.000Z", t)
+ tt, err := time.Parse("2006-01-02", t)
if err == nil {
ret := tt.In(location)
- return &ret, nil
+ tmp := model.CustomTime(ret)
+ return &tmp, nil
}
- tt, err = time.Parse("2006-01-02T15:04:05-07:00", t)
+ tt, err = time.Parse("2006-01-02 15:04:05", t)
if err == nil {
ret := tt.In(location)
- return &ret, nil
+ tmp := model.CustomTime(ret)
+ return &tmp, nil
}
- return nil, err
+ //tt, err = time.Parse("2006-01-02T15:04:05-07:00", t)
+ //if err == nil {
+ // ret := tt.In(location)
+ // return &ret, nil
+ //}
+
+ return nil, errors.New("invalid time format")
}
// List
--
Gitblit v1.8.0