New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.PageComPropertyPublicityDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.model.vos.community.ComPropertyPublicityVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * @title: ComPropertyPublicityApi |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 物业宣传相关接口 |
| | | * @author: hans |
| | | * @date: 2021/11/11 10:08 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"物业宣传相关接口"}) |
| | | @RestController |
| | | @RequestMapping("/property/publicity") |
| | | public class ComPropertyPublicityApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "分页物业宣传信息", response = ComPropertyPublicityVO.class) |
| | | @PostMapping("/page") |
| | | public R pageComPropertyPublicity(@RequestBody @Valid PageComPropertyPublicityDTO pageComPropertyPublicityDTO) { |
| | | if (isNull(pageComPropertyPublicityDTO.getCommunityId())) { |
| | | return R.fail("社区id不能为空"); |
| | | } |
| | | LoginUserInfoVO loginUserInfoSureNoLogin = getLoginUserInfoSureNoLogin(); |
| | | if (nonNull(loginUserInfoSureNoLogin)) { |
| | | pageComPropertyPublicityDTO.setCommunityId(loginUserInfoSureNoLogin.getCommunityId()); |
| | | } |
| | | return communityService.pageComPropertyPublicityApplet(pageComPropertyPublicityDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看物业宣传信息", response = ComPropertyPublicityVO.class) |
| | | @GetMapping("/get") |
| | | @ApiImplicitParam(name = "id", value = "物业宣传id", required = true) |
| | | public R getComPropertyPublicity(@RequestParam("id") Long id) { |
| | | return communityService.getComPropertyPublicity(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "增加物业宣传浏览量") |
| | | @GetMapping("/incr-view") |
| | | @ApiImplicitParam(name = "id", value = "物业宣传id", required = true) |
| | | public R incrPropertyPublicityView(@RequestParam("id") Long id) { |
| | | return communityService.incrPropertyPublicityView(id); |
| | | } |
| | | } |