use of com.ngtesting.platform.entity.SysRole in project ngtesting-platform by aaronchen2k.
the class SysRoleServiceImpl method genVos.
@Override
public List<RoleVo> genVos(List<SysRole> pos) {
List<RoleVo> vos = new LinkedList<RoleVo>();
for (SysRole po : pos) {
RoleVo vo = genVo(po);
vos.add(vo);
}
return vos;
}
use of com.ngtesting.platform.entity.SysRole in project ngtesting-platform by aaronchen2k.
the class SysRoleAction method get.
@AuthPassport(validate = true)
@RequestMapping(value = "get", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> get(HttpServletRequest request, @RequestBody JSONObject req) {
Map<String, Object> ret = new HashMap<String, Object>();
String accountId = req.getString("id");
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
SysRole po = (SysRole) roleService.get(SysRole.class, Long.valueOf(accountId));
RoleVo vo = roleService.genVo(po);
ret.put("data", vo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.entity.SysRole in project ngtesting-platform by aaronchen2k.
the class SysRoleAction method save.
@AuthPassport(validate = true)
@RequestMapping(value = "save", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> save(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
Long orgId = userVo.getDefaultOrgId();
RoleVo vo = json.getObject("role", RoleVo.class);
SysRole po = roleService.save(vo, orgId);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.entity.SysRole in project ngtesting-platform by aaronchen2k.
the class SysRoleServiceImpl method save.
@Override
public SysRole save(RoleVo vo, Long orgId) {
if (vo == null) {
return null;
}
SysRole po = new SysRole();
if (vo.getId() != null) {
po = (SysRole) get(SysRole.class, vo.getId());
}
po.setName(vo.getName());
po.setDescr(vo.getDescr());
po.setDisabled(vo.getDisabled());
saveOrUpdate(po);
return po;
}
use of com.ngtesting.platform.entity.SysRole in project ngtesting-platform by aaronchen2k.
the class SysRoleServiceImpl method delete.
@Override
public boolean delete(Long id) {
SysRole po = (SysRole) get(SysRole.class, id);
po.setDeleted(true);
saveOrUpdate(po);
return true;
}
Aggregations