DESKTOP-71BH0QO\L、ming
2021-04-16 52026839eb1503895f325f8d0c9f38b6940fe1f4
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
78
79
80
package com.panzhihua.service_community.api;
 
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.shop.ShopStoreVO;
import com.panzhihua.service_community.service.ComShopStoreService;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
 
@Slf4j
@RestController
@RequestMapping("/shop")
public class ShopApi{
 
    @Resource
    private ComShopStoreService comShopStoreService;
 
    /**
     * 店铺列表-分页查询
     * @param pageComShopStoreDTO 查询参数
     * @return ComShopStoreVO
     */
    @PostMapping("/pageShopStore")
    public R pageShopStore(@RequestBody PageComShopStoreDTO pageComShopStoreDTO) {
        return comShopStoreService.pageStoreList(pageComShopStoreDTO);
    }
 
    /**
     * 保存店铺
     *
     * @param storeVO
     * @return
     */
    @PostMapping("/saveStore")
    public R saveStore(@RequestBody ShopStoreVO storeVO) {
        return comShopStoreService.saveStore(storeVO);
    }
 
    /**
     * 编辑店铺、启用、禁用
     *
     * @param storeVO
     * @param id 商铺Id
     * @return
     */
    @PostMapping("/editStore/{id}")
    public R editStore(@RequestBody ShopStoreVO storeVO, @PathVariable("id") Long id) {
        return comShopStoreService.editStore(id, storeVO);
    }
 
    /**
     * 删除店铺
     *
     * @param id
     * @return
     */
    @PostMapping("/deleteStore")
    public R deleteStore(@RequestBody Long[] id) {
        return comShopStoreService.deleteStore(id);
    }
 
    /**
     * 获取详情
     *
     * @param id
     * @return
     */
    @GetMapping("/getStoreInfo")
    public R getOneInfo(@RequestParam("id") Long id) {
        return comShopStoreService.getOneInfo(id);
    }
 
 
}