Search in sources :

Example 6 with GetAction

use of org.osgl.mvc.annotation.GetAction in project act-eagle-allone by mailtous.

the class SysFuncController method perm_edit.

/**
 * 权限分配窗口页
 * @param id
 * @return
 */
@GetAction("perm_box/{funcId}")
public RenderAny perm_edit(Long funcId) {
    SysFunc sysFunc = sysFuncService.get(new Long(funcId));
    List<SysRole> sysRoleList = sysRoleService.getAllOfList();
    List<Long> roleIds = sysPermissionService.getRoleIdsOfFuncId(funcId);
    Map<Long, Boolean> roleMap = sysPermissionService.roleMapOfpermission(roleIds);
    ctx.renderArg("sysRoleList", sysRoleList);
    ctx.renderArg("sysFunc", sysFunc);
    ctx.renderArg("roleMap", roleMap);
    return render("perm_box.html");
}
Also used : SysFunc(com.artlongs.sys.model.SysFunc) SysRole(com.artlongs.sys.model.SysRole) GetAction(org.osgl.mvc.annotation.GetAction)

Example 7 with GetAction

use of org.osgl.mvc.annotation.GetAction in project act-eagle-allone by mailtous.

the class SysHomeController method home.

@GetAction({ "home", "" })
public RenderAny home(H.Session session, H.Request req) {
    H.Cookie cookie = SysUser.getMyCookie(req);
    if (null == cookie) {
        to("/sys/login");
    }
    SysUser sysUser = session.cached(cookie.value());
    if (null == sysUser) {
        to("/sys/login");
    }
    ctx.renderArg("sysUser", sysUser);
    ctx.renderArg("menuDataUrl", "/sys/home/my/menu.json?userId=" + sysUser.getId());
    return render("home.html");
}
Also used : SysUser(com.artlongs.sys.model.SysUser) H(org.osgl.http.H) GetAction(org.osgl.mvc.annotation.GetAction)

Example 8 with GetAction

use of org.osgl.mvc.annotation.GetAction in project actframework by actframework.

the class AnnotationUtilTest method testGetAnnotation.

@Test
public void testGetAnnotation() {
    Singleton singleton = AnnotationUtil.getAnnotation(Derived.class, Singleton.class);
    assertNotNull(singleton);
    GetAction getAction = AnnotationUtil.getAnnotation(Derived.class, GetAction.class);
    assertNull(getAction);
}
Also used : GetAction(org.osgl.mvc.annotation.GetAction) Singleton(javax.inject.Singleton) Test(org.junit.Test)

Example 9 with GetAction

use of org.osgl.mvc.annotation.GetAction in project actframework by actframework.

the class HelloWorldApp method greeting.

@GetAction("/greeting")
public Result greeting(String who, int age) {
    ActionContext ctx = ActionContext.current();
    ctx.renderArg("who", who);
    return render(who, age);
}
Also used : ActionContext(act.app.ActionContext) GetAction(org.osgl.mvc.annotation.GetAction)

Aggregations

GetAction (org.osgl.mvc.annotation.GetAction)9 SysFunc (com.artlongs.sys.model.SysFunc)3 SysRole (com.artlongs.sys.model.SysRole)3 SysUser (com.artlongs.sys.model.SysUser)2 List (java.util.List)2 ActionContext (act.app.ActionContext)1 Page (com.artlongs.framework.page.Page)1 Singleton (javax.inject.Singleton)1 Test (org.junit.Test)1 H (org.osgl.http.H)1