Search in sources :

Example 1 with AuthMenu

use of com.besscroft.aurora.mall.common.entity.AuthMenu in project aurora-mall by besscroft.

the class MenuServiceTest method addMenu.

@Test
void addMenu() {
    AuthMenu authMenu = AuthMenu.builder().id(1000L).name("测试菜单").level(1).parentId(1L).parentTitle("测试父菜单").sort(10).title("测试菜单").createTime(LocalDateTime.now()).hidden(0).component("").build();
    boolean b = menuService.addMenu(authMenu);
    assertNotNull(b, "新增菜单失败!");
}
Also used : AuthMenu(com.besscroft.aurora.mall.common.entity.AuthMenu) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 2 with AuthMenu

use of com.besscroft.aurora.mall.common.entity.AuthMenu in project aurora-mall by besscroft.

the class MenuServiceTest method getMenuById.

@Test
void getMenuById() throws JsonProcessingException {
    Long menuId = 1L;
    AuthMenu authMenu = menuService.getMenuById(menuId);
    assertNotNull(authMenu, "获取菜单失败!");
    LOGGER.info("菜单:{}", objectMapper.writeValueAsString(authMenu));
}
Also used : AuthMenu(com.besscroft.aurora.mall.common.entity.AuthMenu) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 3 with AuthMenu

use of com.besscroft.aurora.mall.common.entity.AuthMenu in project aurora-mall by besscroft.

the class MenuController method getRouter.

@WebLog(description = "获取当前用户管理系统菜单")
@ApiOperation(value = "获取当前用户管理系统菜单")
@GetMapping(value = "/getMenu")
public AjaxResult getRouter() {
    AuthUser currentAdmin = userService.getCurrentAdmin();
    List<AuthMenu> list = menuService.getMenuListById(currentAdmin.getId());
    log.info("菜单:{}", list);
    return AjaxResult.success(list);
}
Also used : AuthMenu(com.besscroft.aurora.mall.common.entity.AuthMenu) AuthUser(com.besscroft.aurora.mall.common.entity.AuthUser) WebLog(com.besscroft.aurora.mall.common.annotation.WebLog) ApiOperation(io.swagger.annotations.ApiOperation)

Example 4 with AuthMenu

use of com.besscroft.aurora.mall.common.entity.AuthMenu in project aurora-mall by besscroft.

the class MenuServiceTest method updateMenu.

@Test
void updateMenu() {
    AuthMenu authMenu = AuthMenu.builder().name("测试菜单").level(1).parentId(1L).parentTitle("测试父菜单").sort(10).title("测试菜单").createTime(LocalDateTime.now()).hidden(0).component("").build();
    boolean b = menuService.updateMenu(authMenu);
    assertNotNull(b, "更新菜单失败!");
}
Also used : AuthMenu(com.besscroft.aurora.mall.common.entity.AuthMenu) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

AuthMenu (com.besscroft.aurora.mall.common.entity.AuthMenu)4 Test (org.junit.jupiter.api.Test)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 WebLog (com.besscroft.aurora.mall.common.annotation.WebLog)1 AuthUser (com.besscroft.aurora.mall.common.entity.AuthUser)1 ApiOperation (io.swagger.annotations.ApiOperation)1