|
|
@@ -15,17 +15,18 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
+import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.store.LifeFans;
|
|
|
import shop.alien.entity.store.LifeNotice;
|
|
|
import shop.alien.entity.store.LifeUser;
|
|
|
import shop.alien.entity.store.vo.LifeMessageVo;
|
|
|
import shop.alien.entity.store.vo.LifeUserVo;
|
|
|
import shop.alien.entity.store.vo.WebSocketVo;
|
|
|
-import shop.alien.store.config.BaseRedisService;
|
|
|
import shop.alien.mapper.LifeFansMapper;
|
|
|
import shop.alien.mapper.LifeMessageMapper;
|
|
|
import shop.alien.mapper.LifeNoticeMapper;
|
|
|
import shop.alien.mapper.LifeUserMapper;
|
|
|
+import shop.alien.store.config.BaseRedisService;
|
|
|
import shop.alien.store.config.WebSocketProcess;
|
|
|
import shop.alien.store.util.FunctionMagic;
|
|
|
import shop.alien.util.common.JwtUtil;
|
|
|
@@ -301,4 +302,43 @@ public class LifeUserService extends ServiceImpl<LifeUserMapper, LifeUser> {
|
|
|
log.error("LifeUserService webSocketProcess Stack={}", e);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public R havePayPassword(String userId, String password) {
|
|
|
+ LifeUser lifeUser = lifeUserMapper.selectById(userId);
|
|
|
+ HashMap<Object, Object> returnMap = new HashMap<>();
|
|
|
+ returnMap.put("code",200);
|
|
|
+ if (null == lifeUser) {
|
|
|
+ returnMap.put("message","未查询到用户");
|
|
|
+ returnMap.put("data","false");
|
|
|
+ return R.data(returnMap);
|
|
|
+ }
|
|
|
+ if( null == lifeUser.getPayPassword()){
|
|
|
+ returnMap.put("message","用户未设置支付密码");
|
|
|
+ returnMap.put("data","false");
|
|
|
+ return R.data(returnMap);
|
|
|
+ } else if(null != password){
|
|
|
+ if( !password.equals(lifeUser.getPayPassword())){
|
|
|
+ returnMap.put("message","密码错误");
|
|
|
+ returnMap.put("data","false");
|
|
|
+ return R.data(returnMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ returnMap.put("data","true");
|
|
|
+ returnMap.put("message","用户已设置支付密码");
|
|
|
+ return R.data(returnMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改支付密码
|
|
|
+ *
|
|
|
+ * @param id 主键
|
|
|
+ * @param payPassword 支付密码
|
|
|
+ * @return boolean
|
|
|
+ */
|
|
|
+ public boolean setPayPassword(Integer id, String payPassword) {
|
|
|
+ LifeUser lifeUser = new LifeUser();
|
|
|
+ lifeUser.setId(id);
|
|
|
+ lifeUser.setPayPassword(payPassword);
|
|
|
+ return this.updateById(lifeUser);
|
|
|
+ }
|
|
|
}
|