package com.gxwebsoft.cms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.gxwebsoft.common.system.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 网站信息记录表
 *
 * @author 科技小王子
 * @since 2024-09-10 20:36:14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "CmsWebsite对象", description = "网站信息记录表")
public class CmsWebsite implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "站点ID")
    @TableId(value = "website_id", type = IdType.AUTO)
    private Integer websiteId;

    @Schema(description = "网站名称")
    private String websiteName;

    @Schema(description = "网站标识")
    private String websiteCode;

    @Schema(description = "网站密钥")
    private String websiteSecret;

    @Schema(description = "网站LOGO")
    private String websiteIcon;

    @Schema(description = "网站LOGO")
    private String websiteLogo;

    @Schema(description = "网站LOGO(深色模式)")
    private String websiteDarkLogo;

    @Schema(description = "网站图标/正方形Logo(后台应用卡/分享图标/浏览器标签页图标)")
    private String websiteAvatar;

    @Schema(description = "网站类型")
    private String websiteType;

    @Schema(description = "栏目ID")
    private Integer categoryId;

    @Schema(description = "应用ID")
    @TableField(exist = false)
    private Integer appId;

    @Schema(description = "网站截图")
    private String files;

    @Schema(description = "应用类型 10=web(Web应用) 20=miniprogram(小程序) 30=mobile(移动App) 40=api(API服务) 50=internal(内部工具)")
    private Integer type;

    @Schema(description = "网站关键词")
    private String keywords;

    @Schema(description = "域名前缀")
    private String prefix;

    @Schema(description = "绑定域名")
    private String domain;

    @Schema(description = "全局样式")
    private String style;

    @Schema(description = "后台管理地址")
    private String adminUrl;

    @Schema(description = "自定义API接口")
    private String apiUrl;

    @Schema(description = "应用版本 10免费版 20授权版 30永久授权")
    private Integer version;

    @Schema(description = "服务到期时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expirationTime;

    @Schema(description = "是否到期")
    @TableField(exist = false)
    private Integer expired;

    @Schema(description = "剩余天数")
    @TableField(exist = false)
    private Long expiredDays;

    @Schema(description = "服务器ID")
    private Integer assetsId;

    @Schema(description = "服务器ID")
    private String assetsName;

    @Schema(description = "模版ID(存克隆的租户UID)")
    private Integer templateId;

    @Schema(description = "模版名称")
    @TableField(exist = false)
    private String templateName;

    @Schema(description = "行业类型(父级)")
    private String industryParent;

    @Schema(description = "行业类型(子级)")
    private String industryChild;

    @Schema(description = "企业ID")
    private Integer companyId;

    @Schema(description = "开发者名称")
    private String developer;

    @Schema(description = "所在国家")
    private String country;

    @Schema(description = "所在省份")
    private String province;

    @Schema(description = "所在城市")
    private String city;

    @Schema(description = "所在辖区")
    private String region;

    @Schema(description = "经度")
    private String longitude;

    @Schema(description = "纬度")
    private String latitude;

    @Schema(description = "街道地址")
    private String address;

    @Schema(description = "联系电话")
    private String phone;

    @Schema(description = "电子邮箱")
    private String email;

    @Schema(description = "ICP备案号")
    private String icpNo;

    @Schema(description = "公安备案")
    private String policeNo;

    @Schema(description = "网站描述")
    private String content;

    // ─── 后台「网站设置」扩展字段（website-admin /about 页面维护） ──────────
    // 这些字段在后台网站设置页维护，公开站展示时按需读取。

    @Schema(description = "品牌标语/Slogan")
    private String slogan;

    @Schema(description = "版权信息")
    private String copyright;

    @Schema(description = "微信公众号二维码")
    private String qrCode;

    @Schema(description = "社交/外部链接（JSON 数组字符串）")
    private String socialLinks;

    @Schema(description = "SEO 标题")
    private String seoTitle;

    @Schema(description = "SEO 描述")
    private String seoDescription;

    @Schema(description = "备注")
    private String comments;

    @Schema(description = "管理员备注")
    private String remarks;

    @Schema(description = "是否推荐")
    private Integer recommend;

    @Schema(description = "是否官方产品")
    private Boolean official;

    @Schema(description = "允许展示到插件市场")
    private Boolean market;

    @Schema(description = "是否插件类型 0应用 1插件")
    private Boolean plugin;

    @Schema(description = "允许被搜索")
    private Boolean search;

    @Schema(description = "主题色")
    private String color;

    @Schema(description = "运行状态 0运行中 1已关闭 2维护中")
    private Integer running;

    @Schema(description = "即将过期")
    private Integer soon;

    @Schema(description = "评分")
    private BigDecimal rate;

    @Schema(description = "点赞数量")
    private Integer likes;

    @Schema(description = "点击数量")
    private Integer clicks;

    @Schema(description = "购买数量")
    private Integer buys;

    @Schema(description = "下载数量")
    private Integer downloads;

    @Schema(description = "销售价格")
    private BigDecimal price;

    @Schema(description = "交付方式")
    private Integer deliveryMethod;

    @Schema(description = "计费方式")
    private Integer chargingMethod;

    @Schema(description = "状态 0未开通 1运行中 2维护中 3已关闭 4已欠费停机 5违规关停")
    private Integer status;

    @Schema(description = "状态图标")
    @TableField(exist = false)
    private String statusIcon;

    @Schema(description = "维护说明")
    private String statusText;

    @Schema(description = "关闭说明")
    private String statusClose;

    @Schema(description = "全局样式")
    private String styles;

    @Schema(description = "排序号")
    private Integer sortNumber;

    @Schema(description = "用户ID")
    private Integer userId;

    @Schema(description = "商户ID")
    private Long merchantId;

    @Schema(description = "是否删除, 0否, 1是")
    @TableLogic
    private Integer deleted;

    @Schema(description = "租户id")
    private Integer tenantId;

    @Schema(description = "租户名称")
    @TableField(exist = false)
    private String tenantName;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Schema(description = "预设字段")
    @TableField(exist = false)
    private List<CmsWebsiteField> fields;

    @Schema(description = "小程序导航图标")
    @TableField(exist = false)
    private Map<String, List<CmsNavigation>> mpMenus;

    @Schema(description = "网站导航栏")
    @TableField(exist = false)
    private List<CmsNavigation> navigations;

    @Schema(description = "顶部菜单")
    @TableField(exist = false)
    private List<CmsNavigation> topNavs;

    @Schema(description = "底部菜单")
    @TableField(exist = false)
    private List<CmsNavigation> bottomNavs;

    @Schema(description = "幻灯片广告")
    @TableField(exist = false)
    private CmsAd slide;

    @Schema(description = "站点广告")
    @TableField(exist = false)
    private List<CmsAd> ads;

    @Schema(description = "首页布局")
    @TableField(exist = false)
    private String layout;

    @Schema(description = "友情链接")
    @TableField(exist = false)
    private List<CmsLink> links;

    @Schema(description = "配置信息")
    @TableField(exist = false)
    private Object config;

    @Schema(description = "服务器时间")
    @TableField(exist = false)
    private HashMap<String, Object> serverTime;

    @Schema(description = "当前登录用户")
    @TableField(exist = false)
    private User loginUser;

    @Schema(description = "超管账号")
    @TableField(exist = false)
    private String superAdminPhone;

    @Schema(description = "是否登录")
    @TableField(exist = false)
    private Boolean isLogin;

    @Schema(description = "网站设置")
    @TableField(exist = false)
    private CmsWebsiteSetting setting;

    // ─── 发布管理字段 ──────────────────────────────────────────────────

    @Schema(description = "发布状态: developing开发中 pending_review待审核 published已上架 rejected审核未通过 deprecated已下架")
    private String publishStatus;

    @Schema(description = "定价模式: free免费 one_time一次性 subscription订阅")
    private String priceType;

    @Schema(description = "订阅周期: month按月 year按年")
    private String subscriptionPeriod;

    @Schema(description = "应用简介（市场展示用）")
    private String appDescription;

    @Schema(description = "详细说明（富文本）")
    private String detailDescription;

    @Schema(description = "应用截图（JSON数组字符串）")
    private String screenshots;

    @Schema(description = "安装/使用次数")
    private Integer installCount;

    @Schema(description = "评分（1-5）")
    private java.math.BigDecimal rating;

    @Schema(description = "审核拒绝原因")
    private String rejectReason;

    @Schema(description = "提交审核时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date publishApplyTime;

    @Schema(description = "正式发布上架时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date publishTime;

    @Schema(description = "审核人用户ID")
    private Integer reviewerId;

    @Schema(description = "审核操作时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date reviewTime;
}
