|
@@ -4,17 +4,20 @@ import { ConfigService } from '../../service/system/config.service';
|
|
|
import { CDTO_config, CVO_config, FVO_config, UDTO_config, UVAO_config } from '../../interface/system/config.interface';
|
|
|
import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
|
|
|
import { Validate } from '@midwayjs/validate';
|
|
|
+import { FrameErrorEnum } from '../../error/frame.error';
|
|
|
+import { I18nService } from '../../service/i18n.service';
|
|
|
@ApiTags(['设置表'])
|
|
|
@Controller('/config')
|
|
|
export class ConfigController extends BaseController {
|
|
|
@Inject()
|
|
|
service: ConfigService;
|
|
|
-
|
|
|
+ @Inject()
|
|
|
+ i18n: I18nService;
|
|
|
@Post('/')
|
|
|
@Validate()
|
|
|
@ApiResponse({ type: CVO_config })
|
|
|
async create(@Body() data: CDTO_config) {
|
|
|
- throw new ServiceError('功能暂不开放', FrameworkErrorEnum.SERVICE_FAULT);
|
|
|
+ throw new ServiceError(this.i18n.translateError(FrameErrorEnum.SERVICE_CANT_USE), FrameErrorEnum.SERVICE_CANT_USE);
|
|
|
// const dbData = await this.service.create(data);
|
|
|
// const result = new CVO_config(dbData);
|
|
|
// return result;
|
|
@@ -31,7 +34,7 @@ export class ConfigController extends BaseController {
|
|
|
@Get('/:id')
|
|
|
@ApiResponse({ type: FVO_config })
|
|
|
async fetch(@Param('id') id: string) {
|
|
|
- throw new ServiceError('功能暂不开放', FrameworkErrorEnum.SERVICE_FAULT);
|
|
|
+ throw new ServiceError(this.i18n.translateError(FrameErrorEnum.SERVICE_CANT_USE), FrameErrorEnum.SERVICE_CANT_USE);
|
|
|
// const data = await this.service.fetch(id);
|
|
|
// const result = new FVO_config(data);
|
|
|
// return result;
|