Browse Source

/resi/mine/badge/operlist从token中获取customerId

dev
yinzuomei 3 years ago
parent
commit
faa6249276
  1. 15
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java
  2. 4
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java
  3. 7
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java

15
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java

@ -7,8 +7,6 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CertificationAddFormDTO;
import com.epmet.dto.form.OpenedOrClosedFormDTO;
import com.epmet.modules.person.service.BadgeService;
import com.epmet.resi.mine.dto.from.BadgeListFormDTO;
import com.epmet.resi.mine.dto.from.OperListFormDTO;
import com.epmet.resi.mine.dto.result.BadgeListResultDTO;
import com.epmet.resi.mine.dto.result.OperListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,8 +35,9 @@ public class BadgeController {
* @date 2020/11/3 4:11 下午
*/
@PostMapping("list")
public Result<List<BadgeListResultDTO>> getBadgeList(@LoginUser TokenDto tokenDto,@RequestBody BadgeListFormDTO badgeListFormDTO){
ValidatorUtils.validateEntity(badgeListFormDTO, BadgeListFormDTO.BadgeList.class);
// public Result<List<BadgeListResultDTO>> getBadgeList(@LoginUser TokenDto tokenDto,@RequestBody BadgeListFormDTO badgeListFormDTO){
public Result<List<BadgeListResultDTO>> getBadgeList(@LoginUser TokenDto tokenDto){
// ValidatorUtils.validateEntity(badgeListFormDTO, BadgeListFormDTO.BadgeList.class);
// return new Result<List<BadgeListResultDTO>>().ok(badgeService.getBadgeList(tokenDto,badgeListFormDTO));
return new Result<List<BadgeListResultDTO>>().ok(badgeService.getBadgeList(tokenDto.getCustomerId(),tokenDto.getUserId()));
}
@ -50,9 +49,11 @@ public class BadgeController {
* @date 2020/11/3 4:28 下午
*/
@PostMapping("operlist")
public Result<List<OperListResultDTO>> getOperList(@LoginUser TokenDto tokenDto,@RequestBody OperListFormDTO operListFormDTO){
ValidatorUtils.validateEntity(operListFormDTO, OperListFormDTO.OperList.class);
return new Result<List<OperListResultDTO>>().ok(badgeService.getOperList(tokenDto,operListFormDTO));
// public Result<List<OperListResultDTO>> getOperList(@LoginUser TokenDto tokenDto,@RequestBody OperListFormDTO operListFormDTO){
public Result<List<OperListResultDTO>> getOperList(@LoginUser TokenDto tokenDto){
// ValidatorUtils.validateEntity(operListFormDTO, OperListFormDTO.OperList.class);
// return new Result<List<OperListResultDTO>>().ok(badgeService.getOperList(tokenDto,operListFormDTO));
return new Result<List<OperListResultDTO>>().ok(badgeService.getOperList(tokenDto.getCustomerId(),tokenDto.getUserId()));
}
/**

4
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java

@ -4,7 +4,6 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.CertificationAddFormDTO;
import com.epmet.dto.form.OpenedOrClosedFormDTO;
import com.epmet.resi.mine.dto.from.OperListFormDTO;
import com.epmet.resi.mine.dto.result.BadgeListResultDTO;
import com.epmet.resi.mine.dto.result.OperListResultDTO;
@ -31,7 +30,8 @@ public interface BadgeService {
* @author zxc
* @date 2020/11/3 4:28 下午
*/
List<OperListResultDTO> getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO);
// List<OperListResultDTO> getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO);
List<OperListResultDTO> getOperList(String customerId,String userId);
/**
* @Description 个人中心-提交徽章认证

7
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java

@ -12,7 +12,6 @@ import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.dto.result.UserOperListResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.person.service.BadgeService;
import com.epmet.resi.mine.dto.from.OperListFormDTO;
import com.epmet.resi.mine.dto.result.BadgeListResultDTO;
import com.epmet.resi.mine.dto.result.OperListResultDTO;
import lombok.extern.slf4j.Slf4j;
@ -62,10 +61,10 @@ public class BadgeServiceImpl implements BadgeService {
* @date 2020/11/3 4:28 下午
*/
@Override
public List<OperListResultDTO> getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO) {
public List<OperListResultDTO> getOperList(String customerId,String userId) {
UserOperListFormDTO userOperListFormDTO = new UserOperListFormDTO();
userOperListFormDTO.setCustomerId(operListFormDTO.getCustomerId());
userOperListFormDTO.setUserId(tokenDto.getUserId());
userOperListFormDTO.setCustomerId(customerId);
userOperListFormDTO.setUserId(userId);
Result<List<UserOperListResultDTO>> listResult = epmetUserOpenFeignClient.selectOperList(userOperListFormDTO);
if (!listResult.success()){
throw new RenException("获取徽章列表失败......");

Loading…
Cancel
Save