首次提交

This commit is contained in:
2025-09-28 09:30:27 +08:00
commit e58110a52c
70 changed files with 14672 additions and 0 deletions

21
src/const/result.ts Normal file
View File

@@ -0,0 +1,21 @@
import { HttpStatus } from '@nestjs/common';
export class ResultData {
constructor(
public code = HttpStatus.OK,
public msg?: string,
public data?: any,
) {
this.code = code;
this.msg = msg || '操作成功';
this.data = data || null;
}
static success(data?: any, msg?: string) {
return new ResultData(HttpStatus.OK, msg, data);
}
static fail(code = HttpStatus.BAD_REQUEST, msg?: string, data?: any) {
return new ResultData(code, msg, data);
}
}