Search in sources :

Example 1 with PostAction

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

the class SysUserController method del.

@PostAction("del/{id}")
public RenderJSON del(Long id) {
    SysUser sysUser = sysUserService.get(id);
    if (null != sysUser) {
        sysUser.setDelStatus(BaseEntity.DELETED);
        sysUserService.update(sysUser);
        return json(R.success("用户删除成功!"));
    }
    return json(R.fail("用户删除失败!"));
}
Also used : SysUser(com.artlongs.sys.model.SysUser) PostAction(org.osgl.mvc.annotation.PostAction)

Example 2 with PostAction

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

the class SysUserController method assignPerm.

/**
 * 保存---分配角色
 * @param funcId
 * @param roleAssignVoList
 * @return
 */
@PostAction("assign/role/{userId}")
public RenderJSON assignPerm(Long userId, List<RoleAssignVo> roleAssignVoList) {
    SysUser sysUser = sysUserService.get(userId);
    if (null == sysUser)
        return json(R.fail("用户不存在。"));
    R r = sysUserService.assignRole(roleAssignVoList, sysUser);
    return json(r);
}
Also used : R(com.artlongs.framework.vo.R) SysUser(com.artlongs.sys.model.SysUser) PostAction(org.osgl.mvc.annotation.PostAction)

Example 3 with PostAction

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

the class SysFuncController method assignPerm.

/**
 * 保存--权限分配
 * @param funcId
 * @param roleAssignVoList
 * @return
 */
@PostAction("assign/perm/{funcId}")
public RenderJSON assignPerm(Long funcId, List<RoleAssignVo> roleAssignVoList) {
    SysFunc sysFunc = sysFuncService.get(new Long(funcId));
    if (null == sysFunc)
        return json(R.fail("功能或菜单不存在。"));
    R r = sysPermissionService.savePermissionOfAssign(roleAssignVoList);
    return json(r);
}
Also used : R(com.artlongs.framework.vo.R) SysFunc(com.artlongs.sys.model.SysFunc) PostAction(org.osgl.mvc.annotation.PostAction)

Example 4 with PostAction

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

the class SysLoginController method loginPost.

@PostAction("post")
public RenderAny loginPost(String userName, String pwd, H.Session session, H.Response response) {
    R vo = loginCheck(userName, pwd, session, response);
    if (vo.isSucc()) {
        to("/sys/home");
    }
    ctx.renderArg("loginMsg", vo.getMsg());
    return render("login.html");
}
Also used : R(com.artlongs.framework.vo.R) PostAction(org.osgl.mvc.annotation.PostAction)

Example 5 with PostAction

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

the class CliOverHttp method run.

@PostAction("cmd")
public Result run(String cmd, ActionContext context) throws IOException {
    CliHandler handler = handler(cmd);
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    CliContext cliContext = new CliOverHttpContext(context, os);
    handler.handle(cliContext);
    cliContext.flush();
    String txt = new String(os.toByteArray(), "UTF-8");
    txt = txt.replace("^J", "\n");
    return text(txt);
}
Also used : CliOverHttpContext(act.cli.CliOverHttpContext) ByteArrayOutputStream(java.io.ByteArrayOutputStream) CliHandler(act.handler.CliHandler) CliContext(act.cli.CliContext) PostAction(org.osgl.mvc.annotation.PostAction)

Aggregations

PostAction (org.osgl.mvc.annotation.PostAction)5 R (com.artlongs.framework.vo.R)3 SysUser (com.artlongs.sys.model.SysUser)2 CliContext (act.cli.CliContext)1 CliOverHttpContext (act.cli.CliOverHttpContext)1 CliHandler (act.handler.CliHandler)1 SysFunc (com.artlongs.sys.model.SysFunc)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1