Skip to content

Commit 62cf338

Browse files
committed
更新 Swagger 注释,restart 已改为同步 call-response 模式
1 parent d50eaca commit 62cf338

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

backend/biz/task/handler/v1/task_control.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,15 @@ import (
7878
// @Description [{"port":0,"status":"string","process":"string","forward_id":"string?","access_url":"string?","label":"string?","error_message":"string?","whitelist_ips":["string"]}]
7979
// @Description ```
8080
// @Description
81-
// @Description ### Type=call, Kind=restart — 重启任务(无 call-response 返回)
81+
// @Description ### Type=call, Kind=restart — 重启任务
8282
// @Description 请求 Data:
8383
// @Description ```json
8484
// @Description {"request_id":"string?","load_session":true}
8585
// @Description ```
86+
// @Description 响应 Data:
87+
// @Description ```json
88+
// @Description {"id":"uuid","request_id":"string?","success":true,"message":"string","session_id":"string"}
89+
// @Description ```
8690
// @Description
8791
// @Description ### Type=sync-my-ip — 同步 Web 客户端真实 IP
8892
// @Description 请求 Data:
@@ -92,7 +96,7 @@ import (
9296
// @Description
9397
// @Description ## 下行消息
9498
// @Description
95-
// @Description - Type=call-response: 同步请求响应(Kind 与请求一致,restart 除外)。失败时 Data 为:
99+
// @Description - Type=call-response: 同步请求响应(Kind 与请求一致)。失败时 Data 为:
96100
// @Description ```json
97101
// @Description {"error":"string"}
98102
// @Description ```
@@ -238,6 +242,7 @@ func (h *TaskHandler) controlReadMessages(ctx context.Context, wsConn *ws.Websoc
238242
logger.WarnContext(ctx, "failed to unmarshal control message", "error", err, "data", string(d))
239243
continue
240244
}
245+
h.logger.With("task req", m, "task_id", task.ID).DebugContext(ctx, "recv task message")
241246

242247
switch m.Type {
243248
case consts.TaskStreamTypeCall:
@@ -262,6 +267,7 @@ func (h *TaskHandler) handleControlCall(ctx context.Context, wsConn *ws.Websocke
262267
logger.WarnContext(ctx, "failed to unmarshal restart task", "error", err)
263268
return
264269
}
270+
h.logger.With("restart", req, "task_id", task.ID).DebugContext(ctx, "recv restart call")
265271
req.ID = task.ID
266272
result, err = h.taskflow.TaskManager().Restart(ctx, req)
267273

0 commit comments

Comments
 (0)