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.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.List;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ -32,7 +30,7 @@ public class AttrGroupVo {
private Long catelogId; private Long catelogId;
@Schema(name = "catelogPaths", title = "分类路径") @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.mapper.AttrGroupMapper;
import com.mall.product.service.AttrGroupService; import com.mall.product.service.AttrGroupService;
import com.mall.product.service.CategoryService; import com.mall.product.service.CategoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -26,14 +27,11 @@ import java.util.List;
*/ */
@Service @Service
@Transactional @Transactional
@RequiredArgsConstructor
public class AttrGroupServiceImpl extends ServiceImpl<AttrGroupMapper, AttrGroupEntity> implements AttrGroupService { public class AttrGroupServiceImpl extends ServiceImpl<AttrGroupMapper, AttrGroupEntity> implements AttrGroupService {
private final CategoryService categoryService; private final CategoryService categoryService;
public AttrGroupServiceImpl(CategoryService categoryService) {
this.categoryService = categoryService;
}
/** /**
* * 属性分组 服务实现类 * * 属性分组 服务实现类
* *
@ -98,12 +96,7 @@ public class AttrGroupServiceImpl extends ServiceImpl<AttrGroupMapper, AttrGroup
AttrGroupEntity attrGroupEntity = getById(attrGroupId); AttrGroupEntity attrGroupEntity = getById(attrGroupId);
Long catelogId = attrGroupEntity.getCatelogId(); Long catelogId = attrGroupEntity.getCatelogId();
// 找到后代所有的路径
List<Long> catelogIds = categoryService.findCatelogPath(catelogId); List<Long> catelogIds = categoryService.findCatelogPath(catelogId);
return null;
AttrGroupVo attrGroupVo = new AttrGroupVo();
BeanUtils.copyProperties(attrGroupEntity, attrGroupVo);
attrGroupVo.setCatelogPaths(catelogIds);
return attrGroupVo;
} }
} }