|
|
|
@ -5,7 +5,9 @@ import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.bookstore.bookmall.product.entity.AttrAttrgroupRelationEntity;
|
|
|
|
|
import com.bookstore.bookmall.product.entity.AttrEntity;
|
|
|
|
|
import com.bookstore.bookmall.product.service.AttrAttrgroupRelationService;
|
|
|
|
|
import com.bookstore.bookmall.product.service.AttrService;
|
|
|
|
|
import com.bookstore.bookmall.product.service.CategoryService;
|
|
|
|
|
import com.bookstore.bookmall.product.vo.AttrGroupRelationVo;
|
|
|
|
@ -35,12 +37,24 @@ public class AttrGroupController {
|
|
|
|
|
private CategoryService categoryService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private AttrService attrService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private AttrAttrgroupRelationService relationService;
|
|
|
|
|
|
|
|
|
|
//添加关联属性
|
|
|
|
|
///product/attrgroup/attr/relation
|
|
|
|
|
@PostMapping("/attr/relation")
|
|
|
|
|
//自定义数据必须加@RequestBody
|
|
|
|
|
public R addRelation(@RequestBody List<AttrGroupRelationVo> vos) {
|
|
|
|
|
relationService.saveBatch(vos);
|
|
|
|
|
return R.ok();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除关联属性
|
|
|
|
|
///product/attrgroup/attr/relation/delete
|
|
|
|
|
@PostMapping("/attr/relation/delete")
|
|
|
|
|
//自定义数据必须加@RequestBody
|
|
|
|
|
private R deleteRelation(@RequestBody AttrGroupRelationVo[] vos) {
|
|
|
|
|
public R deleteRelation(@RequestBody AttrGroupRelationVo[] vos) {
|
|
|
|
|
attrGroupService.deleteRelation(vos);
|
|
|
|
|
return R.ok();
|
|
|
|
|
}
|
|
|
|
@ -48,7 +62,7 @@ public class AttrGroupController {
|
|
|
|
|
//查找有关联的属性
|
|
|
|
|
///product/attrgroup/{attrgroupId}/attr/relation
|
|
|
|
|
@GetMapping("/{attrgroupId}/attr/relation")
|
|
|
|
|
private R attrRelation(@PathVariable("attrgroupId") Long attrgroupId) {
|
|
|
|
|
public R attrRelation(@PathVariable("attrgroupId") Long attrgroupId) {
|
|
|
|
|
List<AttrEntity> entities = attrService.getRelationAttr(attrgroupId);
|
|
|
|
|
return R.ok().put("data",entities);
|
|
|
|
|
}
|
|
|
|
@ -56,7 +70,7 @@ public class AttrGroupController {
|
|
|
|
|
//查找无关联属性
|
|
|
|
|
//product/attrgroup/{attrgroupId}/noattr/
|
|
|
|
|
@GetMapping("/{attrgroupId}/noattr/relation")
|
|
|
|
|
private R attrNoRelation(@PathVariable("attrgroupId") Long attrgroupId,
|
|
|
|
|
public R attrNoRelation(@PathVariable("attrgroupId") Long attrgroupId,
|
|
|
|
|
@RequestParam Map<String, Object> params /*这个是分页参数*/) {
|
|
|
|
|
PageUtils page = attrService.getNoRelationAttr(params, attrgroupId);
|
|
|
|
|
return R.ok().put("page",page);
|
|
|
|
|