数据组修改
parent
6af9d033b9
commit
b91dca8eba
|
@ -3,6 +3,8 @@ package com.muyu.product.controller;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
|
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -20,7 +22,6 @@ import com.muyu.common.log.annotation.Log;
|
||||||
import com.muyu.common.log.enums.BusinessType;
|
import com.muyu.common.log.enums.BusinessType;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.product.domain.CategoryInfo;
|
import com.muyu.product.domain.CategoryInfo;
|
||||||
import com.muyu.product.domain.req.CategoryInfoQueryReq;
|
|
||||||
import com.muyu.product.domain.req.CategoryInfoSaveReq;
|
import com.muyu.product.domain.req.CategoryInfoSaveReq;
|
||||||
import com.muyu.product.domain.req.CategoryInfoEditReq;
|
import com.muyu.product.domain.req.CategoryInfoEditReq;
|
||||||
import com.muyu.product.service.CategoryInfoService;
|
import com.muyu.product.service.CategoryInfoService;
|
||||||
|
@ -76,12 +77,15 @@ public class CategoryInfoController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 新增品类信息
|
* 新增品类信息
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@RequiresPermissions("product:category:add")
|
@RequiresPermissions("product:category:add")
|
||||||
@Log(title = "品类信息", businessType = BusinessType.INSERT)
|
@Log(title = "品类信息", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation("新增品类信息")
|
@ApiOperation("新增品类信息")
|
||||||
public Result<String> add(@RequestBody CategoryInfoSaveReq categoryInfoSaveReq) {
|
public Result<String> add(@RequestBody CategoryInfoSaveReq categoryInfoSaveReq) {
|
||||||
return toAjax(categoryInfoService.save(CategoryInfo.saveBuild(categoryInfoSaveReq)));
|
return toAjax(categoryInfoService.save(
|
||||||
|
CategoryInfo.saveModelBuild(categoryInfoSaveReq)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,4 +110,18 @@ public class CategoryInfoController extends BaseController {
|
||||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||||
return toAjax(categoryInfoService.removeBatchByIds(ids));
|
return toAjax(categoryInfoService.removeBatchByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过品类ID获取父级以上的属性、属性组、品牌集合
|
||||||
|
* @param categoryId 品类ID
|
||||||
|
* @return 父级以上的属性、属性组、品牌集合
|
||||||
|
*/
|
||||||
|
@GetMapping("/parentCommonElement/{categoryId}")
|
||||||
|
@ApiOperation("通过品类ID获取父级以上的属性集合")
|
||||||
|
@ApiImplicitParam(name = "categoryId", value = "categoryId", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class, example = "1")
|
||||||
|
public Result<CategoryParentCommonElementResp> parentCommonElement(
|
||||||
|
@PathVariable(value = "categoryId") Long categoryId
|
||||||
|
) {
|
||||||
|
return Result.success(categoryInfoService.parentCommonElement(categoryId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue