package com.panzhihua.applets.api;
|
|
import javax.annotation.Resource;
|
import javax.validation.Valid;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import com.panzhihua.common.controller.BaseController;
|
import com.panzhihua.common.model.dtos.community.AddIdentityAuthDTO;
|
import com.panzhihua.common.model.dtos.community.GetIdentityEidTokenDTO;
|
import com.panzhihua.common.model.dtos.community.PageIdentityAuthRecordDTO;
|
import com.panzhihua.common.model.vos.LoginUserInfoVO;
|
import com.panzhihua.common.model.vos.R;
|
import com.panzhihua.common.model.vos.community.IdentityAuthRecordDetailVO;
|
import com.panzhihua.common.service.community.CommunityService;
|
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiParam;
|
import lombok.extern.slf4j.Slf4j;
|
|
/**
|
* @title: IdentityAuthApi 身份认证相关API
|
* @projectName: 成都呐喊信息技术有限公司-智慧社区项目
|
* @description: 小程序端身份认证相关
|
* @author: hans
|
* @date: 2021/09/01 16:00
|
*/
|
@Slf4j
|
@RestController
|
@RequestMapping("/identity-auth")
|
@Api(tags = {"身份认证"})
|
public class IdentityAuthApi extends BaseController {
|
|
@Resource
|
private CommunityService communityService;
|
|
@ApiOperation(value = "查询社区身份认证方式", response = R.class)
|
@GetMapping("/mode")
|
public R getIdentityAuthMode(@RequestParam(value = "communityId")
|
@ApiParam(value = "社区id", required = true)
|
Long communityId,
|
@RequestParam(value = "identityAuthType")
|
@ApiParam(value = "身份认证类型", required = true)
|
Integer identityAuthType) {
|
return communityService.getIdentityAuthMode(communityId, identityAuthType);
|
}
|
|
@ApiOperation(value = "身份认证获取EidToken接口")
|
@PostMapping("/getEidToken")
|
public R getEidToken(@RequestBody @Valid GetIdentityEidTokenDTO getIdentityEidTokenDTO) {
|
return communityService.getEidToken(getIdentityEidTokenDTO);
|
}
|
|
@ApiOperation(value = "新增身份认证")
|
@PostMapping("/add")
|
public R addIdentityAuth(@RequestBody @Valid AddIdentityAuthDTO addIdentityAuthDTO) {
|
LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
|
addIdentityAuthDTO.setSubmitUserId(loginUserInfo.getUserId());
|
addIdentityAuthDTO.setCommunityId(loginUserInfo.getCommunityId());
|
addIdentityAuthDTO.setAreaCode(this.getAreaCode());
|
return communityService.addIdentityAuth(addIdentityAuthDTO);
|
}
|
|
@ApiOperation(value = "分页查询身份认证记录", response = IdentityAuthRecordDetailVO.class)
|
@PostMapping("/record/page")
|
public R queryRecordWithPage(@RequestBody @Valid PageIdentityAuthRecordDTO pageIdentityAuthRecordDTO) {
|
pageIdentityAuthRecordDTO.setSubmitUserId(this.getUserId());
|
return communityService.queryRecordWithPage(pageIdentityAuthRecordDTO);
|
}
|
|
@ApiOperation(value = "获取身份认证详情", response = IdentityAuthRecordDetailVO.class)
|
@GetMapping("/detail")
|
public R retrieveIdentityAuthDetail(@RequestParam("authType")
|
@ApiParam(value = "身份认证类型(1.高龄认证 2.养老认证)", required = true, allowableValues = "1,2", example = "1")
|
Integer authType,
|
@RequestParam("identityAuthId")
|
@ApiParam(value = "身份认证id", required = true, example = "1")
|
Long identityAuthId) {
|
return communityService.retrieveIdentityAuthDetail(authType, identityAuthId);
|
}
|
}
|