chore: 更新项目配置和核心服务

- 更新package.json和jest配置
- 更新main.ts启动配置
- 完善用户管理和数据库服务
- 更新安全核心模块
- 优化Zulip核心服务

配置改进:
- 统一项目依赖管理
- 优化测试配置
- 完善服务模块化架构
This commit is contained in:
moyin
2026-01-09 17:03:57 +08:00
parent cbf4120ddd
commit 8816b29b0a
17 changed files with 689 additions and 463 deletions

View File

@@ -33,6 +33,7 @@
import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, OneToOne } from 'typeorm';
import { UserStatus } from './user_status.enum';
import { ZulipAccounts } from '../zulip_accounts/zulip_accounts.entity';
import { FIELD_LIMITS } from './users.constants';
/**
* 用户实体类
@@ -113,7 +114,7 @@ export class Users {
*/
@Column({
type: 'varchar',
length: 50,
length: FIELD_LIMITS.USERNAME_MAX_LENGTH,
nullable: false,
unique: true,
comment: '唯一用户名/登录名'
@@ -141,7 +142,7 @@ export class Users {
*/
@Column({
type: 'varchar',
length: 100,
length: FIELD_LIMITS.EMAIL_MAX_LENGTH,
nullable: true,
unique: true,
comment: '邮箱(用于找回/通知)'
@@ -196,7 +197,7 @@ export class Users {
*/
@Column({
type: 'varchar',
length: 30,
length: FIELD_LIMITS.PHONE_MAX_LENGTH,
nullable: true,
unique: true,
comment: '全球电话号码(用于找回/通知)'
@@ -226,7 +227,7 @@ export class Users {
*/
@Column({
type: 'varchar',
length: 255,
length: FIELD_LIMITS.PASSWORD_HASH_MAX_LENGTH,
nullable: true,
comment: '密码哈希OAuth登录为空'
})
@@ -254,7 +255,7 @@ export class Users {
*/
@Column({
type: 'varchar',
length: 50,
length: FIELD_LIMITS.NICKNAME_MAX_LENGTH,
nullable: false,
comment: '显示昵称(头顶显示)'
})
@@ -282,7 +283,7 @@ export class Users {
*/
@Column({
type: 'varchar',
length: 100,
length: FIELD_LIMITS.GITHUB_ID_MAX_LENGTH,
nullable: true,
unique: true,
comment: 'GitHub OpenID第三方登录用'
@@ -311,7 +312,7 @@ export class Users {
*/
@Column({
type: 'varchar',
length: 255,
length: FIELD_LIMITS.AVATAR_URL_MAX_LENGTH,
nullable: true,
comment: 'GitHub头像或自定义头像URL'
})
@@ -381,7 +382,7 @@ export class Users {
*/
@Column({
type: 'varchar',
length: 20,
length: FIELD_LIMITS.STATUS_MAX_LENGTH,
nullable: true,
default: UserStatus.ACTIVE,
comment: '用户状态active-正常inactive-未激活locked-锁定banned-禁用deleted-删除pending-待审核'