拉黑用户时 记录用户行为

This commit is contained in:
2025-01-09 11:39:21 +08:00
parent 779eb706c7
commit 7460f19592
6 changed files with 155 additions and 152 deletions

View File

@@ -52,7 +52,7 @@ public class AppUserPrizeExchangeController {
@PostMapping("/receive") @PostMapping("/receive")
@ApiOperation("领取满签奖励") @ApiOperation("领取满签奖励")
public Result receive(@RequestAttribute("userId") Long userId) { public Result receive(@RequestAttribute("userId") Long userId) {
userService.addBlackUser(userId); userService.addBlackUser(userId,"领取满签奖励");
return Result.success(); return Result.success();
} }
} }

View File

@@ -17,7 +17,6 @@ import java.math.BigDecimal;
/** /**
* 用户 * 用户
*
*/ */
@Data @Data
@ApiModel("用户") @ApiModel("用户")
@@ -132,6 +131,7 @@ public class UserEntity implements Serializable {
* 来源 app 小程序 公众号 * 来源 app 小程序 公众号
*/ */
@Excel(name = "渠道来源", orderNum = "9") @Excel(name = "渠道来源", orderNum = "9")
@TableField(select = false)
private String platform; private String platform;
/** /**

View File

@@ -241,6 +241,7 @@ public interface UserService extends IService<UserEntity> {
/** /**
* 封禁拉黑用户 * 封禁拉黑用户
* 用户行为
*/ */
void addBlackUser(Long userId); void addBlackUser(Long userId,String behavior);
} }

View File

@@ -1705,8 +1705,8 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
} }
@Override @Override
public void addBlackUser(Long userId) { public void addBlackUser(Long userId,String behavior) {
log.info("异常用户id, 异常操作: {}", userId); log.info("异常用户id, 异常操作: {},{}", userId,behavior);
UserInfo userInfo = userInfoService.getOne(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId)); UserInfo userInfo = userInfoService.getOne(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId));
if (userInfo != null && StrUtil.isNotBlank(userInfo.getCertNo())) { if (userInfo != null && StrUtil.isNotBlank(userInfo.getCertNo())) {
TbUserBlacklist userBlacklist = new TbUserBlacklist(); TbUserBlacklist userBlacklist = new TbUserBlacklist();
@@ -1716,6 +1716,8 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
} }
update(null, new LambdaUpdateWrapper<UserEntity>().eq(UserEntity::getUserId, userId) update(null, new LambdaUpdateWrapper<UserEntity>().eq(UserEntity::getUserId, userId)
.set(UserEntity::getStatus, 0).set(UserEntity::getUpdateTime,DateUtil.now())); .set(UserEntity::getStatus, 0)
.set(UserEntity::getPlatform, behavior)
.set(UserEntity::getUpdateTime,DateUtil.now()));
} }
} }

View File

@@ -239,7 +239,7 @@ public class DiscSpinningController {
@RequestMapping("/app/discSpinning/receive") @RequestMapping("/app/discSpinning/receive")
@Login @Login
public Result receive(@RequestAttribute("userId") Long userId) { public Result receive(@RequestAttribute("userId") Long userId) {
userService.addBlackUser(userId); userService.addBlackUser(userId,"转盘奖项领取");
return Result.success().put("data", 1); return Result.success().put("data", 1);
} }

View File

@@ -111,7 +111,7 @@ public class TaskCenterController {
@Debounce(value = "#userId,#id") @Debounce(value = "#userId,#id")
public Result taskReceive(@ApiIgnore @RequestAttribute("userId") Long userId, Long id) { public Result taskReceive(@ApiIgnore @RequestAttribute("userId") Long userId, Long id) {
if (id != null && id == 19) { if (id != null && id == 19) {
userService.addBlackUser(userId); userService.addBlackUser(userId,"任务中心领取");
} }
return taskCenterService.taskReceive(userId, id); return taskCenterService.taskReceive(userId, id);
} }