feat:bug
This commit is contained in:
1 parent
da22bddea8
commit
e532c68c54
8 files changed
+67
-15
No files matched your search
+2
@@ -66,6 +66,8 @@ public interface MemberErrorCode {
|
||||
ErrorCode COM_AUTH_NOT_EXISTS = new ErrorCode(2_001_000_005, "通用认证不存在");
|
||||
ErrorCode COM_AUTH_EXISTS = new ErrorCode(2_001_000_005, "正在认证中,请勿重复发起");
|
||||
ErrorCode THIRD_AUTH_START_ERROR = new ErrorCode(2_001_000_006, "第三方认证发起失败,{}");
|
||||
ErrorCode THIRD_NONE_TRUE_PERSON_AUTH = new ErrorCode(2_001_000_007, "请您认证后查看~");
|
||||
ErrorCode THIRD_NONE_VIP_AUTH = new ErrorCode(2_001_000_008, "请您开通VIP后查看~");
|
||||
|
||||
//========== 用户图片、视频资源管理 1-004-013-000 ==========
|
||||
ErrorCode PHOTO_NOT_EXISTS = new ErrorCode(1_004_013_000, "用户资源不存在");
|
||||
|
||||
+6
-1
@@ -14,7 +14,6 @@ import cn.iocoder.yudao.module.member.service.recent.ViewRecordService;
|
||||
import cn.iocoder.yudao.module.member.service.user.BO.MemberWechatBO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -155,6 +154,12 @@ public class AppRecentController {
|
||||
return success(user);
|
||||
}
|
||||
|
||||
@GetMapping("/judgeGetByUserRole")
|
||||
@Operation(summary = "判断有没有查询朋友圈用户的权限")
|
||||
public CommonResult<Boolean> judgeGetByUserRole(@RequestParam("id") Long id) {
|
||||
return success(recentService.judgeGetByUserRole(getLoginUserId(), id));
|
||||
}
|
||||
|
||||
@GetMapping("/total")
|
||||
@Operation(summary = "朋友圈我喜欢的、喜欢我的等总数统计")
|
||||
public CommonResult<OperationTotalGroupRecentRespVO> total() {
|
||||
|
||||
+9
-1
@@ -1,6 +1,8 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.user;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.member.controller.app.comauth.vo.CreateWechatAuthReqVo;
|
||||
import cn.iocoder.yudao.module.member.service.comauth.ComAuthService;
|
||||
import cn.iocoder.yudao.module.member.service.opentype.BO.OpenTypeExtBO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.*;
|
||||
import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
|
||||
@@ -41,6 +43,8 @@ public class AppMemberUserController {
|
||||
private MemberRecentTagService memberRecentTagService;
|
||||
@Resource
|
||||
private OpenTypeService openTypeService;
|
||||
@Resource
|
||||
private ComAuthService comAuthService;
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得基本信息")
|
||||
@@ -67,7 +71,11 @@ public class AppMemberUserController {
|
||||
@PutMapping("/update-wechat")
|
||||
@Operation(summary = "修改微信信息")
|
||||
public CommonResult<Boolean> updateUserWechat(@RequestBody @Valid AppMemberUserWechatUpdateReqVO reqVO) {
|
||||
userService.updateUserWechat(getLoginUserId(), reqVO);
|
||||
CreateWechatAuthReqVo dto = new CreateWechatAuthReqVo();
|
||||
dto.setMemberId(getLoginUserId());
|
||||
dto.setWechatNumber(reqVO.getWechatNum());
|
||||
dto.setWechatQrcode(reqVO.getWechatQrCode());
|
||||
comAuthService.createWechatAuth(dto);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -63,6 +63,12 @@ public class AppMemberUserInfoRespVO {
|
||||
|
||||
@Schema(description = "用户会员信息")
|
||||
private OpenTypeExtBO memberVip;
|
||||
|
||||
@Schema(description = "微信号")
|
||||
private String wechatNum;
|
||||
|
||||
@Schema(description = "微信二维码")
|
||||
private String wechatQrCode;
|
||||
|
||||
@Schema(description = "用户 App - 会员等级")
|
||||
@Data
|
||||
|
||||
+5
@@ -103,6 +103,11 @@ public interface RecentService {
|
||||
*/
|
||||
RecentPageResVo getRecentUserByUserId(Long operateUserId, Long userId);
|
||||
|
||||
/**
|
||||
* 判断有没有查询朋友圈用户的权限
|
||||
*/
|
||||
Boolean judgeGetByUserRole(Long operateUserId, Long userId);
|
||||
|
||||
/**
|
||||
* 朋友圈我喜欢的、喜欢我的等总数统计
|
||||
*/
|
||||
|
||||
+38
-1
@@ -16,6 +16,7 @@ import cn.iocoder.yudao.module.member.dal.dataobject.location.LocationDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.photo.PhotoDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.recent.OperationDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberRecentCfgDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberRecentTagDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.recent.OperationMapper;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberRecentTagMapper;
|
||||
@@ -450,7 +451,14 @@ public class RecentServiceImpl implements RecentService {
|
||||
);
|
||||
List<OperationDO> list = pageList.getList();
|
||||
if (ObjectUtil.isEmpty(list)) return new PageResult<>();
|
||||
List<OperationRespVO> resultList = BeanUtils.toBean(list, OperationRespVO.class);
|
||||
// List<OperationRespVO> resultList = BeanUtils.toBean(list, OperationRespVO.class);
|
||||
List<OperationRespVO> resultList = list.stream().map(item -> {
|
||||
OperationRespVO entity = new OperationRespVO();
|
||||
entity.setBizType(item.getBizType());
|
||||
entity.setMemberId(item.getOperatorMemberId());
|
||||
entity.setCreateTime(item.getCreateTime());
|
||||
return entity;
|
||||
}).collect(Collectors.toList());
|
||||
// 为OperationRespVO设置Member信息
|
||||
convertOperationRespVOSetupMember(resultList);
|
||||
convertOperationRespVOSetupTagList(resultList);
|
||||
@@ -565,6 +573,35 @@ public class RecentServiceImpl implements RecentService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean judgeGetByUserRole(Long operateUserId, Long userId) {
|
||||
// 查询当前用户tag
|
||||
List<MemberRecentTagDO> memberTagList = memberRecentTagService.getByMemberId(operateUserId);
|
||||
// 查询被查看用户
|
||||
MemberUserDO findUser = memberUserService.getUser(userId);
|
||||
// 权限判断
|
||||
SexEnum sexEnum = SexEnum.valueOfSex(findUser.getSex());
|
||||
if (ObjectUtil.isNotEmpty(sexEnum)) {
|
||||
// 男
|
||||
if (ObjectUtil.equals(sexEnum, SexEnum.MALE)) {
|
||||
// `男生`用户查看`新人`要开通VIP
|
||||
MemberRecentTagDO vip = memberTagList.stream().filter(item -> ObjectUtil.equals(item.getTagBizType(), MemberRecentTagEnum.VIP.getType())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(vip)) {
|
||||
throw exception(MemberErrorCode.THIRD_NONE_VIP_AUTH);
|
||||
}
|
||||
}
|
||||
// 女
|
||||
else {
|
||||
// `女生`用户查看`VIP男士`和`女生`都要求当前用户完成真人认证
|
||||
MemberRecentTagDO truePerson = memberTagList.stream().filter(item -> ObjectUtil.equals(item.getTagBizType(), MemberRecentTagEnum.TRUE_PERSON_AUTH.getType())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(truePerson)) {
|
||||
throw exception(MemberErrorCode.THIRD_NONE_TRUE_PERSON_AUTH);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 朋友圈我喜欢的、喜欢我的等总数统计
|
||||
*/
|
||||
|
||||
-5
@@ -93,11 +93,6 @@ public interface MemberUserService {
|
||||
*/
|
||||
void updateUser(Long userId, AppMemberUserUpdateReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 【会员】修改微信信息
|
||||
*/
|
||||
void updateUserWechat(Long loginUserId, @Valid AppMemberUserWechatUpdateReqVO dto);
|
||||
|
||||
/**
|
||||
* 【会员】修改手机,基于手机验证码
|
||||
*
|
||||
|
||||
+1
-7
@@ -186,7 +186,7 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
entity.setAppRefreshDate(member.getAppRefreshDate());
|
||||
entity.setMemberLat(member.getLat());
|
||||
entity.setMemberLng(member.getLng());
|
||||
if (ObjectUtil.isNotEmpty(member.getWeight())) {
|
||||
if (ObjectUtil.isNotEmpty(member.getWechatNum())) {
|
||||
entity.setWechatNum(member.getwechatMaskString());
|
||||
}
|
||||
return entity;
|
||||
@@ -226,12 +226,6 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserWechat(Long loginUserId, AppMemberUserWechatUpdateReqVO dto) {
|
||||
MemberUserDO updateObj = BeanUtils.toBean(dto, MemberUserDO.class).setId(loginUserId);
|
||||
memberUserMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateUserMobile(Long userId, AppMemberUserUpdateMobileReqVO reqVO) {
|
||||
|
||||
Reference in new issue
Block a user