新增 B 端上传接口与列表接口,统一文件上传和分页查询能力 上传能力支持医院级数据隔离:系统管理员需显式指定医院,院内角色按登录医院自动隔离 图片上传自动压缩并转为 webp,视频上传自动转码并压缩为 mp4,普通文件按原始类型存储 增加上传目录与公开访问能力,统一输出可直接预览的访问地址 前端新增影像库页面,支持按类型筛选、关键字检索、分页浏览、在线预览与原文件访问 前端新增通用上传组件,支持在页面内复用并返回上传结果 管理后台新增影像库菜单与路由,并补充页面级角色权限控制 患者手术相关表单接入上传复用能力,支持术前资料与设备标签上传回填 新增上传模块 e2e 用例,覆盖成功路径、权限矩阵与关键失败场景 补充上传模块文档与安装依赖说明,完善工程内使用说明
39 lines
949 B
TypeScript
39 lines
949 B
TypeScript
import type { INestApplication } from '@nestjs/common';
|
|
import { PrismaService } from '../../../src/prisma.service.js';
|
|
import { loginAllRoles, type E2EAccessTokenMap } from './e2e-auth.helper.js';
|
|
import { createE2eApp } from './e2e-app.helper.js';
|
|
import {
|
|
ensureE2EFixtures,
|
|
type E2ESeedFixtures,
|
|
} from './e2e-fixtures.helper.js';
|
|
|
|
export interface E2EContext {
|
|
app: INestApplication;
|
|
prisma: PrismaService;
|
|
tokens: E2EAccessTokenMap;
|
|
fixtures: E2ESeedFixtures;
|
|
}
|
|
|
|
export async function createE2EContext(): Promise<E2EContext> {
|
|
const app = await createE2eApp();
|
|
const prisma = app.get(PrismaService);
|
|
const fixtures = await ensureE2EFixtures(app, prisma);
|
|
const tokens = await loginAllRoles(app, fixtures);
|
|
|
|
return {
|
|
app,
|
|
prisma,
|
|
fixtures,
|
|
tokens,
|
|
};
|
|
}
|
|
|
|
export async function closeE2EContext(ctx?: E2EContext) {
|
|
if (!ctx) {
|
|
return;
|
|
}
|
|
|
|
await ctx.prisma.$disconnect();
|
|
await ctx.app.close();
|
|
}
|