feat: 增加真实采购任务安全模式 (#98)
This commit is contained in:
@@ -123,7 +123,7 @@ func (h *Handler) Claim(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 2. 领取一个任务,只会拿到分配给这个客户端的
|
||||
task, err := service.ClaimNextTask(h.db, clientID, req.SupportedTypes)
|
||||
task, err := service.ClaimNextTask(h.db, clientID, req.SupportedTypes, req.Capabilities.PurchaseMode)
|
||||
if err != nil {
|
||||
log.Printf("task_claim_failed client_id=%s err=%v", clientID, err)
|
||||
apiError(c, http.StatusInternalServerError, "TASK_CLAIM_FAILED",
|
||||
@@ -171,13 +171,14 @@ func taskPayload(t *model.Task) gin.H {
|
||||
}
|
||||
|
||||
return gin.H{
|
||||
"id": t.TaskID,
|
||||
"type": t.TaskType,
|
||||
"version": t.Version,
|
||||
"priority": t.Priority,
|
||||
"payload": payload,
|
||||
"created_at": t.CreatedAt,
|
||||
"updated_at": t.UpdatedAt,
|
||||
"id": t.TaskID,
|
||||
"type": t.TaskType,
|
||||
"execution_mode": t.ExecutionMode,
|
||||
"version": t.Version,
|
||||
"priority": t.Priority,
|
||||
"payload": payload,
|
||||
"created_at": t.CreatedAt,
|
||||
"updated_at": t.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user