diff --git a/server/render/consumer/assemble_render_data.go b/server/render/consumer/assemble_render_data.go index ae168ede..d5f79cbf 100644 --- a/server/render/consumer/assemble_render_data.go +++ b/server/render/consumer/assemble_render_data.go @@ -239,9 +239,10 @@ func (m *MqConsumerRenderAssemble) Run(ctx context.Context, data []byte) error { logx.Error(err) } sendData := map[string]interface{}{ - "id": parseInfo.RenderId, + "id": parseInfo.TaskId, "order_id": 0, "user_id": parseInfo.RenderData.UserId, + "guest_id": parseInfo.RenderData.GuestId, "sku_ids": []int64{parseInfo.RenderData.ProductId}, "tids": []string{*element.Title}, "data": result, diff --git a/server/render/internal/logic/rendernotifylogic.go b/server/render/internal/logic/rendernotifylogic.go index af298155..b3466aaa 100644 --- a/server/render/internal/logic/rendernotifylogic.go +++ b/server/render/internal/logic/rendernotifylogic.go @@ -47,6 +47,9 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a if req.Info.Image == "" { return resp.SetStatusWithMessage(basic.CodeRequestParamsErr, "invalid param image") } + if req.Info.UserId == 0 && req.Info.GuestId == 0 { + return resp.SetStatusWithMessage(basic.CodeRequestParamsErr, "invalid user_id or guest_id") + } /* if req.Sign == "" { return resp.SetStatusWithMessage(basic.CodeRequestParamsErr, "invalid param sign") }*/ @@ -59,6 +62,9 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a if req.Sign != sign { return resp.SetStatusWithMessage(basic.CodeRequestParamsErr, "invalid sign") }*/ + //创建/更新资源 + + //发送消息到对应的rabbitmq data := websocket_data.RenderImageNotify{ TaskId: req.Info.TaskId, Image: req.Info.Image, diff --git a/server/render/internal/types/types.go b/server/render/internal/types/types.go index 91d3407f..959af2ce 100644 --- a/server/render/internal/types/types.go +++ b/server/render/internal/types/types.go @@ -18,8 +18,10 @@ type RenderNotifyReq struct { } type NotifyInfo struct { - TaskId string `json:"task_id"` //任务id - Image string `json:"image"` + TaskId string `json:"task_id"` //任务id + UserId int64 `json:"user_id"` + GuestId int64 `json:"guest_id"` + Image string `json:"image"` } type Request struct { diff --git a/server_api/render.api b/server_api/render.api index 8dd06347..1fdfa90a 100644 --- a/server_api/render.api +++ b/server_api/render.api @@ -31,6 +31,8 @@ type RenderNotifyReq { Info NotifyInfo `json:"info"` } type NotifyInfo { - TaskId string `json:"task_id"` //任务id - Image string `json:"image"` + TaskId string `json:"task_id"` //任务id + UserId int64 `json:"user_id"` + GuestId int64 `json:"guest_id"` + Image string `json:"image"` } \ No newline at end of file