From 45403c689e2e0d6e69d32e1833faabc116f859e2 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期四, 19 九月 2024 14:58:40 +0800 Subject: [PATCH] 修改接口 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TGoodsTypeController.java | 11 +++++++++++ ruoyi-system/src/main/java/com/ruoyi/system/vo/TFoundationPersonVO.java | 4 ++++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TFoundationPersonController.java | 9 ++++++++- 3 files changed, 23 insertions(+), 1 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TFoundationPersonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TFoundationPersonController.java index ce0710d..f24dc02 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TFoundationPersonController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TFoundationPersonController.java @@ -5,9 +5,11 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.domain.TFoundationConfig; import com.ruoyi.system.domain.TFoundationPerson; +import com.ruoyi.system.domain.TShop; import com.ruoyi.system.dto.TFoundationPersonDTO; import com.ruoyi.system.service.TFoundationConfigService; import com.ruoyi.system.service.TFoundationPersonService; +import com.ruoyi.system.service.TShopService; import com.ruoyi.system.vo.TFoundationPersonVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -32,11 +34,13 @@ public class TFoundationPersonController { private final TFoundationPersonService foundationPersonService; private final TFoundationConfigService foundationConfigService; + private final TShopService shopService; @Autowired - public TFoundationPersonController(TFoundationPersonService foundationPersonService, TFoundationConfigService foundationConfigService) { + public TFoundationPersonController(TFoundationPersonService foundationPersonService, TFoundationConfigService foundationConfigService, TShopService shopService) { this.foundationPersonService = foundationPersonService; this.foundationConfigService = foundationConfigService; + this.shopService = shopService; } /** * 查询基础设置列表 @@ -81,6 +85,9 @@ TFoundationPersonVO foundationPersonVO = new TFoundationPersonVO(); BeanUtils.copyProperties(foundationPerson, foundationPersonVO); foundationPersonVO.setFoundationConfigs(list); + // 查询店铺 + TShop shop = shopService.getById(foundationPersonVO.getShopId()); + foundationPersonVO.setShop(shop); return AjaxResult.success(foundationPersonVO); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TGoodsTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TGoodsTypeController.java index 8457add..229ea56 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TGoodsTypeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TGoodsTypeController.java @@ -52,6 +52,17 @@ } /** + * 查询商品分类列表 + */ + @ApiOperation( value = "查询商品分类列表-后台使用") + @GetMapping(value = "/getList") + public AjaxResult<List<TGoodsType>> getList(@RequestParam("shopId") Long shopId) { + LambdaQueryWrapper<TGoodsType> wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TGoodsType::getShopId, shopId); + return AjaxResult.success(goodsTypeService.list(wrapper)); + } + + /** * 添加商品分类管理 */ @ApiOperation( value = "添加商品分类") diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/vo/TFoundationPersonVO.java b/ruoyi-system/src/main/java/com/ruoyi/system/vo/TFoundationPersonVO.java index 79a54e3..69057eb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/vo/TFoundationPersonVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/vo/TFoundationPersonVO.java @@ -2,6 +2,7 @@ import com.ruoyi.system.domain.TFoundationConfig; import com.ruoyi.system.domain.TFoundationPerson; +import com.ruoyi.system.domain.TShop; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -21,4 +22,7 @@ @ApiModelProperty(value = "最小菜品") private Integer minDish; + @ApiModelProperty(value = "店铺信息") + private TShop shop; + } -- Gitblit v1.7.1