Compare commits

..

No commits in common. "509a1a95f7d9462e0ba8a574738265cde3642cfa" and "b9ce4ea6dc7f995d72f4537a3750048172bae5c2" have entirely different histories.

2 changed files with 5 additions and 14 deletions

View File

@ -5,8 +5,6 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ -32,7 +30,7 @@ public class AttrGroupVo {
private Long catelogId;
@Schema(name = "catelogPaths", title = "分类路径")
private List<Long> catelogPaths;
private Long[] catelogPaths;
}

View File

@ -10,6 +10,7 @@ import com.mall.product.domain.vo.AttrGroupVo;
import com.mall.product.mapper.AttrGroupMapper;
import com.mall.product.service.AttrGroupService;
import com.mall.product.service.CategoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -26,14 +27,11 @@ import java.util.List;
*/
@Service
@Transactional
@RequiredArgsConstructor
public class AttrGroupServiceImpl extends ServiceImpl<AttrGroupMapper, AttrGroupEntity> implements AttrGroupService {
private final CategoryService categoryService;
public AttrGroupServiceImpl(CategoryService categoryService) {
this.categoryService = categoryService;
}
/**
* * 属性分组 服务实现类
*
@ -97,13 +95,8 @@ public class AttrGroupServiceImpl extends ServiceImpl<AttrGroupMapper, AttrGroup
public AttrGroupVo getAttrGroupById(Long attrGroupId) {
AttrGroupEntity attrGroupEntity = getById(attrGroupId);
Long catelogId = attrGroupEntity.getCatelogId();
// 找到后代所有的路径
List<Long> catelogIds = categoryService.findCatelogPath(catelogId);
AttrGroupVo attrGroupVo = new AttrGroupVo();
BeanUtils.copyProperties(attrGroupEntity, attrGroupVo);
attrGroupVo.setCatelogPaths(catelogIds);
return attrGroupVo;
return null;
}
}