feat: 开发user、auth相关接口,初始化后台管理项目admin
This commit is contained in:
@@ -32,7 +32,7 @@ export class BrokerService {
|
||||
|
||||
if (existingByCode) {
|
||||
throw new ConflictException(
|
||||
`Broker with code "${createBrokerDto.brokerCode}" already exists in region "${createBrokerDto.region}"`,
|
||||
`地区 "${createBrokerDto.region}" 中已存在代码为 "${createBrokerDto.brokerCode}" 的券商`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export class BrokerService {
|
||||
|
||||
if (existingByName) {
|
||||
throw new ConflictException(
|
||||
`Broker with name "${createBrokerDto.brokerName}" already exists in region "${createBrokerDto.region}"`,
|
||||
`地区 "${createBrokerDto.region}" 中已存在名称为 "${createBrokerDto.brokerName}" 的券商`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -88,10 +88,10 @@ export class BrokerService {
|
||||
|
||||
if (existingBrokers.length > 0) {
|
||||
const conflicts = existingBrokers.map(
|
||||
(b) => `${b.brokerCode} in ${b.region}`,
|
||||
(b) => `${b.brokerCode} (${b.region})`,
|
||||
);
|
||||
throw new ConflictException(
|
||||
`The following brokers already exist: ${conflicts.join(', ')}`,
|
||||
`以下券商已存在:${conflicts.join('、')}`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ export class BrokerService {
|
||||
);
|
||||
if (uniquePairs.size !== codeRegionPairs.length) {
|
||||
throw new ConflictException(
|
||||
'Duplicate broker_code and region combinations in batch data',
|
||||
'批量数据中存在重复的券商代码和地区组合',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ export class BrokerService {
|
||||
});
|
||||
|
||||
if (!broker) {
|
||||
throw new NotFoundException(`Broker with ID ${id} not found`);
|
||||
throw new NotFoundException(`未找到ID为 ${id} 的券商`);
|
||||
}
|
||||
|
||||
return broker;
|
||||
@@ -187,9 +187,7 @@ export class BrokerService {
|
||||
const broker = await this.brokerRepository.findOne({ where });
|
||||
|
||||
if (!broker) {
|
||||
throw new NotFoundException(
|
||||
'Broker not found with the given conditions',
|
||||
);
|
||||
throw new NotFoundException('未找到符合给定条件的券商');
|
||||
}
|
||||
|
||||
return broker;
|
||||
@@ -218,7 +216,7 @@ export class BrokerService {
|
||||
|
||||
if (existing && existing.brokerId !== id) {
|
||||
throw new ConflictException(
|
||||
`Broker with code "${newCode}" already exists in region "${newRegion}"`,
|
||||
`地区 "${newRegion}" 中已存在代码为 "${newCode}" 的券商`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -237,7 +235,7 @@ export class BrokerService {
|
||||
|
||||
if (existing && existing.brokerId !== id) {
|
||||
throw new ConflictException(
|
||||
`Broker with name "${newName}" already exists in region "${newRegion}"`,
|
||||
`地区 "${newRegion}" 中已存在名称为 "${newName}" 的券商`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user