init monorepo

This commit is contained in:
aric jean
2026-03-23 07:09:31 +08:00
parent 9f0c2e7c61
commit 16219ec7f1
657 changed files with 124939 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
{
"name": "@nest-pure/shared",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"packageManager": "pnpm@10.27.0",
"dependencies": {
"zod": "^4.3.6"
}
}

View File

@@ -0,0 +1,5 @@
export const DB_TABLES = {
USERS: 'users',
LOGS: 'system_logs'
};

View File

@@ -0,0 +1,48 @@
/**
* 用户角色枚举
*/
export enum UserRole {
ADMIN = 'admin',
USER = 'user',
}
/**
* 基础用户模型 (对应数据库 users 表)
*/
export interface User {
id: number;
casdoor_uuid: string; // 关联 Casdoor 的唯一标识
username: string;
email?: string;
avatar?: string;
role: UserRole;
created_at: string | Date;
}
/**
* 统一 API 返回格式
*/
export interface ApiResponse<T = any> {
code: number; // 0 表示成功,非 0 表示业务错误
data: T;
message: string;
}
/**
* 分页返回格式
*/
export interface PaginatedResponse<T> {
items: T[];
total: number;
page: number;
pageSize: number;
}
/**
* Casdoor 登录成功后前端传给后端的 Payload
*/
export interface AuthCallbackPayload {
code: string;
state?: string;
}

View File

@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"declaration": true
},
"include": ["src"]
}