lidongdong
2023-08-31 f8f7f64ed0e7595ba988c906ffd73bd739c019d4
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/XmostBeautifulApi.java
@@ -4,7 +4,9 @@
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO;
import com.panzhihua.common.model.vos.community.VolunteerMerchantVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.StringUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
@@ -21,6 +23,10 @@
    @Resource
    private CommunityService communityService;
    @Resource
    private UserService userService;
    /**
     * 查询单个
@@ -129,7 +135,7 @@
    /**
     * 更新商家
     * 更新商家订单
     * @param item
     * @return
     */
@@ -248,6 +254,16 @@
        return communityService.volunteerTypeGetList(pageNum,pageSize,"2");
    }
    /**
     * 修改商家
     * @param vtvo
     * @return
     */
    @PostMapping("/VolunteerMerchant/update")
    public R updateVolunteerMerchant(@RequestBody VolunteerMerchantVO vtvo)
    {
        return communityService.updateVolunteerMerchant(vtvo);
    }
    /**
     * 获取商家详情
@@ -272,8 +288,74 @@
    }
    /**
     * 社区取消订单
     * @param id
     * @return
     */
    @GetMapping("/order/communityCancellation")
    public R communityCancellation(@RequestParam("id") String id)
    {
        return communityService.communityCancellation(id);
    }
    /**
     * 用户设置积分支付密码
     * @param userId
     * @param pwd
     * @return
     */
    @GetMapping("/setUserPlayPwd")
    public R setUserPlayPwd(@RequestParam("userId") String userId,@RequestParam("pwd") String pwd)
    {
        if (StringUtils.isEmpty(userId))
        {
            return R.fail("userId不能为空");
        }
        if(StringUtils.isEmpty(pwd))
        {
            return R.fail("密码不能为空");
        }
        LoginUserInfoVO loginUserInfoVO=new LoginUserInfoVO();
        loginUserInfoVO.setUserId(Long.valueOf(userId));
        loginUserInfoVO.setPlayPwd(pwd);
        return userService.putUser(loginUserInfoVO);
    }
    /**
     * 判断密码是否正确
     * @param userId
     * @param pwd
     * @return
     */
    @GetMapping("/passwordIsCorrect")
    public R passwordIsCorrect(@RequestParam("userId") String userId,@RequestParam("pwd") String pwd)
    {
        if (StringUtils.isEmpty(userId))
        {
            return R.fail("userId不能为空");
        }
        if(StringUtils.isEmpty(pwd))
        {
            return R.fail("密码不能为空");
        }
        LoginUserInfoVO loginUserInfoVO=userService.getUserInfoByUserId(userId).getData();
        if(StringUtils.isEmpty(loginUserInfoVO.getPlayPwd()))
        {
            return R.fail(304,"您还未设置密码!");
        }
        if(StringUtils.equals(pwd,loginUserInfoVO.getPlayPwd()))
        {
            return R.ok();
        }
        return R.fail("密码错误");
    }
}