|
@@ -0,0 +1,133 @@
|
|
1
|
+package com.huiju.estateagents.controller;
|
|
2
|
+
|
|
3
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
4
|
+import com.huiju.estateagents.base.BaseController;
|
|
5
|
+import com.huiju.estateagents.base.ResponseBean;
|
|
6
|
+import com.huiju.estateagents.entity.TpNewsType;
|
|
7
|
+import com.huiju.estateagents.service.ITpNewsTypeService;
|
|
8
|
+import io.swagger.annotations.Api;
|
|
9
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
10
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
11
|
+import io.swagger.annotations.ApiOperation;
|
|
12
|
+import org.slf4j.Logger;
|
|
13
|
+import org.slf4j.LoggerFactory;
|
|
14
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
15
|
+import org.springframework.web.bind.annotation.*;
|
|
16
|
+
|
|
17
|
+import javax.servlet.http.HttpServletRequest;
|
|
18
|
+
|
|
19
|
+/**
|
|
20
|
+ * <p>
|
|
21
|
+ * 资讯类型表 前端控制器
|
|
22
|
+ * </p>
|
|
23
|
+ *
|
|
24
|
+ * @author jobob
|
|
25
|
+ * @since 2019-07-25
|
|
26
|
+ */
|
|
27
|
+@RestController
|
|
28
|
+@RequestMapping("/api")
|
|
29
|
+@Api(value = "物业服务类型", tags = "物业服务类型")
|
|
30
|
+public class TpNewsTypeController extends BaseController {
|
|
31
|
+
|
|
32
|
+ private final Logger logger = LoggerFactory.getLogger(TpNewsTypeController.class);
|
|
33
|
+
|
|
34
|
+ @Autowired
|
|
35
|
+ public ITpNewsTypeService iTpNewsTypeService;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+ /**
|
|
39
|
+ * 分页查询列表
|
|
40
|
+ * @param pageNum
|
|
41
|
+ * @param pageSize
|
|
42
|
+ * @return
|
|
43
|
+ */
|
|
44
|
+ // @ApiOperation(value = "查询资讯类型", notes = "查询资讯类型")
|
|
45
|
+ @ApiImplicitParams({
|
|
46
|
+ @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageNum", paramType = "query",value = "第几页"),
|
|
47
|
+ @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageSize", paramType = "query",value = "一页多少行"),
|
|
48
|
+ @ApiImplicitParam(dataTypeClass = String.class, name = "buildingId", paramType = "query",value = "项目id")
|
|
49
|
+ })
|
|
50
|
+ @RequestMapping(value="/admin/tpNewsType",method= RequestMethod.GET)
|
|
51
|
+ public ResponseBean tpNewsTypeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
|
52
|
+ @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
53
|
+ @RequestParam(value = "buildingId", required = false) String buildingId,
|
|
54
|
+ HttpServletRequest request){
|
|
55
|
+ ResponseBean responseBean = iTpNewsTypeService.getList(pageNum, pageSize, buildingId, getOrgId(request),getTaPersonBuildingListByUserId(request));
|
|
56
|
+ return responseBean;
|
|
57
|
+ }
|
|
58
|
+
|
|
59
|
+ /**
|
|
60
|
+ * 保存对象
|
|
61
|
+ * @param tpNewsType 实体对象
|
|
62
|
+ * @return
|
|
63
|
+ */
|
|
64
|
+ // @ApiOperation(value = "保存资讯类型", notes = "保存资讯类型")
|
|
65
|
+ @ApiImplicitParams({
|
|
66
|
+ @ApiImplicitParam(dataType = "tpNewsType", name = "tpNewsType", paramType = "body",value = "资讯类型数据")
|
|
67
|
+ })
|
|
68
|
+ @RequestMapping(value="/admin/tpNewsType",method= RequestMethod.POST)
|
|
69
|
+ public ResponseBean tpNewsTypeAdd(@RequestBody TpNewsType tpNewsType, HttpServletRequest request){
|
|
70
|
+ ResponseBean responseBean = iTpNewsTypeService.addTpNewsType(tpNewsType, getOrgId(request));
|
|
71
|
+ return responseBean;
|
|
72
|
+ }
|
|
73
|
+
|
|
74
|
+ /**
|
|
75
|
+ * 根据id删除对象
|
|
76
|
+ * @param id 实体ID
|
|
77
|
+ */
|
|
78
|
+ @ResponseBody
|
|
79
|
+ @RequestMapping(value="/admin/tpNewsType/{id}", method= RequestMethod.DELETE)
|
|
80
|
+ public ResponseBean tpNewsTypeDelete(@PathVariable Integer id){
|
|
81
|
+ ResponseBean responseBean = iTpNewsTypeService.deleteTpNewsType(id);
|
|
82
|
+ return responseBean;
|
|
83
|
+ }
|
|
84
|
+
|
|
85
|
+ /**
|
|
86
|
+ * 修改对象
|
|
87
|
+ * @param id 实体ID
|
|
88
|
+ * @param tpNewsType 实体对象
|
|
89
|
+ * @return
|
|
90
|
+ */
|
|
91
|
+ // @ApiOperation(value = "修改资讯类型", notes = "根据ID修改资讯类型")
|
|
92
|
+ @ApiImplicitParams({
|
|
93
|
+ @ApiImplicitParam(dataType = "tpNewsType", name = "tpNewsType", paramType = "body",value = "资讯类型数据"),
|
|
94
|
+ @ApiImplicitParam(dataType = "Integer", name = "id", paramType = "path",value = "资讯id")
|
|
95
|
+ })
|
|
96
|
+ @RequestMapping(value="/admin/tpNewsType/{id}",method= RequestMethod.PUT)
|
|
97
|
+ public ResponseBean tpNewsTypeUpdate(@PathVariable Integer id,
|
|
98
|
+ @RequestBody TpNewsType tpNewsType, HttpServletRequest request){
|
|
99
|
+ tpNewsType.setNewsTypeId(id);
|
|
100
|
+ tpNewsType.setOrgId(getOrgId(request));
|
|
101
|
+ ResponseBean responseBean = iTpNewsTypeService.updateTpNewsType(tpNewsType);
|
|
102
|
+ return responseBean;
|
|
103
|
+ }
|
|
104
|
+
|
|
105
|
+ /**
|
|
106
|
+ * 根据id查询对象
|
|
107
|
+ * @param id 实体ID
|
|
108
|
+ */
|
|
109
|
+ // @ApiOperation(value = "咨询类型详情", notes = "咨询类型详情")
|
|
110
|
+ @ApiImplicitParams({
|
|
111
|
+ @ApiImplicitParam(dataType = "Integer", name = "id", paramType = "path",value = "资讯id")
|
|
112
|
+ })
|
|
113
|
+ @RequestMapping(value="/admin/tpNewsType/{id}",method= RequestMethod.GET)
|
|
114
|
+ public ResponseBean tpNewsTypeGet(@PathVariable Integer id){
|
|
115
|
+ ResponseBean responseBean = iTpNewsTypeService.getTpNewsTypeById(id);
|
|
116
|
+ return responseBean;
|
|
117
|
+ }
|
|
118
|
+
|
|
119
|
+ @ApiOperation(value = "查询物业服务类型列表", notes = "查询物业服务类型列表")
|
|
120
|
+ @ApiImplicitParams({
|
|
121
|
+ @ApiImplicitParam(dataTypeClass = String.class, name = "buildingId", paramType = "query",value = "项目id")
|
|
122
|
+ })
|
|
123
|
+ @RequestMapping(value="/wx/tpNewsType/list",method= RequestMethod.GET)
|
|
124
|
+ public ResponseBean getWxTpNewsTypeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
|
125
|
+ @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
126
|
+ @RequestParam(value = "buildingId", required = false) String buildingId,
|
|
127
|
+ HttpServletRequest request){
|
|
128
|
+ QueryWrapper<TpNewsType> queryWrapper = new QueryWrapper<>();
|
|
129
|
+ queryWrapper.eq("org_id",getOrgId(request));
|
|
130
|
+ return ResponseBean.success(iTpNewsTypeService.list(queryWrapper));
|
|
131
|
+ }
|
|
132
|
+
|
|
133
|
+}
|