|
@@ -13,6 +13,10 @@ import com.huiju.estateagents.entity.TaPerson;
|
13
|
13
|
import com.huiju.estateagents.service.ITaBuildingService;
|
14
|
14
|
import com.huiju.estateagents.service.ITaGoodsService;
|
15
|
15
|
import com.huiju.estateagents.service.ITaPersonService;
|
|
16
|
+import io.swagger.annotations.Api;
|
|
17
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
18
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
19
|
+import io.swagger.annotations.ApiOperation;
|
16
|
20
|
import org.slf4j.Logger;
|
17
|
21
|
import org.slf4j.LoggerFactory;
|
18
|
22
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -40,6 +44,7 @@ import java.util.Map;
|
40
|
44
|
*/
|
41
|
45
|
@RestController
|
42
|
46
|
@RequestMapping("/api")
|
|
47
|
+@Api(value = "商品", tags = "商品")
|
43
|
48
|
public class TaGoodsController extends BaseController {
|
44
|
49
|
|
45
|
50
|
private final Logger logger = LoggerFactory.getLogger(TaGoodsController.class);
|
|
@@ -59,6 +64,16 @@ public class TaGoodsController extends BaseController {
|
59
|
64
|
* @param pageSize
|
60
|
65
|
* @return
|
61
|
66
|
*/
|
|
67
|
+ @ApiOperation(value = "后台商品列表", notes = "后台商品列表")
|
|
68
|
+ @ApiImplicitParams({
|
|
69
|
+ @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageNum", paramType = "query",value = "第几页"),
|
|
70
|
+ @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageSize", paramType = "query",value = "一页多少行"),
|
|
71
|
+ @ApiImplicitParam(dataTypeClass = String.class, name = "goodsName", paramType = "query",value = "商品名称"),
|
|
72
|
+ @ApiImplicitParam(dataTypeClass = String.class, name = "buildingId", paramType = "query",value = "项目id"),
|
|
73
|
+ @ApiImplicitParam(dataTypeClass = Integer.class, name = "priceLesser", paramType = "query",value = "价格小"),
|
|
74
|
+ @ApiImplicitParam(dataTypeClass = Integer.class, name = "priceGreater", paramType = "query",value = "价格大"),
|
|
75
|
+ @ApiImplicitParam(dataTypeClass = Integer.class, name = "status", paramType = "query",value = "状态")
|
|
76
|
+ })
|
62
|
77
|
@RequestMapping(value="/admin/taGoods",method= RequestMethod.GET)
|
63
|
78
|
public ResponseBean taGoodsList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
64
|
79
|
@RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
@@ -95,6 +110,10 @@ public class TaGoodsController extends BaseController {
|
95
|
110
|
* @param taGoods 实体对象
|
96
|
111
|
* @return
|
97
|
112
|
*/
|
|
113
|
+ @ApiOperation(value = "后台商品保存", notes = "后台商品保存")
|
|
114
|
+ @ApiImplicitParams({
|
|
115
|
+ @ApiImplicitParam(dataType = "TaGoods", name = "taGoods", paramType = "body",value = "商品详细数据")
|
|
116
|
+ })
|
98
|
117
|
@RequestMapping(value="/admin/taGoods/add",method= RequestMethod.POST)
|
99
|
118
|
public ResponseBean taGoodsAdd(@RequestBody TaGoods taGoods,HttpServletRequest request){
|
100
|
119
|
ResponseBean responseBean = new ResponseBean();
|
|
@@ -143,6 +162,10 @@ public class TaGoodsController extends BaseController {
|
143
|
162
|
* @param taGoods 实体对象
|
144
|
163
|
* @return
|
145
|
164
|
*/
|
|
165
|
+ @ApiOperation(value = "后台商品修改", notes = "后台商品修改")
|
|
166
|
+ @ApiImplicitParams({
|
|
167
|
+ @ApiImplicitParam(dataType = "TaGoods", name = "taGoods", paramType = "body",value = "商品详细数据")
|
|
168
|
+ })
|
146
|
169
|
@RequestMapping(value="/admin/taGoods",method= RequestMethod.PUT)
|
147
|
170
|
public ResponseBean taGoodsUpdate(@RequestBody TaGoods taGoods,HttpServletRequest request){
|
148
|
171
|
ResponseBean responseBean = new ResponseBean();
|
|
@@ -169,6 +192,10 @@ public class TaGoodsController extends BaseController {
|
169
|
192
|
* @param taGoods 实体对象
|
170
|
193
|
* @return
|
171
|
194
|
*/
|
|
195
|
+ @ApiOperation(value = "后台商品状态变更", notes = "后台商品状态变更")
|
|
196
|
+ @ApiImplicitParams({
|
|
197
|
+ @ApiImplicitParam(dataType = "TaGoods", name = "taGoods", paramType = "body",value = "商品详细数据")
|
|
198
|
+ })
|
172
|
199
|
@RequestMapping(value="/admin/taGoods/change",method= RequestMethod.PUT)
|
173
|
200
|
public ResponseBean taGoodsChange(@RequestBody TaGoods taGoods,HttpServletRequest request){
|
174
|
201
|
ResponseBean responseBean = new ResponseBean();
|
|
@@ -196,6 +223,10 @@ public class TaGoodsController extends BaseController {
|
196
|
223
|
* 根据id查询对象
|
197
|
224
|
* @param id 实体ID
|
198
|
225
|
*/
|
|
226
|
+ @ApiOperation(value = "后台商品详情", notes = "后台商品详情")
|
|
227
|
+ @ApiImplicitParams({
|
|
228
|
+ @ApiImplicitParam(dataType = "Integer", name = "id", paramType = "path",value = "商品id")
|
|
229
|
+ })
|
199
|
230
|
@RequestMapping(value="/admin/taGoods/{id}",method= RequestMethod.GET)
|
200
|
231
|
public ResponseBean taGoodsGet(@PathVariable Integer id){
|
201
|
232
|
ResponseBean responseBean = new ResponseBean();
|
|
@@ -215,6 +246,12 @@ public class TaGoodsController extends BaseController {
|
215
|
246
|
* @param pageSize
|
216
|
247
|
* @return
|
217
|
248
|
*/
|
|
249
|
+ @ApiOperation(value = "微信商品列表", notes = "微信商品列表")
|
|
250
|
+ @ApiImplicitParams({
|
|
251
|
+ @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageNum", paramType = "query",value = "第几页"),
|
|
252
|
+ @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageSize", paramType = "query",value = "一页多少行"),
|
|
253
|
+ @ApiImplicitParam(dataTypeClass = String.class, name = "buildingId", paramType = "query",value = "项目id")
|
|
254
|
+ })
|
218
|
255
|
@RequestMapping(value="/wx/goods",method= RequestMethod.GET)
|
219
|
256
|
public ResponseBean wxGoodsList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
220
|
257
|
@RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
@@ -260,6 +297,10 @@ public class TaGoodsController extends BaseController {
|
260
|
297
|
* 根据id查询对象
|
261
|
298
|
* @param id 实体ID
|
262
|
299
|
*/
|
|
300
|
+ @ApiOperation(value = "微信商品详情", notes = "微信商品详情")
|
|
301
|
+ @ApiImplicitParams({
|
|
302
|
+ @ApiImplicitParam(dataType = "Integer", name = "id", paramType = "path",value = "商品id")
|
|
303
|
+ })
|
263
|
304
|
@RequestMapping(value="/wx/goods/{id}",method= RequestMethod.GET)
|
264
|
305
|
public ResponseBean wxGoodsGet(@PathVariable Integer id){
|
265
|
306
|
ResponseBean responseBean = new ResponseBean();
|
|
@@ -279,6 +320,10 @@ public class TaGoodsController extends BaseController {
|
279
|
320
|
* @param request
|
280
|
321
|
* @return
|
281
|
322
|
*/
|
|
323
|
+ @ApiOperation(value = "微信兑换商品接口", notes = "微信兑换商品接口")
|
|
324
|
+ @ApiImplicitParams({
|
|
325
|
+ @ApiImplicitParam(dataType = "Integer", name = "id", paramType = "path",value = "商品id")
|
|
326
|
+ })
|
282
|
327
|
@RequestMapping(value="/wx/goods/exchange/{id}",method= RequestMethod.POST)
|
283
|
328
|
public ResponseBean wxExchangeGoods(@PathVariable Integer id, HttpServletRequest request){
|
284
|
329
|
ResponseBean responseBean = new ResponseBean();
|