|
@@ -276,6 +276,13 @@ func getCurl(urlStr string, params url.Values, num int) (body []byte, err error)
|
|
|
err = errors.New(response.Msg)
|
|
|
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
|
|
|
}
|
|
|
|
|
@@ -339,6 +346,13 @@ func postCurl(urlStr string, form url.Values, num int) (body []byte, err error,
|
|
|
err = errors.New(response.Msg)
|
|
|
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
|
|
|
}
|
|
|
|
|
@@ -909,7 +923,7 @@ func SyncCalendarFromShanghai(userPhone, startDate, endDate string) (err error)
|
|
|
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ var itemsApiLog []*roadshow.RsCalendarApiLog
|
|
|
//上海那边已经删除了路演,这边也要同步删除
|
|
|
for _, deleteRsCalendarResearcherList := range deleteRsCalendarResearcherMap {
|
|
|
for _, deleteRsCalendarResearcher := range deleteRsCalendarResearcherList {
|
|
@@ -925,7 +939,14 @@ func SyncCalendarFromShanghai(userPhone, startDate, endDate string) (err error)
|
|
|
errMsg += fmt.Sprint("第三方日历ID:", deleteRsCalendarResearcher.ThirdCalendarId, "删除关联关系失败;err:"+tmpErr.Error(), ";")
|
|
|
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{})
|
|
|
//calUpdateParams := make(map[string]interface{})
|
|
@@ -934,6 +955,10 @@ func SyncCalendarFromShanghai(userPhone, startDate, endDate string) (err error)
|
|
|
//err = roadshow.UpdateRsCalendar(calWhereParams, calUpdateParams)
|
|
|
}
|
|
|
}
|
|
|
+ if len(itemsApiLog) > 0 {
|
|
|
+ go roadshow.AddRsCalendarApiLogList(itemsApiLog)
|
|
|
+ }
|
|
|
+
|
|
|
return
|
|
|
}
|
|
|
|