use of com.besscroft.aurora.mall.common.entity.AuthResourceSort in project aurora-mall by besscroft.
the class ResourceSortServiceTest method updateResourceSort.
@Test
void updateResourceSort() {
AuthResourceSort authResourceSort = AuthResourceSort.builder().id(1000L).createTime(LocalDateTime.now()).categoryName("单元测试类别").description("单元测试类别描述").sort(10L).build();
boolean b = resourceSortService.updateResourceSort(authResourceSort);
assertTrue(b, "更新资源类别失败!");
}
use of com.besscroft.aurora.mall.common.entity.AuthResourceSort in project aurora-mall by besscroft.
the class ResourceSortServiceTest method addResourceSort.
@Test
void addResourceSort() {
AuthResourceSort authResourceSort = AuthResourceSort.builder().createTime(LocalDateTime.now()).categoryName("单元测试类别").description("单元测试类别描述").sort(10L).build();
boolean b = resourceSortService.addResourceSort(authResourceSort);
assertTrue(b, "新增资源类别失败!");
}
use of com.besscroft.aurora.mall.common.entity.AuthResourceSort in project aurora-mall by besscroft.
the class ResourceServiceImpl method getAllResourceTree.
@Override
public List<ResourceParam> getAllResourceTree() {
List<ResourceParam> list = new ArrayList<>();
List<AuthResourceSort> resourceSorts = authResourceSortMapper.selectList(new QueryWrapper<>());
resourceSorts.forEach(r -> {
ResourceParam resourceParam = new ResourceParam();
QueryWrapper<AuthResource> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("category_id", r.getId());
List<AuthResource> resources = this.baseMapper.selectList(queryWrapper);
resourceParam.setName(r.getCategoryName());
resourceParam.setDisabled(true);
resourceParam.setChildren(resources);
list.add(resourceParam);
});
return list;
}
use of com.besscroft.aurora.mall.common.entity.AuthResourceSort in project aurora-mall by besscroft.
the class ResourceSortServiceTest method getResourceSortById.
@Test
void getResourceSortById() throws JsonProcessingException {
Long resourceSortId = 1L;
AuthResourceSort resourceSort = resourceSortService.getResourceSortById(resourceSortId);
assertNotNull(resourceSort, "获取资源类别详情失败!");
LOGGER.info("资源类别详情:{}", objectMapper.writeValueAsString(resourceSort));
}
Aggregations