| | |
| | | @ApiOperation(value = "新增", notes = "传入userPublicEnroll") |
| | | public R save(@Valid @RequestBody UserPublicEnrollEntity userPublicEnroll) { |
| | | userPublicEnroll.setUserId(AuthUtil.getUserId()); |
| | | long count = userPublicEnrollService.count(Wrappers.<UserPublicEnrollEntity>lambdaQuery() |
| | | .eq(UserPublicEnrollEntity::getPublicDiscussId, userPublicEnroll.getPublicDiscussId()) |
| | | .eq(UserPublicEnrollEntity::getUserId, userPublicEnroll.getUserId())); |
| | | if (count > 0) { |
| | | return R.fail("您已报名!"); |
| | | } |
| | | return R.status(userPublicEnrollService.save(userPublicEnroll)); |
| | | } |
| | | |