DESKTOP-71BH0QO\L、ming
2021-04-16 52026839eb1503895f325f8d0c9f38b6940fe1f4
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopApi.java
@@ -1,20 +1,22 @@
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
@Slf4j
@RestController
@RequestMapping("/shop")
public class ShopApi {
public class ShopApi{
    @Resource
    private ComShopStoreService comShopStoreService;
@@ -24,9 +26,55 @@
     * @param pageComShopStoreDTO 查询参数
     * @return ComShopStoreVO
     */
    @PostMapping("pageShopStore")
    public R pageShopStore(@RequestBody PageComShopStoreDTO pageComShopStoreDTO){
    @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);
    }
}