| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.neighbor.*; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.AddComActNeighborCircleAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO; |
| | | import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleDetailAppDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.neighbor.AddNeighborCircleAdminVO; |
| | | import com.panzhihua.common.model.vos.neighbor.EditNeighborCircleAdminVO; |
| | | import com.panzhihua.service_community.service.ComActNeighborCircleService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/neighbor") |
| | | public class NeighborApi { |
| | | |
| | | @Resource |
| | | private ComActNeighborCircleService comActNeighborCircleService; |
| | | |
| | | /** |
| | |
| | | return comActNeighborCircleService.pageNeighborByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 用户发布邻里圈审核 |
| | | * @param addNeighborCircleAppDTO 邻里圈请求参数 |
| | | * @return 发布结果 |
| | | */ |
| | | @PostMapping("addNeighborByApp") |
| | | public R addNeighborByApp(@RequestBody AddComActNeighborCircleAppDTO addNeighborCircleAppDTO) { |
| | | return comActNeighborCircleService.addNeighborByApp(addNeighborCircleAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询邻里圈详情 |
| | | * @param neighborCircleAppDTO 请求参数 |
| | | * @return 邻里圈详情 |
| | | */ |
| | | @PostMapping("neighborDetailByApp") |
| | | public R neighborDetailByApp(@RequestBody ComActNeighborCircleDetailAppDTO neighborCircleAppDTO) { |
| | | return comActNeighborCircleService.neighborDetailByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台查询邻里圈列表 |
| | | * @param comActNeighborCircleAdminDTO 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @PostMapping("pageNeighborByAdmin") |
| | | public R pageNeighborByAdmin(@RequestBody ComActNeighborCircleAdminDTO comActNeighborCircleAdminDTO) { |
| | | return comActNeighborCircleService.pageNeighborByAdmin(comActNeighborCircleAdminDTO); |
| | | } |
| | | |
| | | /** |
| | | * 后台添加邻里圈 |
| | | * @param addNeighborCircleAdminVO 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @PostMapping("addNeighborByAdmin") |
| | | public R pageNeighborByAdmin(@RequestBody AddNeighborCircleAdminVO addNeighborCircleAdminVO) { |
| | | return comActNeighborCircleService.addNeighborByAdmin(addNeighborCircleAdminVO); |
| | | } |
| | | |
| | | /** |
| | | * 后台修改邻里圈 |
| | | * @param editNeighborCircleAdminVO 请求参数 |
| | | */ |
| | | @PostMapping("changeStatusByAdmin") |
| | | public R changeStatusByAdmin(@RequestBody EditNeighborCircleAdminVO editNeighborCircleAdminVO) { |
| | | return comActNeighborCircleService.changeStatusByAdmin(editNeighborCircleAdminVO); |
| | | } |
| | | |
| | | /** |
| | | * 后台修改邻里圈 |
| | | * @param id 邻里圈id |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @PostMapping("deleteByAdmin") |
| | | public R deleteByAdmin(@RequestParam("id")Long id) { |
| | | return comActNeighborCircleService.deleteByAdmin(id); |
| | | } |
| | | |
| | | /** |
| | | * 用户查询邻里圈列表 |
| | | * @param neighborCircleAppDTO 请求参数 |
| | | * @return 邻里圈列表 |
| | | */ |
| | | @PostMapping("neighborExamineByApp") |
| | | public R neighborExamineByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { |
| | | return comActNeighborCircleService.neighborExamineByApp(neighborCircleAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈点赞 |
| | | * @param fabulousAppDTO 请求参数 |
| | | * @return 点赞结果 |
| | | */ |
| | | @PostMapping("neighborFabulousByApp") |
| | | public R neighborFabulousByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO) { |
| | | return comActNeighborCircleService.neighborFabulousByApp(fabulousAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈转发 |
| | | * @param forwardAppDTO 请求参数 |
| | | * @return 转发结果 |
| | | */ |
| | | @PostMapping("neighborForwardByApp") |
| | | public R neighborForwardByApp(@RequestBody ComActNeighborForwardAppDTO forwardAppDTO) { |
| | | return comActNeighborCircleService.neighborForwardByApp(forwardAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈评论 |
| | | * @param commentAppDTO 请求参数 |
| | | * @return 评论结果 |
| | | */ |
| | | @PostMapping("neighbor/comment") |
| | | public R neighborCommentByApp(@RequestBody ComActNeighborCommentAppDTO commentAppDTO) { |
| | | return comActNeighborCircleService.neighborCommentByApp(commentAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 邻里圈回复 |
| | | * @param replyAppDTO 请求参数 |
| | | * @return 回复结果 |
| | | */ |
| | | @PostMapping("neighbor/reply") |
| | | public R neighborReplyByApp(@RequestBody ComActNeighborReplyAppDTO replyAppDTO) { |
| | | return comActNeighborCircleService.neighborReplyByApp(replyAppDTO); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务更新邻里圈近3天评论数/点赞数/浏览量 |
| | | * @return 执行结果 |
| | | */ |
| | | @PostMapping("neighbor/timeTaskCircleFlow") |
| | | public R timeTaskCircleFlow() { |
| | | return comActNeighborCircleService.timeTaskCircleFlow(); |
| | | } |
| | | |
| | | } |