Files
YschcmsService/src/main/java/com/yunhai/cms/entity/CmsSite.java
T
2026-09-07 09:09:39 +08:00

63 lines
2.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.yunhai.cms.entity;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
/**
* CMS 站点(多租户根,方案 §5.1 表1)。
*
* <p>站点层级(《院系子站方案》):{@code parent_site_id}=0 为顶层校站点(一校一主站),
* &gt;0 为该院系子站(挂主站 id,层级固定两层)。
*
* <p>config_json 保留键(方案 §8.6):{@code domain}(学校绑定域名台账)、
* {@code public_base_url}(对外基地址,默认派生自 base 域,绑学校域名后覆盖)、
* {@code colleges_label}(门户"专业院系"下拉文案,默认"专业院系")、
* {@code wechat}(公众号配置节点,本期不写,见微信平台对接方案)。
*/
@Getter
@Setter
@Entity
@Table(name = "cms_site",
uniqueConstraints = @UniqueConstraint(name = "uk_site_code", columnNames = "code"),
indexes = @Index(name = "idx_site_sch", columnList = "sch_id"))
public class CmsSite extends BaseEntity {
/** 站点编码,URL 路径用(/portal/{code}) */
@Column(name = "code", nullable = false, length = 64)
private String code;
/** 上级站点ID(0=顶层校站点;院系子站挂主站 id,层级固定两层) */
@Column(name = "parent_site_id", nullable = false)
private Integer parentSiteId = 0;
/** 学校ID(逻辑外键 → UserBase sys_group.id) */
@Column(name = "sch_id")
private Integer schId;
/** 学校名称(冗余展示) */
@Column(name = "sch_name", length = 128)
private String schName;
/** 站点名称 */
@Column(name = "name", nullable = false, length = 128)
private String name;
/** 皮肤包名(classpath:/templates/themes/{theme}/) */
@Column(name = "theme", length = 64)
private String theme = "default";
/** 站点配置 JSON(logo/联系方式/页脚/domain/public_base_url) */
@Column(name = "config_json", columnDefinition = "JSON")
private String configJson;
/** 状态:0=停用 1=启用 */
@Column(name = "status", nullable = false)
private Integer status = 1;
}