|
@@ -20,10 +20,10 @@ export class MatchExtService extends BaseServiceV2 {
|
|
|
userService: UserService;
|
|
|
/**获取用户信息的属性 */
|
|
|
async getUserProps(id, props) {
|
|
|
- if (!props) return
|
|
|
- const user = await this.userService.fetch({ id })
|
|
|
- if (!user) return
|
|
|
- const obj = pick(user, props)
|
|
|
+ if (!props) return;
|
|
|
+ const user = await this.userService.fetch({ id });
|
|
|
+ if (!user) return;
|
|
|
+ const obj = pick(user, props);
|
|
|
return obj;
|
|
|
}
|
|
|
/**
|
|
@@ -32,14 +32,14 @@ export class MatchExtService extends BaseServiceV2 {
|
|
|
* @param status 赛事应处于的状态码
|
|
|
*/
|
|
|
async checkMatchStatus(id, status) {
|
|
|
- const data = await this.matchService.fetch({ id })
|
|
|
+ const data = await this.matchService.fetch({ id });
|
|
|
if (!data) {
|
|
|
throw new ServiceError(ErrorCode.MATCH_NOT_FOUND);
|
|
|
}
|
|
|
const data_status = get(data, 'status');
|
|
|
- if (status != data_status) {
|
|
|
+ if (status !== data_status) {
|
|
|
// 抛出异常: 赛事状态不符合要求.
|
|
|
- throw new ServiceError(ErrorCode.MATCH_STATUS_ERROR)
|
|
|
+ throw new ServiceError(ErrorCode.MATCH_STATUS_ERROR);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -50,14 +50,14 @@ export class MatchExtService extends BaseServiceV2 {
|
|
|
* @param status 赛事拓展应处于的状态码
|
|
|
*/
|
|
|
async checkMatchExtStatus(match_id, status) {
|
|
|
- const data = await this.fetch({ match_id })
|
|
|
+ const data = await this.fetch({ match_id });
|
|
|
if (!data) {
|
|
|
throw new ServiceError(ErrorCode.MATCH_NOT_FOUND);
|
|
|
}
|
|
|
const data_status = get(data, 'status');
|
|
|
- if (status != data_status) {
|
|
|
+ if (status !== data_status) {
|
|
|
// 抛出异常: 赛事拓展状态不符合要求.
|
|
|
- throw new ServiceError(ErrorCode.MATCH_EXT_STATUS_ERROR)
|
|
|
+ throw new ServiceError(ErrorCode.MATCH_EXT_STATUS_ERROR);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -67,16 +67,15 @@ export class MatchExtService extends BaseServiceV2 {
|
|
|
* @param status 赛事报名应处于的状态码
|
|
|
*/
|
|
|
async checkMatchRegStatus(id, status) {
|
|
|
- const data = await this.matchRegService.fetch({ id })
|
|
|
+ const data = await this.matchRegService.fetch({ id });
|
|
|
if (!data) {
|
|
|
throw new ServiceError(ErrorCode.MATCH_REG_NOT_FOUND);
|
|
|
}
|
|
|
const data_status = get(data, 'status');
|
|
|
- if (status != data_status) {
|
|
|
+ if (status !== data_status) {
|
|
|
// 抛出异常: 赛事报名状态不符合要求.
|
|
|
- throw new ServiceError(ErrorCode.MATCH_REG_STATUS_ERROR)
|
|
|
+ throw new ServiceError(ErrorCode.MATCH_REG_STATUS_ERROR);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
}
|