47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package logic
|
|
|
|
import "fusenapi/constants"
|
|
|
|
// 入口数据格式错误
|
|
func (w *wsConnectItem) incomeDataFormatErrResponse(data interface{}) {
|
|
if w.debug == nil {
|
|
return
|
|
}
|
|
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_ERR_DATA_FORMAT, data))
|
|
}
|
|
|
|
// 渲染错误通知
|
|
func (w *wsConnectItem) renderErrResponse(renderId, requestId, templateTag, taskId, description string, productId, userId, guestId, templateId, modelId, sizeId, elementModelId int64) {
|
|
if w.debug == nil {
|
|
return
|
|
}
|
|
data := make(map[string]interface{})
|
|
data["render_id"] = renderId
|
|
data["request_id"] = requestId
|
|
data["description"] = description
|
|
data["template_tag"] = templateTag
|
|
data["product_id"] = productId
|
|
if taskId != "" {
|
|
data["task_id"] = taskId
|
|
}
|
|
if userId >= 0 {
|
|
data["user_id"] = userId
|
|
}
|
|
if guestId >= 0 {
|
|
data["guest_id"] = guestId
|
|
}
|
|
if templateId > 0 {
|
|
data["template_id"] = templateId
|
|
}
|
|
if modelId > 0 {
|
|
data["model_id"] = modelId
|
|
}
|
|
if sizeId > 0 {
|
|
data["size_id"] = sizeId
|
|
}
|
|
if elementModelId > 0 {
|
|
data["element_model_id"] = elementModelId
|
|
}
|
|
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE_ERR, data))
|
|
}
|