feat(system): 新增用户批量查询
parent
103a6e7db7
commit
be124c92fa
|
@ -12,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
|
|||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -36,7 +37,7 @@ public class ModelImageCommentController {
|
|||
*/
|
||||
@ApiOperation(value = "图片评论发布")
|
||||
@PostMapping("/comment")
|
||||
public AjaxResult comment(@RequestBody ModelImageCommentRes modelImageCommentRes) {
|
||||
public AjaxResult comment(@Valid @RequestBody ModelImageCommentRes modelImageCommentRes) {
|
||||
modelImageCommentService.comment(modelImageCommentRes);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
@ -46,8 +47,8 @@ public class ModelImageCommentController {
|
|||
*/
|
||||
@ApiOperation(value = "图片评论点赞/取消")
|
||||
@RepeatSubmit
|
||||
@GetMapping("/commentLike/{commentId}")
|
||||
public AjaxResult commentLike(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) {
|
||||
@GetMapping("/commentLike")
|
||||
public AjaxResult commentLike(@Valid @NotNull(message = "评论id不能为空") Long commentId) {
|
||||
modelImageCommentLikeService.like(commentId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
@ -56,8 +57,8 @@ public class ModelImageCommentController {
|
|||
* 删除图片评论
|
||||
*/
|
||||
@ApiOperation(value = "删除图片评论")
|
||||
@GetMapping("/commentDelete/{commentId}")
|
||||
public AjaxResult commentDelete(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) {
|
||||
@GetMapping("/commentDelete")
|
||||
public AjaxResult commentDelete(@Valid @NotNull(message = "评论id不能为空") Long commentId) {
|
||||
modelImageCommentService.removeById(commentId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
@ -66,8 +67,8 @@ public class ModelImageCommentController {
|
|||
* 获取图片评论
|
||||
*/
|
||||
@ApiOperation(value = "获取图片评论")
|
||||
@GetMapping("/comment/{imageId}")
|
||||
public AjaxResult getComment(@PathVariable @NotNull(message = "图片id不能为空") Long imageId) {
|
||||
@GetMapping("/comment")
|
||||
public AjaxResult getComment(@Valid @NotNull(message = "图片id不能为空") Long imageId) {
|
||||
List<ModelImageCommentVo> modelImageCommentVoList = modelImageCommentService.getComment(imageId);
|
||||
return AjaxResult.success(modelImageCommentVoList);
|
||||
}
|
||||
|
|
|
@ -138,4 +138,5 @@ public interface SysUserMapper
|
|||
|
||||
List<SysUser> listByIds(List<Long> userIdList);
|
||||
|
||||
List<SysUser> selectUserByIds(@Param("userIds") List<Long> userIds);
|
||||
}
|
||||
|
|
|
@ -218,4 +218,5 @@ public interface ISysUserService
|
|||
|
||||
List<SysUser> listByIds(List<Long> userIdList);
|
||||
|
||||
List<SysUser> selectUserByIds(List<Long> userIds);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.springframework.util.CollectionUtils;
|
|||
import javax.validation.Validator;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -674,4 +675,9 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUser> selectUserByIds(List<Long> userIds) {
|
||||
return userMapper.selectUserByIds(userIds);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,6 +167,14 @@
|
|||
|
||||
</select>
|
||||
|
||||
<select id="selectUserByIds" resultType="com.mcwl.common.core.domain.entity.SysUser">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_id in
|
||||
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
|
|
Loading…
Reference in New Issue