fusenapi/server/websocket/internal/logic/ws_err_response.go

41 lines
1.1 KiB
Go
Raw Normal View History

2023-08-24 09:23:41 +00:00
package logic
import "fusenapi/constants"
// 入口数据格式错误
func (w *wsConnectItem) incomeDataFormatErrResponse(data interface{}) {
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_ERR_DATA_FORMAT, data))
}
// 渲染错误通知
2023-10-11 06:42:49 +00:00
func (w *wsConnectItem) renderErrResponse(renderId, requestId, templateTag, taskId, description string, productId, userId, guestId, templateId, modelId, sizeId, elementModelId int64) {
2023-08-24 09:23:41 +00:00
data := make(map[string]interface{})
data["render_id"] = renderId
2023-10-11 06:42:49 +00:00
data["request_id"] = requestId
2023-08-24 09:23:41 +00:00
data["description"] = description
data["template_tag"] = templateTag
2023-08-30 06:32:44 +00:00
data["product_id"] = productId
2023-08-24 09:23:41 +00:00
if taskId != "" {
data["task_id"] = taskId
}
2023-09-12 03:14:06 +00:00
/*if userId >= 0 {
2023-08-24 09:23:41 +00:00
data["user_id"] = userId
}
if guestId >= 0 {
data["guest_id"] = guestId
2023-09-12 03:14:06 +00:00
}*/
2023-08-24 09:23:41 +00:00
if templateId > 0 {
data["template_id"] = templateId
}
if modelId > 0 {
data["model_id"] = modelId
}
if sizeId > 0 {
data["size_id"] = sizeId
}
2023-08-28 10:37:58 +00:00
if elementModelId > 0 {
data["element_model_id"] = elementModelId
}
2023-08-24 09:23:41 +00:00
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE_ERR, data))
}