商品参数编辑问题处理
This commit is contained in:
parent
1b5add1d13
commit
d99a4d2d50
@ -1,42 +0,0 @@
|
|||||||
package cn.lili.controller.goods;
|
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
|
||||||
import cn.lili.common.vo.ResultMessage;
|
|
||||||
import cn.lili.modules.goods.entity.vos.GoodsParamsGroupVO;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 管理端,商品关联参数管理接口
|
|
||||||
*
|
|
||||||
* @author pikachu
|
|
||||||
* @date 2020-02-18 15:18:56
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@Api(tags = "管理端,商品关联参数管理接口")
|
|
||||||
@RequestMapping("/manager/goods/parameters")
|
|
||||||
public class GoodsParameterManagerController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GoodsParamsService goodsParamsService;
|
|
||||||
|
|
||||||
@ApiImplicitParams({
|
|
||||||
@ApiImplicitParam(name = "goodsId", value = "商品ID", required = true, paramType = "path", dataType = "String"),
|
|
||||||
@ApiImplicitParam(name = "categoryId", value = "分类ID", required = true, paramType = "path", dataType = "String")
|
|
||||||
})
|
|
||||||
@ApiOperation(value = "通过商品id和分类id查询参数信息")
|
|
||||||
@GetMapping(value = "/{goodsId}/{categoryId}")
|
|
||||||
public ResultMessage<List<GoodsParamsGroupVO>> getGoodsParameters(@PathVariable String goodsId, @PathVariable String categoryId) {
|
|
||||||
return ResultUtil.data(this.goodsParamsService.queryGoodsParams(goodsId, categoryId));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -28,8 +28,6 @@ public class ParameterManagerController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ParametersService parametersService;
|
private ParametersService parametersService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GoodsParamsService goodsParamsService;
|
|
||||||
|
|
||||||
@ApiOperation(value = "添加参数")
|
@ApiOperation(value = "添加参数")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ -47,9 +45,6 @@ public class ParameterManagerController {
|
|||||||
public ResultMessage<Parameters> update(@Valid Parameters parameters) {
|
public ResultMessage<Parameters> update(@Valid Parameters parameters) {
|
||||||
|
|
||||||
if (parametersService.updateById(parameters)) {
|
if (parametersService.updateById(parameters)) {
|
||||||
if (parameters.getIsIndex() != null) {
|
|
||||||
goodsParamsService.updateParametersIsIndex(parameters.getId(), parameters.getIsIndex());
|
|
||||||
}
|
|
||||||
return ResultUtil.data(parameters);
|
return ResultUtil.data(parameters);
|
||||||
}
|
}
|
||||||
throw new ServiceException(ResultCode.PARAMETER_UPDATE_ERROR);
|
throw new ServiceException(ResultCode.PARAMETER_UPDATE_ERROR);
|
||||||
@ -60,7 +55,6 @@ public class ParameterManagerController {
|
|||||||
@DeleteMapping(value = "/{id}")
|
@DeleteMapping(value = "/{id}")
|
||||||
public ResultMessage<Object> delById(@PathVariable String id) {
|
public ResultMessage<Object> delById(@PathVariable String id) {
|
||||||
parametersService.removeById(id);
|
parametersService.removeById(id);
|
||||||
goodsParamsService.deleteByParamId(id);
|
|
||||||
return ResultUtil.success();
|
return ResultUtil.success();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user