|
@@ -294,6 +294,15 @@ func getCurl(urlStr string, params url.Values, num int) (body []byte, err error)
|
|
err = errors.New(response.Msg)
|
|
err = errors.New(response.Msg)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ itemApiLog := new(roadshow.RsCalendarApiLog)
|
|
|
|
+ itemApiLog.CreateTime = time.Now()
|
|
|
|
+ itemApiLog.Remark = "get请求上海接口"
|
|
|
|
+ itemApiLog.Url = getUrl
|
|
|
|
+ itemApiLog.Body = utils.ReplaceSpaceAndWrap(fmt.Sprint(params))
|
|
|
|
+ itemApiLog.Result = string(body)
|
|
|
|
+ go roadshow.AddRsCalendarApiLog(itemApiLog)
|
|
|
|
+
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
@@ -357,6 +366,14 @@ func postCurl(urlStr string, form url.Values, num int) (body []byte, err error,
|
|
err = errors.New(response.Msg)
|
|
err = errors.New(response.Msg)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ itemApiLog := new(roadshow.RsCalendarApiLog)
|
|
|
|
+ itemApiLog.CreateTime = time.Now()
|
|
|
|
+ itemApiLog.Remark = "post请求上海接口"
|
|
|
|
+ itemApiLog.Url = urlStr
|
|
|
|
+ itemApiLog.Body = utils.ReplaceSpaceAndWrap(fmt.Sprint(form))
|
|
|
|
+ itemApiLog.Result = string(body)
|
|
|
|
+ go roadshow.AddRsCalendarApiLog(itemApiLog)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
@@ -931,6 +948,7 @@ func SyncCalendarFromShanghai(userPhone, startDate, endDate string) (err error)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ var itemsApiLog []*roadshow.RsCalendarApiLog
|
|
//上海那边已经删除了路演,这边也要同步删除
|
|
//上海那边已经删除了路演,这边也要同步删除
|
|
for _, deleteRsCalendarResearcherList := range deleteRsCalendarResearcherMap {
|
|
for _, deleteRsCalendarResearcherList := range deleteRsCalendarResearcherMap {
|
|
for _, deleteRsCalendarResearcher := range deleteRsCalendarResearcherList {
|
|
for _, deleteRsCalendarResearcher := range deleteRsCalendarResearcherList {
|
|
@@ -946,7 +964,14 @@ func SyncCalendarFromShanghai(userPhone, startDate, endDate string) (err error)
|
|
errMsgList = append(errMsgList, fmt.Sprint("第三方日历ID:", deleteRsCalendarResearcher.ThirdCalendarId, "删除关联关系失败;err:"+tmpErr.Error(), ";"))
|
|
errMsgList = append(errMsgList, fmt.Sprint("第三方日历ID:", deleteRsCalendarResearcher.ThirdCalendarId, "删除关联关系失败;err:"+tmpErr.Error(), ";"))
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ itemApiLog := new(roadshow.RsCalendarApiLog)
|
|
|
|
+ itemApiLog.CreateTime = time.Now()
|
|
|
|
+ itemApiLog.Remark = "对比上海接口之后手动删除"
|
|
|
|
+ itemApiLog.Url = fmt.Sprint("userPhone", userPhone, "currDay", currDay, "endDate", endDate)
|
|
|
|
+ itemApiLog.Body = ""
|
|
|
|
+ itemApiLog.Result = ""
|
|
|
|
+ itemApiLog.RsCalendarResearcherId = deleteRsCalendarResearcher.RsCalendarResearcherId
|
|
|
|
+ itemsApiLog = append(itemsApiLog, itemApiLog)
|
|
// 更新路演的同步字段
|
|
// 更新路演的同步字段
|
|
//calWhereParams := make(map[string]interface{})
|
|
//calWhereParams := make(map[string]interface{})
|
|
//calUpdateParams := make(map[string]interface{})
|
|
//calUpdateParams := make(map[string]interface{})
|
|
@@ -955,6 +980,11 @@ func SyncCalendarFromShanghai(userPhone, startDate, endDate string) (err error)
|
|
//err = roadshow.UpdateRsCalendar(calWhereParams, calUpdateParams)
|
|
//err = roadshow.UpdateRsCalendar(calWhereParams, calUpdateParams)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if len(itemsApiLog) > 0 {
|
|
|
|
+ go roadshow.AddRsCalendarApiLogList(itemsApiLog)
|
|
|
|
+ }
|
|
|
|
+
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|