package plant

import (
	"sundynix-go/global"
	"sundynix-go/model/system"
)

type Wiki struct {
	global.BaseModel
	IsHot          int `json:"isHot" form:"isHot" gorm:"column:is_hot;comment:是否推荐植物"`
	IsVectorSynced int `json:"isVectorSynced" form:"isVectorSynced" gorm:"column:is_vector_synced;type:tinyint;default:0;comment:是否已同步到向量库(0否1是)"`
	//基本信息
	Name             string `json:"name" form:"name" gorm:"column:name;size:50;comment:名称"`
	LatinName        string `json:"latinName" form:"latinName" gorm:"size:100;column:latin_name;comment:拉丁名"`
	Aliases          string `json:"aliases" form:"aliases" gorm:"size:100;column:aliases;comment:别名（逗号分隔）"`
	DistributionArea string `json:"distributionArea" form:"distributionArea" gorm:"type:text;;column:distribution_area;comment:分布区域"` //分布区域
	//科学分类
	Genus      string `json:"genus" form:"genus" gorm:"size:20;column:genus;comment:科属"`          // 属
	Difficulty int    `json:"difficulty" form:"difficulty" gorm:"column:difficulty;comment:种植难度"` //种植难度 1-5级
	//形态特征
	LifeCycle          string `json:"lifeCycle" form:"lifeCycle" gorm:"type:text;column:life_cycle;comment:生命周期"`                           // 生命周期 一年生 二年生 多年生等
	GrowthHabit        string `json:"growthHabit" form:"growthHabit" gorm:"type:text;column:growth_habit;comment:成长习性"`                     // 生长习性
	ReproductionMethod string `json:"reproductionMethod" form:"reproductionMethod" gorm:"size:200;column:reproduction_method;comment:繁殖方法"` //繁殖方法
	PestsDiseases      string `json:"pestsDiseases" form:"pestsDiseases" gorm:"size:200;column:pests_diseases;comment:病虫害"`
	//光照
	LightIntensity string `json:"lightIntensity" form:"lightIntensity" gorm:"size:50;column:light_intensity;comment:光照强度"` // 光照强度 弱光 强光
	LightType      string `json:"lightType" form:"lightType" gorm:"size:50;column:light_type;comment:光照类型"`                // 光照类型 直射光  散射光 半阴 全阴等
	//温度
	OptimalTempPeriod string `json:"optimalTempPeriod" form:"optimalTempPeriod" gorm:"column:optimal_temp_period;size:30;comment:最佳温度"`
	//茎
	Stem string `json:"stem" form:"stem" gorm:"size:200;column:stem;comment:茎"`
	//叶
	FoliageType  string `json:"foliageType" form:"foliageType" gorm:"size:200;column:foliage_type;comment:叶型"`
	FoliageColor string `json:"foliageColor" form:"foliageColor" gorm:"size:200;column:foliage_color;comment:叶色"`
	FoliageShape string `json:"foliageShape" form:"foliageShape" gorm:"size:200;column:foliage_shape;comment:叶形"`
	Height       int    `json:"height" form:"height" gorm:"size:10;column:height;comment:植株高度"`
	//花
	FloweringPeriod string `json:"floweringPeriod" form:"floweringPeriod" gorm:"size:100;column:flowering_period;comment:开花期"`
	FloweringColor  string `json:"floweringColor" form:"floweringColor" gorm:"size:100;column:flowering_color;comment:开花颜色"`
	FloweringShape  string `json:"floweringShape" form:"floweringShape" gorm:"size:100;column:flowering_shape;comment:开花形状"`
	FlowerDiameter  int    `json:"flowerDiameter" form:"flowerDiameter" gorm:"size:10;column:flower_diameter;comment:花直径"`
	//果
	Fruit   string `json:"fruit" form:"fruit" gorm:"size:200;column:fruit;comment:果实"`
	HasStar int    `json:"hasStar" form:"hasStar" gorm:"-"`

	//相关推荐
	RelatedWiki []*Wiki `gorm:"many2many:wiki_related;" json:"relatedWiki"`
	//图片 多对多
	ImgList []*system.Oss `gorm:"many2many:wiki_oss;" json:"imgList"`
	// 分类
	Classes []*Class `gorm:"many2many:wiki_class;" json:"classes"`
}
