| | |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.sql.Array; |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | |
| | | messageMap.put("sex", user.getSex()); |
| | | messageMap.put("pic", user.getPic()); |
| | | messageMap.put("role", 0); |
| | | messageMap.put("remark", user.getUserMemo()); |
| | | } else { |
| | | messageMap.put("id", item.getCopId()); |
| | | User user = userService.getOne(new QueryWrapper<User>().eq("id", item.getCopId())); |
| | |
| | | public R queryPublicity(@RequestParam(required = false) Integer size) { |
| | | List<Publicity> publicityList = publicityService.list(new LambdaQueryWrapper<Publicity>().eq(Publicity::getStatus, 1)); |
| | | if (size != null) { |
| | | return R.ok(publicityList.stream().limit(size)); |
| | | return R.ok(publicityList.stream().sorted((o1, o2) -> o2.getReleaseTime().compareTo(o1.getReleaseTime())).limit(size)); |
| | | } |
| | | return R.ok(publicityList); |
| | | } |
| | | |
| | | @GetMapping("/publicity/{id}") |
| | | @ApiOperation("通过主键查询单条数据") |
| | | public R<Publicity> selectOne(@PathVariable Serializable id) { |
| | | return R.ok(publicityService.getById(id)); |
| | | } |
| | | |
| | | @ApiOperation(httpMethod = "POST", value = "群公告添加") |
| | | @PostMapping("/announcement/add") |
| | | public R insert(@RequestParam(value = "groupId") Integer groupId, @RequestParam String announcement) { |