| | |
| | | package com.ruoyi.management.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.goods.api.domain.TGoods; |
| | |
| | | import com.ruoyi.goods.api.feignClient.GoodsClient; |
| | | import com.ruoyi.goods.api.model.GoodsTypeQuery; |
| | | import com.ruoyi.goods.api.model.TGoodsVO; |
| | | import com.ruoyi.management.service.ITGoodsService; |
| | | import com.ruoyi.management.service.ITGoodsTypeService; |
| | | import com.ruoyi.management.service.ITOrderService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | @Controller |
| | | @RequestMapping("/tGoods") |
| | | public class TGoodsController { |
| | | @Autowired |
| | | private ITGoodsService goodsService; |
| | | @Autowired |
| | | private ITGoodsTypeService goodsTypeService; |
| | | @Autowired |
| | | private ITOrderService orderService; |
| | | |
| | | @Autowired |
| | | private GoodsClient goodsClient; |
| | | @ResponseBody |
| | |
| | | @PostMapping("/deleteGoodsType") |
| | | @ApiOperation(value = "删除", tags = {"后台-商品类型管理"}) |
| | | public AjaxResult deleteGoodsType(Integer id) { |
| | | goodsClient.deleteGoodsType(id); |
| | | R r = goodsClient.deleteGoodsType(id); |
| | | if (r.getCode()!=200){ |
| | | return AjaxResult.error(r.getMsg()); |
| | | } |
| | | // TGoodsType byId = goodsTypeService.getById(id); |
| | | // byId.setIsDelete(1); |
| | | // goodsTypeService.updateById(byId); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/updateGoods") |
| | | @ApiOperation(value = "修改", tags = {"后台-商品管理"}) |
| | | public AjaxResult<TGoods> updateGoods(@RequestBody TGoods dto) { |
| | | goodsClient.updateGoods(dto); |
| | | return AjaxResult.success("修改成功"); |
| | | public R updateGoods(@RequestBody TGoods dto) { |
| | | R r = goodsClient.updateGoods(dto); |
| | | if (r.getCode()!=200){ |
| | | return R.fail(r.getMsg()); |
| | | } |
| | | return R.ok("修改成功"); |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/getGoodsInfo") |