template.go 5.35 KB
Newer Older
brent's avatar
brent committed
1 2
package models

brent's avatar
brent committed
3 4
import "time"

brent's avatar
brent committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
//type Position int
//
//const (
//	TOPLEFT Position = iota + 1
//	TOPRIGHT
//	TOPMIDDLE
//	LEFTMIDDLE
//	LEFTBOTTOM
//	BOTTOMMIDDLE
//	RIGHTBOTTOM
//	RIGHTMIDDLE
//	CENTER
//)

type Position struct {
	X int `json:"x,omitempty" bson:"x"`
	Y int `json:"y,omitempty" bson:"y"`
}

brent's avatar
brent committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
//type Params struct {
//	Ai struct {
//		StableDiffusion3 []struct {
//			Field string      `json:"field"`
//			Name  string      `json:"name"`
//			Type  interface{} `json:"type"`
//		} `json:"stable-diffusion-3"`
//	} `json:"ai"`
//	Ui []struct {
//		Field      string      `json:"field"`
//		Name       string      `json:"name"`
//		Type       interface{} `json:"type"`
//		Enum       []string    `json:"enum,omitempty"`
//		Properties []struct {
//			Field  string      `json:"field"`
//			Name   string      `json:"name"`
//			Type   interface{} `json:"type"`
//			Format string      `json:"format,omitempty"`
//			IsShow bool        `json:"is_show,omitempty"`
//		} `json:"properties,omitempty"`
//	} `json:"ui"`
//}

//type Params struct {
//	Ui []struct {
//		Field  string      `json:"field"`
//		Name   string      `json:"name"`
//		Type   interface{} `json:"type"`
//		Format string      `json:"format,omitempty"`
//		IsShow bool        `json:"is_show,omitempty"`
//	} `json:"ui"`
//}

brent's avatar
brent committed
57
type Template struct {
brent's avatar
brent committed
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
	Id          interface{} `json:"id" bson:"_id,omitempty"`
	Name        string      `json:"name,omitempty" bson:"name"`
	Desc        string      `json:"desc,omitempty" bson:"desc"`
	Params      interface{} `json:"params,omitempty" bson:"params"`
	UserId      string      `json:"user_id,omitempty" bson:"user_id"`
	CreatedTime time.Time   `json:"created_time" bson:"created_time"`
	UpdatedTime time.Time   `json:"updated_time" bson:"updated_time"`
	Deleted     int         `json:"deleted" bson:"deleted"`
}

type TemplateData struct {
	Id             interface{} `json:"id" bson:"_id,omitempty"`
	TemplateId     interface{} `json:"template_id" bson:"template_id"`
	TemplateParams interface{} `json:"template_params" bson:"template_params"`
	ParamsValue    interface{} `json:"params_value" bson:"params_value"`
	UserId         string      `json:"user_id,omitempty" bson:"user_id"`
	CreatedTime    time.Time   `json:"created_time" bson:"created_time"`
	UpdatedTime    time.Time   `json:"updated_time" bson:"updated_time"`
	Deleted        int         `json:"deleted" bson:"deleted"`
brent's avatar
brent committed
77
}
brent's avatar
brent committed
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121

//type TemplateData struct {
//	Id                interface{} `json:"id" bson:"_id,omitempty"`
//	TemplateId        interface{} `json:"template_id" bson:"template_id"`
//	Logo              string      `json:"logo,omitempty" bson:"logo"`                             // 海报图片上展示的logo,非 应用logo
//	Image             string      `json:"image,omitempty" bson:"image"`                           //模版展示的图片
//	ProjectName       string      `json:"project_name,omitempty" bson:"project_name"`             // 海报图片上展示的文字,非 应用标题
//	Place             string      `json:"place,omitempty" bson:"place"`                           // 地点名称
//	Watermark         string      `json:"watermark,omitempty" bson:"watermark"`                   //商家 的 水印
//	WatermarkPosition Position    `json:"watermark_position,omitempty" bson:"watermark_position"` //商家 的 水印位置
//	Platform          string      `json:"platform,omitempty" bson:"platform"`                     //平台 的 水印
//	PlatformPosition  Position    `json:"platform_position,omitempty" bson:"platform_position"`
//	Prompt            string      `json:"prompt,omitempty" bson:"prompt"`
//	Audio             string      `json:"audio,omitempty" bson:"audio"`
//	Type              int         `json:"type,omitempty" bson:"type"` // 1 poster,2 speaker,3 meme
//	CreatedTime       time.Time   `json:"created_time" bson:"created_time"`
//	UpdatedTime       time.Time   `json:"updated_time" bson:"updated_time"`
//	Deleted           int         `json:"deleted" bson:"deleted"`
//}

//type Template struct {
//	Id                interface{} `json:"id" bson:"_id,omitempty"`
//	Image             string      `json:"image,omitempty" bson:"image"`                           //模版展示的图片
//	Watermark         string      `json:"watermark,omitempty" bson:"watermark"`                   //商家 的 水印
//	WatermarkPosition Position    `json:"watermark_position,omitempty" bson:"watermark_position"` //商家 的 水印位置
//	Platform          string      `json:"platform,omitempty" bson:"platform"`                     //平台 的 水印
//	PlatformPosition  Position    `json:"platform_position,omitempty" bson:"platform_position"`
//	Prompt            string      `json:"prompt,omitempty" bson:"prompt"`
//	CreatedTime       time.Time   `json:"created_time" bson:"created_time"`
//	UpdatedTime       time.Time   `json:"updated_time" bson:"updated_time"`
//	Deleted           int         `json:"deleted" bson:"deleted"`
//}
//
//type PosterTemplate struct {
//	Template
//	Audio string `json:"audio,omitempty" bson:"audio"`
//}
//
//type SpeakerTemplate struct {
//	Template
//	ProjectName string `json:"project_name,omitempty" bson:"project_name"` // 海报图片上展示的文字,非 应用标题
//	Logo        string `json:"logo,omitempty" bson:"logo"`                 // 海报图片上展示的logo,非 应用logo
//	Place       string `json:"place,omitempty" bson:"place"`               // 地点名称
//}