Files

222 lines
8.0 KiB
Go

package systemconfig
import "time"
type ConfigDTO struct {
ID uint64 `json:"id"`
Key string `json:"key"`
Value string `json:"value"`
Description string `json:"description"`
UpdatedBy *uint64 `json:"updated_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type UpdateRequest struct {
Value string `json:"value"`
Description string `json:"description"`
}
// BackupScheduleDTO 仅描述调度时间,不包含备份目录、OSS 地址或任何密钥。
type BackupScheduleDTO struct {
Enabled bool `json:"enabled"`
FullHour int `json:"full_hour"`
FullMinute int `json:"full_minute"`
BinlogIntervalMinutes int `json:"binlog_interval_minutes"`
}
type HomeAnnouncementsDTO struct {
Items []string `json:"items"`
}
type HomeConfigDTO struct {
Announcements []string `json:"announcements"`
Banners []HomeBannerItem `json:"banners"`
PublishOptions PublishOptionsDTO `json:"publish_options"`
AWRecycle AWRecycleConfig `json:"aw_recycle"`
CooperationFeedback CooperationFeedbackConfig `json:"cooperation_feedback"`
// HomeEntriesEnabled 首页业务入口总开关:关闭后 PC/移动端同时隐藏回收与合作入口。
HomeEntriesEnabled bool `json:"home_entries_enabled"`
}
// AWRecycleConfig 首页「AW炫彩回收」入口:点击展示可配置图片。
type AWRecycleConfig struct {
Title string `json:"title"`
Subtitle string `json:"subtitle"`
ImageURL string `json:"image_url"`
Enabled bool `json:"enabled"`
}
// CooperationFeedbackConfig 首页「合作与反馈」入口:点击展示可配置图片。
type CooperationFeedbackConfig struct {
Title string `json:"title"`
Subtitle string `json:"subtitle"`
ImageURL string `json:"image_url"`
Enabled bool `json:"enabled"`
}
type OrderAgreementsDTO struct {
VirtualAssetPurchase AgreementContentDTO `json:"virtual_asset_purchase"`
RenterAgreement AgreementContentDTO `json:"renter_agreement"`
}
type ListingPublishAgreementsDTO struct {
VirtualAssetSale AgreementContentDTO `json:"virtual_asset_sale"`
SellerAgreement AgreementContentDTO `json:"seller_agreement"`
}
type PostRentalNoticeDTO struct {
Title string `json:"title"`
Content string `json:"content"`
}
type AgreementContentDTO struct {
Title string `json:"title"`
Content string `json:"content"`
}
// HomeBannerItem 首页轮播项:文案 + PC/移动两端视觉配置(图片、整图点击、热区)。
type HomeBannerItem struct {
Eyebrow string `json:"eyebrow"`
Title string `json:"title"`
Badge string `json:"badge"`
Pill string `json:"pill"`
Tone string `json:"tone"`
Enabled *bool `json:"enabled,omitempty"`
// ImageURL 早期扁平结构的图片字段,仅用于兼容读取:归一化时并入 PC/移动两端。
ImageURL string `json:"image_url,omitempty"`
PC HomeBannerVisual `json:"pc"`
Mobile HomeBannerVisual `json:"mobile"`
}
// HomeBannerVisual 单端展示配置:图片 + 整图点击行为 + 热区。
type HomeBannerVisual struct {
ImageURL string `json:"image_url,omitempty"`
Alt string `json:"alt,omitempty"`
Action HomeBannerAction `json:"action"`
Hotspots []HomeBannerHotspot `json:"hotspots,omitempty"`
}
// HomeBannerAction 点击行为:none(不跳转)/ route(站内路径)/ link(外部链接)/ preview(查看大图)。
type HomeBannerAction struct {
Type string `json:"type"`
Target string `json:"target"`
OpenNewTab bool `json:"open_new_tab"`
}
// HomeBannerHotspot 热区:相对图片的百分比坐标(0-100),与出图分辨率解耦。
type HomeBannerHotspot struct {
ID string `json:"id"`
Label string `json:"label"`
X float64 `json:"x"`
Y float64 `json:"y"`
Width float64 `json:"width"`
Height float64 `json:"height"`
// ImageURL 热区按钮图(透明 PNG),留空则前台用半透明高亮框提示可点击。
ImageURL string `json:"image_url,omitempty"`
// HoverScale 悬浮放大倍数:1 表示不放大,建议 1.04-1.08。
HoverScale float64 `json:"hover_scale,omitempty"`
Action HomeBannerAction `json:"action"`
}
type PublishOptionsDTO struct {
// SchemaVersion 发布选项结构版本;缺省 0 代表未版本化的历史配置。
SchemaVersion int `json:"schema_version,omitempty"`
NextSeasonPassEnabled bool `json:"next_season_pass_enabled"`
ServerOptions []string `json:"server_options"`
FaceOptions []string `json:"face_options"`
RankOptions []string `json:"rank_options"`
InsuranceOptions []string `json:"insurance_options"`
LevelOptions []string `json:"level_options"`
LoginMethodOptions []string `json:"login_method_options"`
RegionOptions []string `json:"region_options"`
SkinGroups []PublishOptionGroup `json:"skin_groups"`
QuantityItems []PublishQuantityItem `json:"quantity_items"`
ScreenshotSlots []PublishScreenshotSlot `json:"screenshot_slots"`
BanRecordOptions []string `json:"ban_record_options"`
BanEvidenceOptions []string `json:"ban_evidence_options"`
FireLevelMin int `json:"fire_level_min"`
PriceConfig PublishPriceConfig `json:"price_config"`
DepositRecommend PublishDepositRecommend `json:"deposit_recommend_config"`
RatioConfig PublishRatioConfig `json:"ratio_config"`
}
type PublishOptionGroup struct {
Key string `json:"key"`
Title string `json:"title"`
Options []string `json:"options"`
}
type PublishQuantityItem struct {
Key string `json:"key"`
Label string `json:"label"`
Price string `json:"price"`
Placeholder string `json:"placeholder,omitempty"`
}
type PublishScreenshotSlot struct {
Key string `json:"key"`
Label string `json:"label"`
Required bool `json:"required"`
Hint string `json:"hint"`
}
type PublishPriceConfig struct {
DepositPlaceholder string `json:"deposit_placeholder"`
DepositHint string `json:"deposit_hint"`
PricePlaceholder string `json:"price_placeholder"`
RatioDescription string `json:"ratio_description"`
}
type PublishDepositRecommend struct {
BaseAmount float64 `json:"base_amount"`
SkinGroupRules []PublishDepositSkinGroupRule `json:"skin_group_rules"`
}
type PublishDepositSkinGroupRule struct {
GroupKey string `json:"group_key"`
Label string `json:"label"`
AmountPerItem float64 `json:"amount_per_item"`
}
type PublishRatioConfig struct {
InsuranceBaseRatios []PublishInsuranceBaseRatio `json:"insurance_base_ratios"`
ConfigItems []PublishRatioConfigItem `json:"config_items"`
CoinCorrections []PublishCoinCorrection `json:"coin_corrections"`
}
type PublishInsuranceBaseRatio struct {
Insurance string `json:"insurance"`
Ratio float64 `json:"ratio"`
}
type PublishRatioConfigItem struct {
Key string `json:"key"`
Label string `json:"label"`
Kind string `json:"kind"`
GroupKey string `json:"group_key,omitempty"`
MissingPenalty float64 `json:"missing_penalty"`
}
type PublishCoinCorrection struct {
ThresholdM float64 `json:"threshold_m"`
Correction float64 `json:"correction"`
}
type PublishSalePriceConfig struct {
FixedMarkupRules []PublishSaleFixedMarkupRule `json:"fixed_markup_rules"`
RatioAdjustmentRules []PublishSaleRatioAdjustmentRule `json:"ratio_adjustment_rules"`
}
type PublishSaleFixedMarkupRule struct {
MinM float64 `json:"min_m"`
MaxM float64 `json:"max_m"`
MarkupAmount float64 `json:"markup_amount"`
}
type PublishSaleRatioAdjustmentRule struct {
MinM float64 `json:"min_m"`
MaxM float64 `json:"max_m,omitempty"`
RatioSubtract float64 `json:"ratio_subtract"`
}