docs: annotate Foundry source and deployment lifecycle in Chinese [skip ci]
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// 旧无界面操作批次 HTTP 协调器,原子验证多快照并冻结成功/终局拒绝回执。
|
||||
package platform
|
||||
|
||||
import (
|
||||
@@ -11,6 +12,7 @@ import (
|
||||
|
||||
const canvasOperationsAction = "headless.operations.v1"
|
||||
|
||||
// submitCanvasOperations 严格验证协议和参与者,稳定取锁后先重放回执,再比较版本并执行纯批处理。
|
||||
func (s *service) submitCanvasOperations(w http.ResponseWriter, r *http.Request, project, account string) error {
|
||||
if r.Method != http.MethodPost {
|
||||
reject(w, 405, "method_not_allowed")
|
||||
@@ -100,6 +102,7 @@ func (s *service) submitCanvasOperations(w http.ResponseWriter, r *http.Request,
|
||||
snapshots := make([]canvasSnapshot, 0, len(participants))
|
||||
versions := map[string]int64{}
|
||||
// Validate all participant documents before writing any of them.
|
||||
// 写快照前逐一验证所有权、AI 模型和资产;任一拒绝结束整个批次。
|
||||
for _, id := range participants {
|
||||
snapshot := staged[id]
|
||||
valid, e := validateCanvasRelations(r, tx, project, workspace, id, initial[id].Document, snapshot.Document)
|
||||
@@ -137,6 +140,7 @@ func (s *service) submitCanvasOperations(w http.ResponseWriter, r *http.Request,
|
||||
|
||||
// A terminal rejection also reserves the frozen key/body. Losing that response must
|
||||
// not turn a definite zero-write result into a future execution of the same request.
|
||||
// commitCanvasOperationReceipt 将应用或 terminal 拒绝写入七天回执,与本事务已做的变更一起提交。
|
||||
func commitCanvasOperationReceipt(w http.ResponseWriter, r *http.Request, tx *sql.Tx, project, account, board string, input canvasOperationBatch, status int, body response, before []canvasSnapshot, versions map[string]int64) error {
|
||||
var transactionID string
|
||||
if err := tx.QueryRowContext(r.Context(), `SELECT gen_random_uuid()::text`).Scan(&transactionID); err != nil {
|
||||
@@ -171,6 +175,7 @@ func commitCanvasOperationReceipt(w http.ResponseWriter, r *http.Request, tx *sq
|
||||
return nil
|
||||
}
|
||||
|
||||
// getCanvasOperation 查询本人请求的冻结结果,返回前重查回执内全部快照当前可读性,缺记录为 unknown。
|
||||
func (s *service) getCanvasOperation(w http.ResponseWriter, r *http.Request, project, account string) error {
|
||||
if r.Method != http.MethodGet {
|
||||
reject(w, 405, "method_not_allowed")
|
||||
|
||||
Reference in New Issue
Block a user