Kaynağa Gözat

4月18日 修改联系人第二页筛选时间参数

lichangdong 1 hafta önce
ebeveyn
işleme
8eeafb4dee

+ 2 - 3
desc/wechat/contact.api

@@ -65,9 +65,8 @@ type (
 		// 内容类型:1-个微 3-企微
 		Ctype *uint64 `json:"ctype,optional"`
 
-		//标签搜索开始结束日期
-		StartDate *string `json:"start_date,optional"`
-        EndDate *string `json:"end_date,optional"`
+        //标签搜索开始结束日
+        SearchDate []string `json:"date,optional"`
     }
 
     // Contact information response | Contact信息返回体

+ 3 - 6
internal/logic/contact/get_contact_list_logic.go

@@ -61,18 +61,15 @@ func (l *GetContactListLogic) GetContactList(req *types.ContactListReq) (*types.
 	layout := "2006-01-02 15:04:05"
 	var startTime, endTime *time.Time
 
-	if req.StartDate != nil && *req.StartDate != "" {
-		startStr := *req.StartDate + " 00:00:00"
+	if req.SearchDate != nil && len(req.SearchDate) == 2 {
+		startStr := req.SearchDate[0] + " 00:00:00"
 		if t, err := time.Parse(layout, startStr); err == nil {
 			//t = t.Add(23*time.Hour + 59*time.Minute + 59*time.Second)
 			startTime = &t
 		} else {
 			l.Logger.Errorf("invalid startDate: %v", err)
 		}
-	}
-
-	if req.EndDate != nil && *req.EndDate != "" {
-		endStr := *req.EndDate + " 23:59:59"
+		endStr := req.SearchDate[1] + " 23:59:59"
 		if t, err := time.Parse(layout, endStr); err == nil {
 			//t = t.Add(23*time.Hour + 59*time.Minute + 59*time.Second)
 			endTime = &t

+ 2 - 3
internal/types/types.go

@@ -1027,9 +1027,8 @@ type ContactListReq struct {
 	Type *int `json:"type,optional"`
 	// 内容类型:1-个微 3-企微
 	Ctype *uint64 `json:"ctype,optional"`
-	//标签搜索开始结束日期
-	StartDate *string `json:"start_date,optional"`
-	EndDate   *string `json:"end_date,optional"`
+	//标签搜索开始结束日
+	SearchDate []string `json:"date,optional"`
 }
 
 // Contact information response | Contact信息返回体