houzhongjian
2024-10-16 7da8f196dee8e3c526c009a4bc7f5983ece6bb97
提交 | 用户 | 时间
e7c126 1 package com.iailab.module.system.api.dept;
H 2
3 import com.iailab.framework.common.pojo.CommonResult;
4 import com.iailab.framework.common.util.object.BeanUtils;
5 import com.iailab.module.system.api.dept.dto.PostRespDTO;
6 import com.iailab.module.system.dal.dataobject.dept.PostDO;
7 import com.iailab.module.system.service.dept.PostService;
8 import org.springframework.validation.annotation.Validated;
9 import org.springframework.web.bind.annotation.RestController;
10
11 import javax.annotation.Resource;
12 import java.util.Collection;
13 import java.util.List;
14
15 import static com.iailab.framework.common.pojo.CommonResult.success;
16
17 @RestController // 提供 RESTful API 接口,给 Feign 调用
18 @Validated
19 public class PostApiImpl implements PostApi {
20
21     @Resource
22     private PostService postService;
23
24     @Override
25     public CommonResult<Boolean> validPostList(Collection<Long> ids) {
26         postService.validatePostList(ids);
27         return success(true);
28     }
29
30     @Override
31     public CommonResult<List<PostRespDTO>> getPostList(Collection<Long> ids) {
32         List<PostDO> list = postService.getPostList(ids);
33         return success(BeanUtils.toBean(list, PostRespDTO.class));
34     }
35
36 }