use of com.ngtesting.platform.vo.UserVo in project ngtesting-platform by aaronchen2k.
the class OrgAction 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);
String keywords = json.getString("keywords");
String disabled = json.getString("disabled");
List<OrgVo> vos = orgService.listVo(keywords, disabled, userVo.getId());
ret.put("data", vos);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.UserVo in project ngtesting-platform by aaronchen2k.
the class OrgAction method save.
@AuthPassport(validate = true)
@RequestMapping(value = "save", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> save(HttpServletRequest request, @RequestBody OrgVo vo) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
orgService.save(vo, userVo.getId());
List<OrgVo> vos = orgService.listVo(null, "false", userVo.getId());
pushSettingsService.pushMyOrgs(userVo);
ret.put("myOrgs", vos);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.UserVo in project ngtesting-platform by aaronchen2k.
the class OrgGroupAction 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");
int page = json.getInteger("page") == null ? 0 : json.getInteger("page") - 1;
int pageSize = json.getInteger("pageSize") == null ? Constant.PAGE_SIZE : json.getInteger("pageSize");
Page pageData = orgGroupService.listByPage(orgId, keywords, disabled, page, pageSize);
List<OrgGroupVo> vos = orgGroupService.genVos(pageData.getItems());
ret.put("collectionSize", pageData.getTotal());
ret.put("data", vos);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.UserVo in project ngtesting-platform by aaronchen2k.
the class PlanAction 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 projectId = json.getLong("projectId");
Long id = json.getLong("id");
TestPlanVo vo = planService.getById(id);
List<TestSuite> ls = suiteService.query(projectId, null, null);
List<TestSuiteVo> suites = suiteService.genVos(ls);
ret.put("data", vo);
ret.put("suites", suites);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.UserVo in project ngtesting-platform by aaronchen2k.
the class PlanAction 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);
TestPlan po = planService.save(json, userVo);
TestPlanVo vo = planService.genVo(po);
optFacade.opt(WsConstant.WS_TODO, userVo.getId().toString());
ret.put("data", vo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
Aggregations