package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.BadgeSendCodeFormDTO; import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.dto.form.UserBadgeListFormDTO; import com.epmet.dto.form.UserOperListFormDTO; 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.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * @Author zxc * @DateTime 2020/11/3 11:16 上午 */ @RestController @RequestMapping("badge") public class UserBadgeController { @Autowired private UserBadgeService userBadgeService; /** * @Description 查询已经点亮的徽章 * @Param userBadgeListFormDTO * @author zxc * @date 2020/11/3 1:33 下午 */ @PostMapping("badgelist") public Result> selectBadgeList(@RequestBody UserBadgeListFormDTO userBadgeListFormDTO){ return new Result>().ok(userBadgeService.selectBadgeList(userBadgeListFormDTO)); } /** * @Description 个人中心-获取徽章可操作列表(点亮,取消,认证) * @Param userOperListFormDTO * @author zxc * @date 2020/11/3 4:42 下午 */ @PostMapping("badgeoperlist") public Result> selectOperList(@RequestBody UserOperListFormDTO userOperListFormDTO){ return new Result>().ok(userBadgeService.selectOperList(userOperListFormDTO)); } /** * @Description 个人中心-提交徽章认证 * @Param certificationAddFormDTO * @author zxc * @date 2020/11/4 1:36 下午 */ @PostMapping("authbadgerecord") public Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO){ userBadgeService.authBadgeRecord(certificationAddFormDTO); return new Result(); } /** * @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(); } }