mirror of
https://github.com/cool-team-official/cool-admin-midway-packages.git
synced 2025-12-10 21:32:48 +00:00
beta.2
This commit is contained in:
parent
9f40cacb11
commit
5638c19434
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cool-midway/core",
|
||||
"version": "8.0.0-beta.1",
|
||||
"version": "8.0.0-beta.2",
|
||||
"description": "cool-admin midway core",
|
||||
"main": "dist/index.js",
|
||||
"typings": "index.d.ts",
|
||||
|
||||
@ -3,11 +3,18 @@
|
||||
*/
|
||||
export class BaseException extends Error {
|
||||
status: number;
|
||||
statusCode: number;
|
||||
|
||||
constructor(name: string, code: number, message: string) {
|
||||
constructor(
|
||||
name: string,
|
||||
code: number,
|
||||
message: string,
|
||||
statusCode?: number
|
||||
) {
|
||||
super(message);
|
||||
|
||||
this.name = name;
|
||||
this.status = code;
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,12 +5,13 @@ import { BaseException } from './base';
|
||||
* 通用异常
|
||||
*/
|
||||
export class CoolCommException extends BaseException {
|
||||
constructor(message: string) {
|
||||
constructor(message: string, statusCode?: number) {
|
||||
const { RESCODE, RESMESSAGE } = GlobalConfig.getInstance();
|
||||
super(
|
||||
'CoolCommException',
|
||||
RESCODE.COMMFAIL,
|
||||
message ? message : RESMESSAGE.COMMFAIL
|
||||
message ? message : RESMESSAGE.COMMFAIL,
|
||||
statusCode
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,12 +5,13 @@ import { BaseException } from './base';
|
||||
* 核心异常
|
||||
*/
|
||||
export class CoolCoreException extends BaseException {
|
||||
constructor(message: string) {
|
||||
constructor(message: string, statusCode?: number) {
|
||||
const { RESCODE, RESMESSAGE } = GlobalConfig.getInstance();
|
||||
super(
|
||||
'CoolCoreException',
|
||||
RESCODE.COREFAIL,
|
||||
message ? message : RESMESSAGE.COREFAIL
|
||||
message ? message : RESMESSAGE.COREFAIL,
|
||||
statusCode
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,12 +5,13 @@ import { BaseException } from './base';
|
||||
* 校验异常
|
||||
*/
|
||||
export class CoolValidateException extends BaseException {
|
||||
constructor(message: string) {
|
||||
constructor(message: string, statusCode?: number) {
|
||||
const { RESCODE, RESMESSAGE } = GlobalConfig.getInstance();
|
||||
super(
|
||||
'CoolValidateException',
|
||||
RESCODE.VALIDATEFAIL,
|
||||
message ? message : RESMESSAGE.VALIDATEFAIL
|
||||
message ? message : RESMESSAGE.VALIDATEFAIL,
|
||||
statusCode
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ export abstract class BaseMysqlService {
|
||||
const {
|
||||
size = this._coolConfig.crud.pageSize,
|
||||
page = 1,
|
||||
order = 'createTime',
|
||||
order = 'id',
|
||||
sort = 'desc',
|
||||
isExport = false,
|
||||
maxExportLimit,
|
||||
@ -182,7 +182,7 @@ export abstract class BaseMysqlService {
|
||||
const {
|
||||
size = this._coolConfig.crud.pageSize,
|
||||
page = 1,
|
||||
order = 'createTime',
|
||||
order = 'id',
|
||||
sort = 'desc',
|
||||
isExport = false,
|
||||
maxExportLimit,
|
||||
@ -360,7 +360,7 @@ export abstract class BaseMysqlService {
|
||||
* @param option
|
||||
*/
|
||||
async getOptionFind(query, option: QueryOp) {
|
||||
let { order = 'createTime', sort = 'desc', keyWord = '' } = query;
|
||||
let { order = 'id', sort = 'desc', keyWord = '' } = query;
|
||||
const sqlArr = ['SELECT'];
|
||||
const selects = ['a.*'];
|
||||
const find = this.entity.createQueryBuilder('a');
|
||||
|
||||
@ -175,7 +175,7 @@ export abstract class BasePgService {
|
||||
const {
|
||||
size = this._coolConfig.crud.pageSize,
|
||||
page = 1,
|
||||
order = 'createTime',
|
||||
order = 'id',
|
||||
sort = 'desc',
|
||||
isExport = false,
|
||||
maxExportLimit,
|
||||
@ -233,7 +233,7 @@ export abstract class BasePgService {
|
||||
const {
|
||||
size = this._coolConfig.crud.pageSize,
|
||||
page = 1,
|
||||
order = 'createTime',
|
||||
order = 'id',
|
||||
sort = 'desc',
|
||||
isExport = false,
|
||||
maxExportLimit,
|
||||
@ -416,7 +416,7 @@ export abstract class BasePgService {
|
||||
* @param option
|
||||
*/
|
||||
async getOptionFind(query, option: QueryOp) {
|
||||
let { order = 'createTime', sort = 'desc', keyWord = '' } = query;
|
||||
let { order = 'id', sort = 'desc', keyWord = '' } = query;
|
||||
const sqlArr = ['SELECT'];
|
||||
const selects = ['a.*'];
|
||||
const find = this.entity.createQueryBuilder('a');
|
||||
|
||||
@ -177,7 +177,7 @@ export abstract class BaseSqliteService {
|
||||
const {
|
||||
size = this._coolConfig.crud.pageSize,
|
||||
page = 1,
|
||||
order = 'createTime',
|
||||
order = 'id',
|
||||
sort = 'desc',
|
||||
isExport = false,
|
||||
maxExportLimit,
|
||||
@ -213,7 +213,7 @@ export abstract class BaseSqliteService {
|
||||
const {
|
||||
size = this._coolConfig.crud.pageSize,
|
||||
page = 1,
|
||||
order = 'createTime',
|
||||
order = 'id',
|
||||
sort = 'desc',
|
||||
isExport = false,
|
||||
maxExportLimit,
|
||||
@ -418,7 +418,7 @@ export abstract class BaseSqliteService {
|
||||
* @param option
|
||||
*/
|
||||
async getOptionFind(query, option: QueryOp) {
|
||||
let { order = 'createTime', sort = 'desc', keyWord = '' } = query;
|
||||
let { order = 'id', sort = 'desc', keyWord = '' } = query;
|
||||
const sqlArr = ['SELECT'];
|
||||
const selects = ['a.*'];
|
||||
const find = this.entity.createQueryBuilder('a');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user