Files
YschcmsFront/src/types/cms.ts
T

301 lines
7.8 KiB
TypeScript
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.
/**
* CMS 后端契约类型(与 com.yunhai.cms.model 一一对应,方案 §9.2 API 清单)。
* 统一响应由 alova 封装解包:{code, msg, data} → code==0 返回 data。
*/
/* ===== 登录态 ===== */
/** 当前角色(平台 BoaRoleInfo) */
export interface CurrentRole {
roleId?: number;
roleName?: string;
schId?: number;
schName?: string;
}
/** GET /api/auth/user 返回 */
export interface AuthUserInfo {
account: string;
name: string;
currentRole?: CurrentRole;
superAdmin: boolean;
roleIds?: number[];
}
/** 站点(SiteVo) */
export interface SiteVo {
id: number;
code: string;
/** 门户路径(W4:顶层=code;子站=父path/code,/portal/{path}/ 唯一标识) */
path?: string;
/** 上级站点ID(0=顶层校站点;院系子站挂主站 id) */
parentSiteId?: number;
/** 上级站点名称(列表展示用,服务端装配) */
parentName?: string;
schId?: number;
schName?: string;
name: string;
theme?: string;
/** 站点配置 JSON 原文(logo/联系方式/页脚/domain/public_base_url) */
configJson?: string;
status: number;
createTime?: string;
}
/** layout 使用的当前站点精简态 */
export interface CurrentSite {
id: number;
code: string;
/** 门户路径(W4:嵌套 path) */
path?: string;
name: string;
}
/** 学校上下文精简态(docs/09 §3.3:学校卡片 = 顶层站点,URL 段用主站编码) */
export interface CurrentSchool {
schId?: number;
schName?: string;
mainSiteId: number;
mainSiteCode: string;
/** 主站门户路径(W4:/portal/{mainSitePath}/) */
mainSitePath?: string;
mainSiteName: string;
}
/** 学校工作台卡片(SchoolVo) */
export interface SchoolCard {
schId?: number;
schName?: string;
mainSiteId: number;
mainSiteCode: string;
/** 主站门户路径(W4:/portal/{mainSitePath}/) */
mainSitePath?: string;
mainSiteName: string;
theme?: string;
siteCount: number;
articleCount: number;
status: number;
}
/** UserBase 学校选项(添加学校选择器) */
export interface SchoolOption {
id: number;
name: string;
}
/* ===== 栏目 ===== */
/** 栏目树节点(CategoryTreeNode) */
export interface CategoryTreeNode {
id?: number;
parentId: number;
siteId?: number;
name: string;
/** 1=文章列表 2=单页 3=外链 */
type: number;
linkUrl?: string;
template?: string;
/** 首页展示形态(docs/12:空=默认卡 / news_grid 双栏新闻卡 / media_focus 来源标签列表) */
homeStyle?: string;
/** 单页内容(type=2) */
content?: string;
sortNo: number;
seoTitle?: string;
seoDescription?: string;
status: number;
children: CategoryTreeNode[];
}
/* ===== 文章 ===== */
/** 文章分页行(ArticlePageItem) */
export interface ArticlePageItem {
id: number;
siteId: number;
categoryId: number;
categoryName?: string;
title: string;
summary?: string;
coverImage?: string;
/** 0=草稿 1=已发布 2=已下架 */
status: number;
topmost: number;
publishTime?: string;
offlineTime?: string;
viewCount: number;
createTime?: string;
createBy?: string;
}
/** 文章编辑回显(ArticleEditVo) */
export interface ArticleEditVo {
id: number;
siteId: number;
categoryId: number;
title: string;
summary?: string;
content?: string;
coverImage?: string;
authorName?: string;
source?: string;
status: number;
topmost: number;
publishTime?: string;
offlineTime?: string;
extJson?: string;
}
/** 文章保存入参(ArticleSaveRequest) */
export interface ArticleSaveRequest {
id?: number;
siteId: number;
categoryId: number;
title: string;
summary?: string;
content?: string;
coverImage?: string;
authorName?: string;
source?: string;
topmost?: number;
/** 定时发布时间(空=不指定) */
publishTime?: string;
offlineTime?: string;
/** 微信预留开关(本期后端不消费) */
syncWechat?: boolean;
/** 本次编辑上传的附件 id */
attachmentIds?: number[];
}
/** 文章分页查询(ArticlePageQuery) */
export interface ArticlePageQuery {
siteId: number;
/** 栏目 id(后端字段 categoryIds: List<Integer>,多选逗号分隔;空=全部栏目) */
categoryIds?: number | string;
status?: number;
keyword?: string;
page?: number;
pageSize?: number;
}
/* ===== 附件 ===== */
/** 附件(AttachmentVo) */
export interface AttachmentVo {
id: number;
siteId: number;
articleId?: number;
/** 场景引用类型(B2):banner/link/site;空=无场景引用 */
refType?: string;
fileName: string;
url: string;
fileSize?: number;
mimeType?: string;
createTime?: string;
/** 未使用(B2 语义:无文章引用且无场景引用) */
orphan: boolean;
}
/* ===== 轮播 ===== */
/** 轮播(BannerVo) */
export interface BannerVo {
id?: number;
siteId: number;
position: string;
title: string;
imageUrl: string;
/** 1=文章 2=栏目 3=外链 */
linkType: number;
linkValue?: string;
sortNo: number;
startTime?: string;
endTime?: string;
status: number;
// ===== docs/20 D-3/D-6:topic/event 展示位扩展字段 =====
/** 专题大卡描述(position=topic) */
description?: string;
/** 专题大卡 CTA 按钮文字 */
ctaText?: string;
/** 专题大卡 CTA 跳转地址 */
ctaUrl?: string;
/** 活动日期(position=event,yyyy-MM-dd) */
eventDate?: string;
/** 活动地点(position=event) */
location?: string;
}
/* ===== 友链 ===== */
/** 友链(LinkVo) */
export interface LinkVo {
id?: number;
siteId: number;
groupName: string;
name: string;
logoUrl?: string;
linkUrl: string;
sortNo: number;
status: number;
}
/* ===== 皮肤包(ThemeVo,S1 交接契约:参数值为包级)===== */
/** select 型参数的候选项 */
export interface ThemeParamOption {
value: string;
label: string;
}
/** 参数 schema 项(后端 ThemeVo.ThemeParamVo):schema 只来自包内 theme.json */
export interface ThemeParamVo {
key: string;
/** color 型才有,CSS 变量名(如 --primary) */
cssVar?: string;
label: string;
/** color | select | image | text */
type: string;
/** 包内默认值:前端「已修改」标记与恢复默认的基准 */
defaultValue?: string;
options?: ThemeParamOption[];
}
/** 皮肤包(GET/PUT /api/theme/**) */
export interface ThemeVo {
/** 标识名 = 主题路径段,创建后不可改 */
name: string;
title: string;
description?: string;
version?: string;
author?: string;
bannerSize?: string;
/** 预览图(管理端资产代理 /api/theme/{name}/asset/screenshot.png) */
screenshotUrl?: string;
params: ThemeParamVo[];
/** 包级参数值(工作项 T):只含被微调过的 key,存 themes/.meta/{name}.json;缺项按 defaultValue 回落 */
paramValues?: Record<string, string>;
/** builtin=内置(模板/资产只读)/ external=外部可管 */
source?: string;
inUseCount?: number;
editable?: boolean;
usedBySiteNames?: string[];
}
/* ===== 事项库(svc,事项库详细设计 §7.4)===== */
/* ===== 名师风采(docs/20 D-7,PersonVo) ===== */
export interface PersonVo {
id?: number;
siteId: number;
name: string;
/** 头衔/职称 */
title?: string;
/** 一句话简介 */
bio?: string;
/** 头像 URL(空 = 首字徽章兜底) */
avatar?: string;
/** 所属栏目 id(空 = 未分组) */
categoryId?: number;
sortNo: number;
status: number;
}