分类绑定品牌规范问题处理
This commit is contained in:
@@ -97,7 +97,7 @@ public class BrandManagerController {
|
||||
@ApiImplicitParam(name = "ids", value = "品牌ID", required = true, dataType = "String", allowMultiple = true, paramType = "path")
|
||||
@DeleteMapping(value = "/delByIds/{ids}")
|
||||
public ResultMessage<Object> delAllByIds(@PathVariable List<String> ids) {
|
||||
brandService.removeByIds(ids);
|
||||
brandService.deleteBrands(ids);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,14 +46,8 @@ public class CategoryBrandManagerController {
|
||||
@ApiImplicitParam(name = "categoryId", value = "分类id", required = true, paramType = "path", dataType = "String"),
|
||||
@ApiImplicitParam(name = "categoryBrands", value = "品牌id数组", required = true, paramType = "query", dataType = "String[]")
|
||||
})
|
||||
public ResultMessage<Object> saveCategoryBrand(@PathVariable String categoryId, @RequestParam String[] categoryBrands) {
|
||||
//删除分类品牌绑定信息
|
||||
this.categoryBrandService.remove(new QueryWrapper<CategoryBrand>().eq("category_id", categoryId));
|
||||
//绑定品牌信息
|
||||
for (String brandId : categoryBrands) {
|
||||
CategoryBrand categoryBrand = new CategoryBrand(categoryId, brandId);
|
||||
categoryBrandService.save(categoryBrand);
|
||||
}
|
||||
public ResultMessage<Object> saveCategoryBrand(@PathVariable String categoryId, @RequestParam List<String> categoryBrands) {
|
||||
categoryBrandService.saveCategoryBrandList(categoryId,categoryBrands);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user