Merge remote-tracking branch 'origin/dev' into dev

dev
luotaiqian 2026-07-07 09:41:26 +08:00
commit 9ebdafe5a2
3 changed files with 18 additions and 0 deletions

View File

@ -79,4 +79,10 @@ public class AccountController {
return accountApi.verificationCode(phone, code); return accountApi.verificationCode(phone, code);
} }
@ApiOperation("校验用户是监管或机构: 1-机构端,2监管端")
@GetMapping("/checkTerminalType")
public SingleResponse<Integer> checkTerminalType() {
return accountApi.checkTerminalType();
}
} }

View File

@ -7,6 +7,8 @@ import org.qinan.safetyeval.client.api.AccountApi;
import org.qinan.safetyeval.client.co.AccountCO; import org.qinan.safetyeval.client.co.AccountCO;
import org.qinan.safetyeval.client.dto.*; import org.qinan.safetyeval.client.dto.*;
import org.qinan.safetyeval.domain.entity.AccountEntity; import org.qinan.safetyeval.domain.entity.AccountEntity;
import org.qinan.safetyeval.domain.exception.BizException;
import org.qinan.safetyeval.domain.exception.ErrorCode;
import org.qinan.safetyeval.domain.query.AccountQuery; import org.qinan.safetyeval.domain.query.AccountQuery;
import org.qinan.safetyeval.domain.query.PageResult; import org.qinan.safetyeval.domain.query.PageResult;
import org.qinan.safetyeval.domain.service.AccountDomainService; import org.qinan.safetyeval.domain.service.AccountDomainService;
@ -122,6 +124,15 @@ public class AccountExecutor implements AccountApi {
return null; return null;
} }
@Override
public SingleResponse<Integer> checkTerminalType() {
AccountEntity accountEntity = accountDomainService.get(AuthUserContextAdapter.getCurrentUserId());
if (accountEntity == null || accountEntity.getType() == null) {
throw new BizException(ErrorCode.ACCOUNT_NOT_FOUND);
}
return SingleResponse.success(accountEntity.getType());
}
private AccountCO toCO(AccountEntity entity) { private AccountCO toCO(AccountEntity entity) {
if (entity == null) { if (entity == null) {
return null; return null;

View File

@ -28,4 +28,5 @@ public interface AccountApi {
SingleResponse<AccountCO> verificationCode(String phone, String code); SingleResponse<AccountCO> verificationCode(String phone, String code);
SingleResponse<Integer> checkTerminalType();
} }