公共元素优化

master
DongZeLiang 2024-03-08 14:11:44 +08:00
parent 61b0b14749
commit 931b0d3646
2 changed files with 4 additions and 5 deletions

View File

@ -36,6 +36,8 @@ import com.muyu.common.core.web.page.TableDataInfo;
@RestController
@RequestMapping("/attribute")
public class AttributeInfoController extends BaseController {
@Autowired
private AttributeInfoService attributeInfoService;
@ -83,7 +85,8 @@ public class AttributeInfoController extends BaseController {
@PostMapping
@ApiOperation("新增商品属性")
public Result<String> add(@RequestBody AttributeInfoSaveReq attributeInfoSaveReq) {
return toAjax(attributeInfoService.save(AttributeInfo.saveBuild(attributeInfoSaveReq)));
AttributeInfo attributeInfo = AttributeInfo.saveBuild(attributeInfoSaveReq);
return attributeInfoService.save(attributeInfo) ? success(attributeInfo.getId()) : error();
}
/**

View File

@ -40,10 +40,6 @@ public class AsAttributeGroupServiceImpl extends ServiceImpl<AsAttributeGroupMap
queryWrapper.eq(AsAttributeGroup::getAttributeId, asAttributeGroup.getAttributeId());
}
return list(queryWrapper);
}
}