package websocket_data

import "fusenapi/constants"

// websocket数据交互基本数据类型
type DataTransferData struct {
	T constants.Websocket `json:"t"` //消息类型
	D interface{}         `json:"d"` //传递的消息
}

// websocket接受要云渲染处理的数据
type RenderImageReqMsg struct {
	RenderId   string     `json:"render_id"`   //渲染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"` //模板标签分组信息数组(必须)
	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 {
	RenderId          string            `json:"render_id"`           //渲染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 {
	RenderId           string             `json:"render_id"`     //渲染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 {
	RenderId string `json:"render_id"` //渲染id
}

// 发送到unity阶段信息返回数据
type ToUnityRspMsg struct {
	RenderId string `json:"render_id"` //渲染id
}

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