同步
This commit is contained in:
@@ -233,6 +233,28 @@ func CronRetryOrderWebhooks(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
// CronRetryCkbLeads GET/POST /api/cron/retry-ckb-leads
|
||||
// 重推存客宝失败留资记录,并更新 ckb_lead_records.push_status。
|
||||
func CronRetryCkbLeads(c *gin.Context) {
|
||||
limit := 100
|
||||
if s := strings.TrimSpace(c.Query("limit")); s != "" {
|
||||
if n, err := strconv.Atoi(s); err == nil && n > 0 && n <= 1000 {
|
||||
limit = n
|
||||
}
|
||||
}
|
||||
retried, success, err := RetryFailedCkbLeads(c.Request.Context(), limit)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusOK, gin.H{"success": false, "error": err.Error()})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"success": true,
|
||||
"retried": retried,
|
||||
"pushed": success,
|
||||
"limit": limit,
|
||||
})
|
||||
}
|
||||
|
||||
// CronUnbindExpired GET/POST /api/cron/unbind-expired
|
||||
func CronUnbindExpired(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"success": true})
|
||||
|
||||
Reference in New Issue
Block a user