You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

124 lines
4.7 KiB

package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AuthFieldResultDTO;
import com.epmet.dto.result.CertificationDetailResultDTO;
import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.dto.result.UserOperListResultDTO;
import com.epmet.service.UserBadgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/11/3 11:16 上午
*/
@RestController
@RequestMapping("more/badge")
public class UserBadgeController {
@Autowired
private UserBadgeService userBadgeService;
/**
* @Description 查询已经点亮的徽章
* @Param userBadgeListFormDTO
* @author zxc
* @date 2020/11/3 1:33 下午
*/
@PostMapping("badgelist")
public Result<List<UserBadgeListResultDTO>> selectBadgeList(@RequestBody UserBadgeListFormDTO userBadgeListFormDTO){
return new Result<List<UserBadgeListResultDTO>>().ok(userBadgeService.selectBadgeList(userBadgeListFormDTO));
}
/**
* @Description 个人中心-获取徽章可操作列表(点亮,取消,认证)
* @Param userOperListFormDTO
* @author zxc
* @date 2020/11/3 4:42 下午
*/
@PostMapping("badgeoperlist")
public Result<List<UserOperListResultDTO>> selectOperList(@RequestBody UserOperListFormDTO userOperListFormDTO){
return new Result<List<UserOperListResultDTO>>().ok(userBadgeService.selectOperList(userOperListFormDTO));
}
/**
* @Description 个人中心-提交徽章认证
* @Param certificationAddFormDTO
* @author zxc
* @date 2020/11/4 1:36 下午
*/
@PostMapping("authbadgerecord")
public Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO){
ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class);
return userBadgeService.authBadgeRecord(certificationAddFormDTO);
}
/**
* @Description 发送验证码
* @Param badgeSendCodeFormDTO
* @author zxc
* @date 2020/11/4 3:14 下午
*/
@PostMapping("badgesendcode")
public Result badgeSendCode(@RequestBody BadgeSendCodeFormDTO badgeSendCodeFormDTO){
ValidatorUtils.validateEntity(badgeSendCodeFormDTO, BadgeSendCodeFormDTO.BadgeSendCode.class);
userBadgeService.badgeSendCode(badgeSendCodeFormDTO);
return new Result();
}
/**
* @Description 个人中心-获取徽章认证页面详情 如果是未认证,则将居民base信息带出,如果是已认证,根据上次认证信息显示内容
* @Param tokenDto
* @Param certificationDetailFormDTO
* @author zxc
* @date 2020/11/4 4:03 下午
*/
@PostMapping("certification/detail")
public Result<CertificationDetailResultDTO> certificationDetail(@LoginUser TokenDto tokenDto,@RequestBody CertificationDetailFormDTO certificationDetailFormDTO){
ValidatorUtils.validateEntity(certificationDetailFormDTO);
return new Result<CertificationDetailResultDTO>().ok(userBadgeService.certificationDetail(tokenDto,certificationDetailFormDTO));
}
/**
* @Description 个人中心-查询徽章要显示的认证信息字段
* @Param authFieldFormDTO
* @author zxc
* @date 2020/11/4 5:05 下午
*/
@PostMapping("authfield")
public Result<List<AuthFieldResultDTO>> authField(@RequestBody AuthFieldFormDTO authFieldFormDTO){
ValidatorUtils.validateEntity(authFieldFormDTO, AuthFieldFormDTO.AuthField.class);
return new Result<List<AuthFieldResultDTO>>().ok(userBadgeService.authField(authFieldFormDTO));
}
/**
* @Description 个人中心-取消/点亮徽章
* @Param openedOrClosedFormDTO
* @author zxc
* @date 2020/11/4 5:47 下午
*/
@PostMapping("openedorclosed")
public Result openedOrClosed(@RequestBody OpenedOrClosedFormDTO openedOrClosedFormDTO) {
userBadgeService.openedOrClosed(openedOrClosedFormDTO);
return new Result();
}
/**
* @Description 初始化党员徽章 或 党员认证通过后,添加党员 徽章记录
* @Param userId
* @author zxc
* @date 2020/11/18 下午3:03
*/
@PostMapping("initbadge")
public Result initPartyMemberBadge(@RequestParam(required = false) String userId,@LoginUser TokenDto tokenDto) {
userBadgeService.initPartyMemberBadge(userId,tokenDto);
return new Result();
}
}