use of com.ngtesting.platform.util.AuthPassport in project ngtesting-platform by aaronchen2k.
the class MsgAction method get.
@AuthPassport(validate = true)
@RequestMapping(value = "get", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> get(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
Long msgId = json.getLong("id");
TestMsgVo vo = msgService.getById(msgId);
ret.put("data", vo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.util.AuthPassport in project ngtesting-platform by aaronchen2k.
the class OrgAction method setDefault.
@AuthPassport(validate = true)
@RequestMapping(value = "setDefault", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> setDefault(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 = json.getLong("id");
orgService.setDefaultPers(orgId, userVo);
pushSettingsService.pushRecentProjects(userVo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.util.AuthPassport in project ngtesting-platform by aaronchen2k.
the class OrgGroupAction method get.
@AuthPassport(validate = true)
@RequestMapping(value = "get", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> get(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();
Long orgGroupId = json.getLong("id");
List<RelationOrgGroupUserVo> relations = orgGroupUserService.listRelationsByGroup(orgId, orgGroupId);
if (orgGroupId == null) {
ret.put("group", new OrgGroupVo());
ret.put("relations", relations);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
TestOrgGroup po = (TestOrgGroup) orgGroupService.get(TestOrgGroup.class, Long.valueOf(orgGroupId));
OrgGroupVo group = orgGroupService.genVo(po);
ret.put("group", group);
ret.put("relations", relations);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.util.AuthPassport in project ngtesting-platform by aaronchen2k.
the class OrgGroupAction 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();
OrgGroupVo group = JSON.parseObject(JSON.toJSONString(json.get("group")), OrgGroupVo.class);
;
List<RelationOrgGroupUserVo> relations = (List<RelationOrgGroupUserVo>) json.get("relations");
TestOrgGroup po = orgGroupService.save(group, orgId);
boolean success = orgGroupUserService.saveRelations(relations);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.util.AuthPassport in project ngtesting-platform by aaronchen2k.
the class OrgRoleAction method list.
@AuthPassport(validate = true)
@RequestMapping(value = "list", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> list(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();
String keywords = json.getString("keywords");
String disabled = json.getString("disabled");
List ls = orgRoleService.list(orgId, keywords, disabled);
List<OrgRoleVo> vos = orgRoleService.genVos(ls);
ret.put("data", vos);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
Aggregations