feat: 升级midway,支持esm

This commit is contained in:
xiaojunnuo
2024-07-15 00:30:33 +08:00
parent 970c7fd8a0
commit 485e603b51
246 changed files with 3821 additions and 1532 deletions
@@ -1,6 +1,6 @@
import { Inject } from '@midwayjs/decorator';
import { Inject } from '@midwayjs/core';
import { Context } from '@midwayjs/koa';
import { Constants } from './constants';
import { Constants } from './constants.js';
export abstract class BaseController {
@Inject()
@@ -1,10 +1,10 @@
import { ValidateException } from './exception/validation-exception';
import * as _ from 'lodash';
import { PermissionException } from './exception/permission-exception';
import { ValidateException } from './exception/validation-exception.js';
import * as _ from 'lodash-es';
import { PermissionException } from './exception/permission-exception.js';
import { Repository } from 'typeorm';
import { Inject } from '@midwayjs/decorator';
import { Inject } from '@midwayjs/core';
import { TypeORMDataSourceManager } from '@midwayjs/typeorm';
import { EntityManager } from 'typeorm/entity-manager/EntityManager';
import { EntityManager } from 'typeorm/entity-manager/EntityManager.js';
/**
* 服务基类
@@ -1,5 +1,5 @@
import { ALL, Body, Post, Query } from '@midwayjs/decorator';
import { BaseController } from './base-controller';
import { ALL, Body, Post, Query } from '@midwayjs/core';
import { BaseController } from './base-controller.js';
export abstract class CrudController<T> extends BaseController {
abstract getService<T>();
@@ -1,5 +1,5 @@
import { Constants } from '../constants';
import { BaseException } from './base-exception';
import { Constants } from '../constants.js';
import { BaseException } from './base-exception.js';
/**
* 授权异常
*/
@@ -1,5 +1,5 @@
import { Constants } from '../constants';
import { BaseException } from './base-exception';
import { Constants } from '../constants.js';
import { BaseException } from './base-exception.js';
/**
* 通用异常
*/
@@ -1,5 +1,5 @@
import { Constants } from '../constants';
import { BaseException } from './base-exception';
import { Constants } from '../constants.js';
import { BaseException } from './base-exception.js';
/**
* 授权异常
*/
@@ -1,5 +1,5 @@
import { Constants } from '../constants';
import { BaseException } from './base-exception';
import { Constants } from '../constants.js';
import { BaseException } from './base-exception.js';
/**
* 预览模式
*/
@@ -1,5 +1,5 @@
import { Constants } from '../constants';
import { BaseException } from './base-exception';
import { Constants } from '../constants.js';
import { BaseException } from './base-exception.js';
/**
* 校验异常
*/