package websocket_data

// websocket接受要云渲染处理的数据
type RenderImageReqMsg struct {
	RequestId  string     `json:"request_id"`
	RenderData RenderData `json:"render_data"` //渲染主要参数
}
type RenderData struct {
	TemplateTag       string           `json:"template_tag"`        //模板标签(必须)
	TemplateTagColor  TemplateTagColor `json:"template_tag_color"`  //模板标签组合颜色(必须)
	TemplateTagGroups interface{}      `json:"template_tag_groups"` //模板标签分组信息数组(必须)
	Resolution        string           `json:"resolution"`          //合图分辨率
	Logo              string           `json:"logo"`                //log资源地址(必须)
	ProductId         int64            `json:"product_id"`          //产品id(必须)
	Website           string           `json:"website"`             //网站(可选)
	Slogan            string           `json:"slogan"`              //slogan(可选)
	Address           string           `json:"address"`             //地址(可选)
	Phone             string           `json:"phone"`               //电话(可选)
	Qrcode            string           `json:"qrcode"`              //二维码(可选)
	UserId            int64            `json:"user_id"`             //用户id(websocket连接建立再赋值)
	GuestId           int64            `json:"guest_id"`            //游客id(websocket连接建立再赋值)
}
type TemplateTagColor struct {
	Colors             [][]string `json:"colors"`               //颜色组合
	SelectedColorIndex int        `json:"selected_color_index"` //主色的下标索引
}

// websocket发送渲染完的数据
type RenderImageRspMsg struct {
	RequestId         string            `json:"request_id"`
	Image             string            `json:"image"`               //渲染结果图片
	RenderProcessTime RenderProcessTime `json:"render_process_time"` //流程耗时
}
type RenderProcessTime struct {
	UnityRenderTakesTime            string `json:"unity_render_takes_time"`              //unity渲染用时
	UploadUnityRenderImageTakesTime string `json:"upload_unity_render_image_takes_time"` //上传unity渲染结果图时间
}

// 合图返回数据
type CombineImageRspMsg struct {
	RequestId          string             `json:"request_id"`
	CombineImage       string             `json:"combine_image"` //刀版图
	SizeId             int64              `json:"size_id"`       //尺寸id
	ModelId            int64              `json:"model_id"`
	TemplateId         int64              `json:"template_id"`
	CombineProcessTime CombineProcessTime `json:"combine_process_time"`
}
type CombineProcessTime struct {
	CombineTakesTime            string `json:"combine_takes_time"`              //合图时间
	UploadCombineImageTakesTime string `json:"upload_combine_image_takes_time"` //上传刀版图耗时
}

// 发送到组装渲染阶段信息返回数据
type AssembleRenderDataRspMsg struct {
	RequestId string `json:"request_id"`
}

// 发送到unity阶段信息返回数据
type ToUnityRspMsg struct {
	RequestId string `json:"request_id"`
}

// 发送到unity结构中id的结构
type ToUnityIdStruct struct {
	TaskId          string `json:"task_id"`
	Wid             string `json:"wid"`
	RequestId       string `json:"request_id"`
	RenderBeginTime int64  `json:"render_begin_time"`
	TemplateTag     string `json:"template_tag"`
}