mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package com.panzhihua.applets.api;
 
import javax.annotation.Resource;
 
import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO;
import com.panzhihua.common.service.user.UserService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiParam;
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.property.CommonPage;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComPropertyVO;
import com.panzhihua.common.service.community.CommunityService;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
 
/**
 * @author zzj
 */
@Slf4j
@Api(tags = {"物业公司"})
@RestController
@RequestMapping("/comProperty")
public class ComPropertyApi extends BaseController {
    @Resource
    private CommunityService communityService;
    @Resource
    private UserService userService;
 
    /**
     * 分页查询所有数据
     *
     * @param commonPage 查询实体
     * @return 所有数据
     */
    @ApiOperation(value = "物业公司列表",response = ComPropertyVO.class)
    @PostMapping("queryAll")
    public R selectAll(@RequestBody CommonPage commonPage) {
        commonPage.setParamId(this.getCommunityId());
        return this.communityService.comPropertySelectAll(commonPage);
    }
 
    @ApiOperation(value = "物业公司详情", response = ComPropertyVO.class)
    @ApiImplicitParam(name = "id", value = "物业公司id", required = true)
    @GetMapping("detail")
    public R detailProperty(@RequestParam("id") Long id) {
        return this.communityService.detailProperty(id);
    }
 
    @ApiOperation("新增投诉建议或问题留言")
    @PostMapping("addFeedBack")
    public R addFeedBack(@RequestBody SysUserFeedbackDTO sysUserFeedbackDTO){
        return userService.addFeedback(sysUserFeedbackDTO);
    }
 
    @ApiOperation("查看自己的投诉建议或问题留言记录")
    @GetMapping("myFeedBack")
    public R myFeedBack(@ApiParam("类型:1问题留言2投诉建议") @RequestParam(value = "type",required = false)Integer type,@RequestParam(value = "propertyId",required = false)Long propertyId){
        return userService.myFeedBack(this.getLoginUserInfo().getUserId(),type,propertyId);
    }
 
    @ApiOperation("通知公告列表")
    @GetMapping("notice")
    public R noticeList(@RequestParam("page")Integer page,@RequestParam("size")Integer size,@RequestParam("propertyId")Long propertyId){
        return communityService.noticeList(page,size,propertyId);
    }
 
}