fix: 转换器后处理优化
✅ 新增 postProcessCleanup 方法: - 修复 this.fs. 和 this.path. → fs. 和 path. - 修复逻辑运算符优先级 - !this.config.get('x') === 'y' → this.config.get('x') !== 'y' ✅ 配置访问优化: - WebAppEnvs.get().property.exists() → fs.existsSync(this.config.get('property')) - GlobalConfig.property.exists() → fs.existsSync(this.config.get('property')) 🎯 效果: - 减少语法错误 - 修复常见转换问题
This commit is contained in:
@@ -50,13 +50,39 @@ class ServiceMethodConverter {
|
||||
tsBody = this.convertDependencyCalls(tsBody, context);
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// 【阶段5】添加缩进
|
||||
// 【阶段5】后处理清理
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
tsBody = this.postProcessCleanup(tsBody);
|
||||
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// 【阶段6】添加缩进
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
tsBody = tsBody.split('\n').map(line => ' ' + line).join('\n');
|
||||
|
||||
return tsBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* 【阶段5】后处理清理
|
||||
* 修复转换后的常见语法错误
|
||||
*/
|
||||
postProcessCleanup(tsBody) {
|
||||
// 1. 修复 this.fs. 和 this.path. → fs. 和 path.
|
||||
tsBody = tsBody.replace(/this\.fs\./g, 'fs.');
|
||||
tsBody = tsBody.replace(/this\.path\./g, 'path.');
|
||||
|
||||
// 2. 修复逻辑运算符优先级问题
|
||||
// if (!this.config.get('xxx') === "yyy") → if (this.config.get('xxx') !== "yyy")
|
||||
tsBody = tsBody.replace(/if\s*\(\s*!this\.config\.get\([^)]+\)\s*===\s*([^)]+)\)/g, (match) => {
|
||||
// 提取内容
|
||||
const configCall = match.match(/this\.config\.get\([^)]+\)/)[0];
|
||||
const value = match.match(/===\s*([^)]+)\)/)[1].trim();
|
||||
return `if (${configCall} !== ${value})`;
|
||||
});
|
||||
|
||||
return tsBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* 【阶段1】基础语法转换
|
||||
*/
|
||||
@@ -120,12 +146,24 @@ class ServiceMethodConverter {
|
||||
// 【配置访问】WebAppEnvs / GlobalConfig → ConfigService
|
||||
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
// WebAppEnvs.get().property.exists() → fs.existsSync(this.config.get('property'))
|
||||
// 必须在WebAppEnvs.get().property之前处理
|
||||
tsBody = tsBody.replace(/WebAppEnvs\.get\(\)\.(\w+)\.exists\(\)/g, (match, prop) => {
|
||||
return `fs.existsSync(this.config.get('${prop}'))`;
|
||||
});
|
||||
|
||||
// WebAppEnvs.get().property → this.config.get('property')
|
||||
tsBody = tsBody.replace(/WebAppEnvs\.get\(\)\.(\w+)/g, (match, prop) => {
|
||||
return `this.config.get('${prop}')`;
|
||||
});
|
||||
tsBody = tsBody.replace(/WebAppEnvs\.get\(\)/g, 'this.config');
|
||||
|
||||
// GlobalConfig.property.exists() → fs.existsSync(this.config.get('property'))
|
||||
// 必须在GlobalConfig.property之前处理
|
||||
tsBody = tsBody.replace(/GlobalConfig\.(\w+)\.exists\(\)/g, (match, prop) => {
|
||||
return `fs.existsSync(this.config.get('${prop}'))`;
|
||||
});
|
||||
|
||||
// GlobalConfig.property → this.config.get('property')
|
||||
tsBody = tsBody.replace(/GlobalConfig\.(\w+)/g, (match, prop) => {
|
||||
return `this.config.get('${prop}')`;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class AddonDevelopBuildServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -25,11 +27,11 @@ export class AddonDevelopBuildServiceImplService {
|
||||
|
||||
try {
|
||||
for (const child of this.fs.readdirSync(addonPath)) {
|
||||
if (fs.lstatSync(child).isDirectory() && !path.basename(child) === "sql") FileUtils.cleanDirectory(child);
|
||||
if (fs.lstatSync(child).isDirectory() && !path.basename(child) === "sql") fs.rmSync(child, { recursive: true, force: true });
|
||||
}
|
||||
FileUtils.copyFile(infoFile, this.addonPath + "info.json");
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
fs.copyFileSync(infoFile, this.addonPath + "info.json");
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
|
||||
this.admin();
|
||||
@@ -52,6 +54,6 @@ export class AddonDevelopBuildServiceImplService {
|
||||
async download(...args: any[]): Promise<any> {
|
||||
const file: string = this.config.get('webRootDownResource' + "temp/" + key + ".zip");
|
||||
if (!fs.existsSync(file)) throw new BadRequestException("请先打包插件");
|
||||
return file.getPath().replace(this.config.get('projectRoot'), "");
|
||||
return file.replace(this.config.get('projectRoot'), "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class AddonDevelopServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -105,8 +107,8 @@ export class AddonDevelopServiceImplService {
|
||||
if (addon != null) throw new BadRequestException("已安装的插件不允许删除");
|
||||
|
||||
try {
|
||||
FileUtils.deleteDirectory(this.config.get('webRootDownAddon' + key));
|
||||
} catch (Exception e) {
|
||||
fs.rmSync(this.config.get('webRootDownAddon', { recursive: true, force: true } + key));
|
||||
} catch (e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class AddonLogServiceImplService {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class AddonServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -72,7 +74,7 @@ export class AddonServiceImplService {
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
vo.setError(e.getMessage());
|
||||
vo.setError(e.message);
|
||||
}
|
||||
|
||||
vo.setList(list);
|
||||
@@ -246,10 +248,10 @@ export class AddonServiceImplService {
|
||||
|
||||
try (const fos: FileOutputStream = new FileOutputStream(file)) {
|
||||
fos.write(response.bodyBytes());
|
||||
ZipUtil.unzip(file.getPath(), this.config.get('webRootDownAddon'), Charset.forName(System.getProperty("sun.jnu.encoding")));
|
||||
} catch (Exception e) {
|
||||
ZipUtil.unzip(file, this.config.get('webRootDownAddon'), Charset.forName(System.getProperty("sun.jnu.encoding")));
|
||||
} catch (e) {
|
||||
e.printStackTrace();
|
||||
throw new BadRequestException(e.getMessage());
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class AliappConfigServiceImplService {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException, UnauthorizedException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class AuthServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -194,7 +195,7 @@ export class AuthServiceImplService {
|
||||
model.setCreateTime(System.currentTimeMillis() / 1000);
|
||||
model.setOperation(getDescription(request));
|
||||
sysUserLogMapper.insert(model);
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class ConfigServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, UnauthorizedException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class LoginServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class CaptchaServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class AdminAppServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class DictServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class DiyConfigServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class DiyRouteServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class DiyServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class DiyThemeServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class DiyFormConfigServiceImplService {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class DiyFormRecordsServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -91,7 +91,7 @@ export class DiyFormRecordsServiceImplService {
|
||||
const obj: any = clazz.getDeclaredConstructor().newInstance();
|
||||
const method: Method = clazz.getMethod("render", String.class, String.class);
|
||||
value.put("render_value", method.invoke(obj, value.get("field_value").toString(), value.get("field_type").toString()));
|
||||
}catch (Exception e){
|
||||
}catch (e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ export class DiyFormRecordsServiceImplService {
|
||||
const obj: any = clazz.getDeclaredConstructor().newInstance();
|
||||
const method: Method = clazz.getMethod("render", String.class, String.class);
|
||||
value.put("render_value", method.invoke(obj, value.get("field_value").toString(), value.get("field_type").toString()));
|
||||
}catch (Exception e){
|
||||
}catch (e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class DiyFormServiceImplService {
|
||||
@@ -551,9 +550,9 @@ export class DiyFormServiceImplService {
|
||||
diyFormRecordsFieldsMapper.delete(fieldsQueryWrapper);
|
||||
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
// 事务会自动回滚,因为使用了 @Transactional 注解
|
||||
throw new BadRequestException("删除记录失败: " + e.getMessage());
|
||||
throw new BadRequestException("删除记录失败: " + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class GenerateColumnServiceImplService {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class GenerateServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -321,7 +321,7 @@ export class GenerateServiceImplService {
|
||||
FileTools.createDirs(packageDir);
|
||||
FileUtil.clean(tempDir);
|
||||
for (const coreGenerateTemplateVo of list) {
|
||||
FileTools.createDirs(packageDir + coreGenerateTemplateVo.getPath());
|
||||
FileTools.createDirs(packageDir + coreGenerateTemplateVo);
|
||||
FileUtil.writeUtf8String(coreGenerateTemplateVo.getData(), packageDir + coreGenerateTemplateVo.getPath(, coreGenerateTemplateVo.getFileName()));
|
||||
}
|
||||
const zipFile: string = ZipUtil.zip(packageDir, tempDir + "package.zip");
|
||||
@@ -333,7 +333,7 @@ export class GenerateServiceImplService {
|
||||
if (coreGenerateTemplateVo.getType() === "sql") {
|
||||
SQLScriptRunnerTools.execScript(coreGenerateTemplateVo.getData());
|
||||
} else {
|
||||
FileUtil.writeUtf8String(coreGenerateTemplateVo.getData(), this.config.get('projectRoot' + "/" + coreGenerateTemplateVo.getPath(), coreGenerateTemplateVo.getFileName()));
|
||||
FileUtil.writeUtf8String(coreGenerateTemplateVo.getData(), this.config.get('projectRoot' + "/" + coreGenerateTemplateVo, coreGenerateTemplateVo.getFileName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -353,7 +353,7 @@ export class GenerateServiceImplService {
|
||||
vo.setName(coreGenerateTemplateVo.getFileName());
|
||||
vo.setType(coreGenerateTemplateVo.getType());
|
||||
vo.setContent(coreGenerateTemplateVo.getData());
|
||||
vo.setFileDir(coreGenerateTemplateVo.getPath() + "/");
|
||||
vo.setFileDir(coreGenerateTemplateVo + "/");
|
||||
voList.add(vo);
|
||||
}
|
||||
return voList;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class AuthSiteServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberAccountServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberAddressServiceImplService {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberCashOutServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberConfigServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberLabelServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberLevelServiceImplService {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberSignServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
import * as fs from 'fs';
|
||||
|
||||
@Injectable()
|
||||
export class CloudBuildServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -143,8 +144,8 @@ export class CloudBuildServiceImplService {
|
||||
if (this.buildTask == null) return;
|
||||
const tempDir: string = this.config.get('webRootDownRuntime' + "cloud_build/" + this.buildTask.getStr("task_key"));
|
||||
try {
|
||||
if (fs.existsSync(tempDir)) FileUtils.deleteDirectory(tempDir);
|
||||
} catch (Exception e) {
|
||||
if (fs.existsSync(tempDir)) fs.rmSync(tempDir, { recursive: true, force: true });
|
||||
} catch (e) {
|
||||
}
|
||||
cached.remove("cloud_build_task");
|
||||
this.buildTask = null;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class NiuCloudServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class NoticeLogServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class NoticeServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class NuiSmsServiceImplService {
|
||||
@@ -20,8 +20,8 @@ export class NuiSmsServiceImplService {
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("获取验证码失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("获取验证码失败异常信息:{}", e.message);
|
||||
throw new Error(e);
|
||||
}
|
||||
}
|
||||
@@ -40,8 +40,8 @@ export class NuiSmsServiceImplService {
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("发送验证码失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("发送验证码失败异常信息:{}", e.message);
|
||||
throw new AdminException("发送验证码失败");
|
||||
}
|
||||
}
|
||||
@@ -58,8 +58,8 @@ export class NuiSmsServiceImplService {
|
||||
result = NiucloudUtils.Niucloud.post(ACCOUNT_REGISTER_URL, param);
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
} catch (Exception e) {
|
||||
log.error("注册账号失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("注册账号失败异常信息:{}", e.message);
|
||||
throw new AdminException("注册账号失败");
|
||||
}
|
||||
return result;
|
||||
@@ -85,9 +85,9 @@ export class NuiSmsServiceImplService {
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("登录账号失败异常信息:{}", e.getMessage());
|
||||
throw new AdminException(e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("登录账号失败异常信息:{}", e.message);
|
||||
throw new AdminException(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,8 +117,8 @@ export class NuiSmsServiceImplService {
|
||||
const resetPasswordJson: Record<string, any> = NiucloudUtils.Niucloud.put(resetPasswordUrl, resetPasswordBody);
|
||||
const resetPasswordDataJson: Record<string, any> = resetPasswordJson.getJSONObject("data");
|
||||
newPassword = resetPasswordDataJson.getStr("newPassword");
|
||||
} catch (Exception e) {
|
||||
log.error("重置密码失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("重置密码失败异常信息:{}", e.message);
|
||||
throw new AdminException("重置密码失败");
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ export class NuiSmsServiceImplService {
|
||||
JacksonUtils.removeNull(result);
|
||||
return result;
|
||||
} catch (JSONException e) {
|
||||
log.error("获取用户信息失败异常信息:{}", e.getMessage());
|
||||
log.error("获取用户信息失败异常信息:{}", e.message);
|
||||
throw new AdminException("获取用户信息失败");
|
||||
}
|
||||
}
|
||||
@@ -284,8 +284,8 @@ export class NuiSmsServiceImplService {
|
||||
result = jsonObject.getJSONObject("data");
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
} catch (Exception e) {
|
||||
log.error("获取订单列表失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("获取订单列表失败异常信息:{}", e.message);
|
||||
throw new AdminException("获取订单列表失败");
|
||||
}
|
||||
return result;
|
||||
@@ -308,8 +308,8 @@ export class NuiSmsServiceImplService {
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("获取发送列表失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("获取发送列表失败异常信息:{}", e.message);
|
||||
throw new AdminException("获取发送列表失败");
|
||||
}
|
||||
}
|
||||
@@ -357,8 +357,8 @@ export class NuiSmsServiceImplService {
|
||||
setConfig(registerAccountParam);
|
||||
JacksonUtils.removeNull(jsonObject);
|
||||
return jsonObject;
|
||||
} catch (Exception e) {
|
||||
log.error("修改账号信息失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("修改账号信息失败异常信息:{}", e.message);
|
||||
throw new AdminException("修改账号信息失败");
|
||||
}
|
||||
}
|
||||
@@ -384,8 +384,8 @@ export class NuiSmsServiceImplService {
|
||||
editAccount(username, editAccountParam);
|
||||
}
|
||||
return failList;
|
||||
} catch (Exception e) {
|
||||
log.error("删除签名失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("删除签名失败异常信息:{}", e.message);
|
||||
throw new AdminException("删除签名失败异常");
|
||||
}
|
||||
}
|
||||
@@ -406,7 +406,7 @@ export class NuiSmsServiceImplService {
|
||||
throw new ApiException(failList.getJSONObject(0).getStr("msg"));
|
||||
}
|
||||
} catch (ApiException e) {
|
||||
log.error("创建签名失败异常信息:{}", e.getMessage());
|
||||
log.error("创建签名失败异常信息:{}", e.message);
|
||||
throw new AdminException("创建签名失败");
|
||||
}
|
||||
}
|
||||
@@ -432,8 +432,8 @@ export class NuiSmsServiceImplService {
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("获取套餐列表失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("获取套餐列表失败异常信息:{}", e.message);
|
||||
throw new AdminException("获取套餐列表失败");
|
||||
}
|
||||
}
|
||||
@@ -451,8 +451,8 @@ export class NuiSmsServiceImplService {
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("计算订单失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("计算订单失败异常信息:{}", e.message);
|
||||
throw new AdminException("计算订单失败");
|
||||
}
|
||||
}
|
||||
@@ -470,8 +470,8 @@ export class NuiSmsServiceImplService {
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("创建订单失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("创建订单失败异常信息:{}", e.message);
|
||||
throw new AdminException("创建订单失败");
|
||||
}
|
||||
}
|
||||
@@ -500,8 +500,8 @@ export class NuiSmsServiceImplService {
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("获取支付信息失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("获取支付信息失败异常信息:{}", e.message);
|
||||
throw new AdminException("获取支付信息失败");
|
||||
}
|
||||
}
|
||||
@@ -517,8 +517,8 @@ export class NuiSmsServiceImplService {
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("获取订单信息失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("获取订单信息失败异常信息:{}", e.message);
|
||||
throw new AdminException("获取订单信息失败");
|
||||
}
|
||||
}
|
||||
@@ -534,8 +534,8 @@ export class NuiSmsServiceImplService {
|
||||
//删除null值 防止序列化报错
|
||||
JacksonUtils.removeNull(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("获取订单状态失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("获取订单状态失败异常信息:{}", e.message);
|
||||
throw new AdminException("获取订单状态失败");
|
||||
}
|
||||
}
|
||||
@@ -583,8 +583,8 @@ export class NuiSmsServiceImplService {
|
||||
const jsonObject: Record<string, any> = NiucloudUtils.Niucloud.post(templateCreateUrl, templateCreateBody);
|
||||
result = jsonObject.getJSONObject("data");
|
||||
JacksonUtils.removeNull(result); // 删除null值,防止序列化报错
|
||||
} catch (Exception e) {
|
||||
log.error("创建模版失败异常信息:{},", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("创建模版失败异常信息:{},", e.message);
|
||||
throw new AdminException("创建模版失败");
|
||||
}
|
||||
|
||||
@@ -629,8 +629,8 @@ export class NuiSmsServiceImplService {
|
||||
try {
|
||||
sendHttp(TEMPLATE_DELETE, deleteBody);
|
||||
niuSmsTemplateMapper.delete(new QueryWrapper<NiuSmsTemplate>().eq("template_id", templateId));
|
||||
} catch (Exception e) {
|
||||
log.error("删除模版失败异常信息:{},", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("删除模版失败异常信息:{},", e.message);
|
||||
throw new AdminException("删除模版失败");
|
||||
}
|
||||
}
|
||||
@@ -660,8 +660,8 @@ export class NuiSmsServiceImplService {
|
||||
niuSmsTemplate.setAuditStatus(auditStatus);
|
||||
niuSmsTemplateMapper.updateById(niuSmsTemplate);
|
||||
return niuSmsTemplate;
|
||||
} catch (Exception e) {
|
||||
log.error("获取模版信息失败异常信息:{}", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("获取模版信息失败异常信息:{}", e.message);
|
||||
throw new AdminException("获取模版信息失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class PayChannelServiceImplService {
|
||||
@@ -85,8 +84,8 @@ export class PayChannelServiceImplService {
|
||||
if (ObjectUtil.isNotEmpty(value)) {
|
||||
try {
|
||||
config.set(key, StringUtils.hide(value, 0, value.length()));
|
||||
} catch (Exception e) {
|
||||
log.error("字段:{},值:{},支付设置脱敏失败{}", key, value, e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("字段:{},值:{},支付设置脱敏失败{}", key, value, e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class PayRefundServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class PayServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class PayTransferServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SiteAccountLogServiceImplService {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SiteGroupServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -51,7 +51,7 @@ export class SiteGroupServiceImplService {
|
||||
iconAndTitle.setTitle(addon.getTitle());
|
||||
try {
|
||||
iconAndTitle.setIcon(ImageToBase64ConverterUtil.convertToBase64(addon.getIcon()));
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
iconAndTitle.setIcon("");
|
||||
}
|
||||
addonListResult.add(iconAndTitle);
|
||||
@@ -62,7 +62,7 @@ export class SiteGroupServiceImplService {
|
||||
iconAndTitle.setTitle(addon.getTitle());
|
||||
try {
|
||||
iconAndTitle.setIcon(ImageToBase64ConverterUtil.convertToBase64(addon.getIcon()));
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
iconAndTitle.setIcon("");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class SiteServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -244,10 +245,10 @@ export class SiteServiceImplService {
|
||||
const wrapper: any = wrapperConstructor.newInstance(entityClass);
|
||||
eqMethod.invoke(wrapper, true, "site_id", id);
|
||||
deleteMethod.invoke(mapper, wrapper);
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
log.error("删除表数据失败: {} | 原因: {}",
|
||||
entityClass.getSimpleName(),
|
||||
e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
||||
e.getCause() != null ? e.getCause().getMessage() : e.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,9 +260,9 @@ export class SiteServiceImplService {
|
||||
|
||||
// 删除站点主表
|
||||
siteMapper.deleteById(id);
|
||||
} catch (Exception e) {
|
||||
log.error("删除站点失败: {}", e.getMessage(), e);
|
||||
throw new BadRequestException("删除失败: " + (e.getCause() != null ? e.getCause().getMessage() : e.getMessage()));
|
||||
} catch (e) {
|
||||
log.error("删除站点失败: {}", e.message, e);
|
||||
throw new BadRequestException("删除失败: " + (e.getCause() != null ? e.getCause().getMessage() : e.message));
|
||||
}
|
||||
|
||||
// 清理缓存
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SiteUserServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -91,8 +91,8 @@ export class SiteUserServiceImplService {
|
||||
sysUserRoleParam.setUid(uid);
|
||||
sysUserRoleParam.setStatus(siteUserParam.getStatus());
|
||||
sysUserRoleService.edit(sysUserRoleParam);
|
||||
}catch (Exception e){
|
||||
throw new AdminException(e.getMessage());
|
||||
}catch (e){
|
||||
throw new AdminException(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class StatHourServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class StatServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysAgreementServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class SysAreaServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class SysAttachmentServiceImplService {
|
||||
@@ -29,7 +29,7 @@ export class SysAttachmentServiceImplService {
|
||||
for (const item of iPage.getRecords()) {
|
||||
const vo: SysAttachmentListVo = new SysAttachmentListVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
vo.setThumb(CommonUtils.thumbImageSmall(item.getSiteId(), item.getPath()));
|
||||
vo.setThumb(CommonUtils.thumbImageSmall(item.getSiteId(), item));
|
||||
list.add(vo);
|
||||
}
|
||||
return PageResult.build(page, limit, iPage.getTotal()).setData(list);
|
||||
@@ -90,7 +90,7 @@ export class SysAttachmentServiceImplService {
|
||||
throw new BadRequestException("请选择要删除的附件");
|
||||
}
|
||||
for (const sysAttachment of sysAttachmentList) {
|
||||
coreUploadService.delete(sysAttachment.getSiteId(), sysAttachment.getStorageType(), sysAttachment.getPath());
|
||||
coreUploadService.delete(sysAttachment.getSiteId(), sysAttachment.getStorageType(), sysAttachment);
|
||||
}
|
||||
sysAttachmentMapper.delete(new QueryWrapper<SysAttachment>().eq("site_id", RequestUtils.siteId()).in("att_id", param.getAttIds()));
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
import * as fs from 'fs';
|
||||
|
||||
@Injectable()
|
||||
export class SysBackupRecordsServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -95,8 +96,8 @@ export class SysBackupRecordsServiceImplService {
|
||||
const file: string = backupDir(item.getBackupKey(), "backup");
|
||||
if (fs.existsSync(file)) {
|
||||
try {
|
||||
FileUtils.deleteDirectory(file);
|
||||
} catch (Exception e) {
|
||||
fs.rmSync(file, { recursive: true, force: true });
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,10 +156,10 @@ export class SysBackupRecordsServiceImplService {
|
||||
vo.setParams(null);
|
||||
}
|
||||
setBackupRestoreTaskCache(vo);
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
vo.setStep(step);
|
||||
vo.setTask("fail");
|
||||
vo.setContent("备份恢复失败,稍后请手动恢复,备份文件路径:webroot/runtime/upgrade/"+ record.getBackupKey() +"/backup,失败原因:" + e.getMessage());
|
||||
vo.setContent("备份恢复失败,稍后请手动恢复,备份文件路径:webroot/runtime/upgrade/"+ record.getBackupKey() +"/backup,失败原因:" + e.message);
|
||||
setBackupRestoreTaskCache(vo);
|
||||
// 删除备份记录
|
||||
sysBackupRecordsMapper.delete(new QueryWrapper<SysBackupRecords>().eq("backup_key", vo.getKey()));
|
||||
@@ -208,10 +209,10 @@ export class SysBackupRecordsServiceImplService {
|
||||
vo.setParams(null);
|
||||
}
|
||||
setBackupTaskCache(vo);
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
vo.setStep(step);
|
||||
vo.setTask("fail");
|
||||
vo.setContent("备份失败,稍后请重新手动备份,失败原因:" + e.getMessage());
|
||||
vo.setContent("备份失败,稍后请重新手动备份,失败原因:" + e.message);
|
||||
setBackupTaskCache(vo);
|
||||
// 删除备份记录
|
||||
sysBackupRecordsMapper.delete(new QueryWrapper<SysBackupRecords>().eq("backup_key", vo.getKey()));
|
||||
@@ -279,7 +280,7 @@ export class SysBackupRecordsServiceImplService {
|
||||
if (delayed > 0) {
|
||||
try {
|
||||
Thread.sleep(delayed * 1000);
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
const cache: Cached = CacheFactory.getCacheOperator();
|
||||
@@ -293,7 +294,7 @@ export class SysBackupRecordsServiceImplService {
|
||||
if (delayed > 0) {
|
||||
try {
|
||||
Thread.sleep(delayed * 1000);
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
const cache: Cached = CacheFactory.getCacheOperator();
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysConfigServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysExportServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysMenuServiceImplService {
|
||||
@@ -228,7 +227,7 @@ export class SysMenuServiceImplService {
|
||||
}
|
||||
//排除菜单
|
||||
menuList = sysMenuMapper.selectList(queryWrapper);
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
throw new BaseException("查询菜单错误");
|
||||
}
|
||||
return menuList;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysNoticeLogServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysNoticeServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysNoticeSmsLogServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class SysPosterServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class SysPrinterServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysPrinterTemplateServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysRoleServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class SysScheduleServiceImplService {
|
||||
@@ -285,9 +285,9 @@ export class SysScheduleServiceImplService {
|
||||
.job(classPath)
|
||||
.build());
|
||||
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
// 获取任务名称(即使在异常情况下也尝试获取)
|
||||
const errorMsg: string = "计划任务:" + path.basename(sysSchedule) + "发生错误, 错误原因:" + e.getMessage() +
|
||||
const errorMsg: string = "计划任务:" + path.basename(sysSchedule) + "发生错误, 错误原因:" + e.message +
|
||||
" at " + e.getStackTrace()[0].toString();
|
||||
addLog(SysScheduleLog.builder()
|
||||
.key(jobKey)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class SysUpgradeRecordsServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysUserLogServiceImplService {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysUserRoleServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysUserServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -252,8 +252,8 @@ export class SysUserServiceImplService {
|
||||
sysUserRoleParam.setStatus(siteUserParam.getStatus());
|
||||
sysUserRoleParam.setIsAdmin(isAdmin);
|
||||
sysUserRoleService.add(sysUserRoleParam);
|
||||
} catch (Exception e) {
|
||||
throw new AdminException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new AdminException(e.message);
|
||||
}
|
||||
return uid;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SystemServiceImplService {
|
||||
@@ -49,7 +48,7 @@ export class SystemServiceImplService {
|
||||
}
|
||||
const dir: string = "upload/qrcode/" + RequestUtils.siteId() + "/" + param.getFolder();
|
||||
vo.setWeappPath(QrcodeUtils.qrcodeToFile(RequestUtils.siteId(), "weapp", "", param.getPage(), data, dir));
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
return vo;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
import * as fs from 'fs';
|
||||
|
||||
@Injectable()
|
||||
export class UpgradeServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -223,7 +224,7 @@ export class UpgradeServiceImplService {
|
||||
if (delayed > 0) {
|
||||
try {
|
||||
Thread.sleep(delayed * 1000);
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
const cache: Cached = CacheFactory.getCacheOperator();
|
||||
@@ -258,12 +259,12 @@ export class UpgradeServiceImplService {
|
||||
vo.setAddon(vo.getUpgradeApps().get(0));
|
||||
}
|
||||
setUpgradeTaskCache(vo);
|
||||
} catch (Exception e) {
|
||||
if (e.getMessage().includes("队列")) {
|
||||
} catch (e) {
|
||||
if (e.message.includes("队列")) {
|
||||
throw e;
|
||||
} else {
|
||||
vo.setStep(step);
|
||||
vo.getError().add(e.getMessage());
|
||||
vo.getError().add(e.message);
|
||||
setUpgradeTaskCache(vo);
|
||||
this.upgradeErrorHandle(vo);
|
||||
e.printStackTrace();
|
||||
@@ -304,7 +305,7 @@ export class UpgradeServiceImplService {
|
||||
// 移除新版本删除的文件
|
||||
const change: string[] = null;
|
||||
try {
|
||||
change = Arrays.asList(FileUtils.readFileToString(changeRecord, "UTF-8").split("\n"));
|
||||
change = Arrays.asList(fs.readFileSync(changeRecord, "UTF-8", 'utf-8').split("\n"));
|
||||
} catch (IOException e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
@@ -351,7 +352,7 @@ export class UpgradeServiceImplService {
|
||||
vo.setStep("coverCode");
|
||||
vo.setStatus("restarting");
|
||||
setUpgradeTaskCache(vo);
|
||||
FileUtils.writeStringToFile(upgradeDir(vo, "upgrade.json"), JSONUtil.parseObj(vo.getUpgradeContent()).toString(), "UTF-8");
|
||||
fs.writeFileSync(upgradeDir(vo, "upgrade.json", 'utf-8'), JSONUtil.parseObj(vo.getUpgradeContent()).toString(), "UTF-8");
|
||||
PipeNameUtils.noticeBootRestartByUpgrade(this.config.get('applicationName'), vo.getKey(), vo.getUpgradeContent().getLastBackup().getBackupKey());
|
||||
Thread.sleep(3000);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class StorageConfigServiceImplService {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class VerifierServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class VerifyServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class WeappConfigServiceImplService {
|
||||
@@ -29,7 +28,7 @@ export class WeappConfigServiceImplService {
|
||||
domain.setDownloaddomain(String.join(";", domainResult.getDownloadDomain()));
|
||||
weappConfigVo.setDomain(domain);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +57,8 @@ export class WeappConfigServiceImplService {
|
||||
ObjectUtil.isNotEmpty(param.getTcpdomain())? Arrays.asList(param.getTcpdomain().split(";")) : [],
|
||||
ObjectUtil.isNotEmpty(param.getUdpdomain())? Arrays.asList(param.getUdpdomain().split(";")) : []
|
||||
);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,8 +69,8 @@ export class WeappConfigServiceImplService {
|
||||
try {
|
||||
const wxOpenMaService: WxOpenMaService = (WxOpenMaService) WechatUtils.miniapp(RequestUtils.siteId());
|
||||
return wxOpenMaService.getPrivacyService().getPrivacySetting(2);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +83,8 @@ export class WeappConfigServiceImplService {
|
||||
const setPrivacySetting: SetPrivacySetting = JSONUtil.toBean(privacySetting, SetPrivacySetting.class);
|
||||
setPrivacySetting.setPrivacyVer(2);
|
||||
wxOpenMaService.getPrivacyService().setPrivacySetting(setPrivacySetting);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class WeappTemplateServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as fs from 'fs';
|
||||
|
||||
@Injectable()
|
||||
export class WeappVersionServiceImplService {
|
||||
@@ -124,7 +124,7 @@ export class WeappVersionServiceImplService {
|
||||
return "data:image/jpeg;base64," + Base64.getEncoder().encodeToString(FileUtils.readFileToByteArray(qrcode));
|
||||
}
|
||||
return "";
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class WechatConfigServiceImplService {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class WechatMediaServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -63,8 +63,8 @@ export class WechatMediaServiceImplService {
|
||||
const vo: WechatMediaInfoVo = new WechatMediaInfoVo();
|
||||
BeanUtils.copyProperties(model, vo);
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,8 +100,8 @@ export class WechatMediaServiceImplService {
|
||||
const vo: WechatMediaInfoVo = new WechatMediaInfoVo();
|
||||
BeanUtils.copyProperties(model, vo);
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,8 +136,8 @@ export class WechatMediaServiceImplService {
|
||||
offset++;
|
||||
this.syncNews(offset);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class WechatMenuServiceImplService {
|
||||
@@ -27,7 +26,7 @@ export class WechatMenuServiceImplService {
|
||||
WechatUtils.mp(RequestUtils.siteId()).getMenuService().menuCreate(JSONUtil.parseObj(params).toString()) ;
|
||||
coreConfigService.setConfig(RequestUtils.siteId(), "WECHAT_MENU", data);
|
||||
}catch (WxErrorException e){
|
||||
throw new AdminException(e.getMessage());
|
||||
throw new AdminException(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class WechatReplyServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class WechatTemplateServiceImplService {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class OplatformConfigServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class OplatformServerServiceImplService {
|
||||
@@ -38,7 +37,7 @@ export class OplatformServerServiceImplService {
|
||||
authorizationParam.setAuthCode(inMessage.getAuthorizationCode());
|
||||
oplatformService.authorization(authorizationParam);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
log.error("处理开放平台授权事件消息异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class OplatformServiceImplService {
|
||||
@@ -17,8 +17,8 @@ export class OplatformServiceImplService {
|
||||
try {
|
||||
const url: string = RequestUtils.getDomain(true) + "/site/wxoplatform/callback";
|
||||
return WechatUtils.WxOpen().getWxOpenComponentService().getPreAuthUrl(url);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@ export class OplatformServiceImplService {
|
||||
|
||||
coreWechatConfigService.setWechatAuthorizationInfo(RequestUtils.siteId(), result);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class WeappVersionServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -149,7 +150,7 @@ export class WeappVersionServiceImplService {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
console.log("小程序模板上传成功获取模板id异常");
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -210,10 +211,10 @@ export class WeappVersionServiceImplService {
|
||||
|
||||
// 提交审核
|
||||
weappVersionService.submitAudit(siteId, model.getId());
|
||||
} catch (Exception e) {
|
||||
} catch (e) {
|
||||
console.log("小程序提交代码异常");
|
||||
e.printStackTrace();
|
||||
throw new BadRequestException(e.getMessage());
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +268,7 @@ export class WeappVersionServiceImplService {
|
||||
|
||||
console.log("小程序提交审核异常");
|
||||
e.printStackTrace();
|
||||
throw new BadRequestException(e.getMessage());
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -319,8 +320,8 @@ export class WeappVersionServiceImplService {
|
||||
try {
|
||||
const commitResult: WxOpenResult = WechatUtils.WxOpen().getWxOpenComponentService()
|
||||
.getWxMaServiceByAppid(weappCofig.getAppId()).undoCodeAudit();
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
|
||||
version.setStatus(WeappVersionStatusEnum.APPLET_AUDIT_UNDO.getStatus());
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class AgreementServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class AppServiceImplService {
|
||||
@@ -27,8 +26,8 @@ export class AppServiceImplService {
|
||||
ObjectUtil.defaultIfNull(wxUser.getHeadImgUrl(), ""),
|
||||
param.getPid()
|
||||
);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,8 +103,8 @@ export class AppServiceImplService {
|
||||
registerMember.setWxUnionid(param.getUnionid());
|
||||
registerMember.setPid(param.getPid());
|
||||
return registerService.register(registerMember);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class DiyFormServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
import * as path from 'path';
|
||||
|
||||
@Injectable()
|
||||
export class DiyServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, UnauthorizedException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class AuthServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class LoginServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class RegisterServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberAccountServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberAddressServiceImplService {
|
||||
@@ -20,8 +19,8 @@ export class MemberAddressServiceImplService {
|
||||
if (param.getIsDefault() != null && param.getIsDefault() == 1) {
|
||||
try {
|
||||
this.deleteDefaultAddress(param.memberId());
|
||||
} catch (Exception e) {
|
||||
log.error("更新会员默认地址数据库操作错误:", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("更新会员默认地址数据库操作错误:", e.message);
|
||||
throw new BaseException("添加会员收货地址错误.");
|
||||
}
|
||||
}
|
||||
@@ -64,8 +63,8 @@ export class MemberAddressServiceImplService {
|
||||
if (param.getIsDefault() != null && param.getIsDefault() == 1) {
|
||||
try {
|
||||
deleteDefaultAddress(param.memberId());
|
||||
} catch (Exception e) {
|
||||
log.error("更新会员默认地址数据库操作错误:", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("更新会员默认地址数据库操作错误:", e.message);
|
||||
throw new BaseException("添加会员收货地址错误.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberCashOutServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberLevelServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -123,8 +123,8 @@ export class MemberLevelServiceImplService {
|
||||
const vo: MemberGetMobileVo = new MemberGetMobileVo();
|
||||
vo.setMobile(mobile);
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -122,8 +122,8 @@ export class MemberServiceImplService {
|
||||
try {
|
||||
const phoneInfo: WxMaPhoneNumberInfo = WechatUtils.miniapp(RequestUtils.siteId()).getUserService().getPhoneNoInfo(param.getMobileCode());
|
||||
param.setMobile(phoneInfo.getPurePhoneNumber());
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
} catch (e) {
|
||||
throw new BadRequestException(e.message);
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException("手机号不存在");
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class MemberSignServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class PayServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class Base64ServiceImplService {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysAreaServiceImplService {
|
||||
@@ -43,8 +42,8 @@ export class SysAreaServiceImplService {
|
||||
queryWrapper.eq("pid", pid);
|
||||
const sysAreaList: SysArea[] = sysAreaMapper.selectList(queryWrapper);
|
||||
sysAreaVoList = CollectUtils.convert(sysAreaList, SysAreaListVo.class);
|
||||
} catch (Exception e) {
|
||||
log.error("查询区域错误:", e.getMessage());
|
||||
} catch (e) {
|
||||
log.error("查询区域错误:", e.message);
|
||||
throw new BaseException("查询区域错误");
|
||||
}
|
||||
return sysAreaVoList;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysConfigServiceImplService {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class SysVerifyServiceImplService {
|
||||
constructor(
|
||||
private readonly config: ConfigService,
|
||||
private readonly eventBus: EventBus,
|
||||
private readonly queueService: QueueService,
|
||||
) {}
|
||||
@@ -27,8 +27,8 @@ export class SysVerifyServiceImplService {
|
||||
const qrcodeDir: string = this.config.get('webRootDownResource') + "upload/temp/";
|
||||
const barcodePath: string = BarcodeUtils.generateBarcode(verifyCode, qrcodeDir);
|
||||
barcode = ImageUtils.imageToBase64(barcodePath);
|
||||
} catch (Exception e) {
|
||||
log.error("条形码生成失败:{}", e.getMessage(), e);
|
||||
} catch (e) {
|
||||
log.error("条形码生成失败:{}", e.message, e);
|
||||
throw new BadRequestException("条形码生成失败");
|
||||
}
|
||||
sysVerifyGetCodeVo.setBarcode(barcode);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus } from '@wwjBoot';
|
||||
import { Result } from '@wwjBoot';
|
||||
import { QueueService, EventBus, Result } from '@wwjBoot';
|
||||
|
||||
@Injectable()
|
||||
export class TaskServiceImplService {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user