| | |
| | | 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; |
| | |
| | | * @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); |
| | | } |
| | | |
| | | |
| | | } |