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