use of com.ngtesting.platform.util.AuthPassport in project ngtesting-platform by aaronchen2k.
the class SuiteAction method saveCases.
@AuthPassport(validate = true)
@RequestMapping(value = "saveCases", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> saveCases(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
TestSuite po = suiteService.saveCases(json, userVo);
TestSuiteVo runVo = suiteService.genVo(po);
ret.put("data", runVo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.util.AuthPassport in project ngtesting-platform by aaronchen2k.
the class SuiteAction 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);
TestSuite po = suiteService.save(json, userVo);
TestSuiteVo vo = suiteService.genVo(po);
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 CaseAction method reviewPass.
@AuthPassport(validate = true)
@RequestMapping(value = "reviewPass", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> reviewPass(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
Long id = json.getLong("id");
Boolean pass = json.getBoolean("pass");
TestCase po = caseService.reviewPassPers(id, pass);
TestCaseVo caseVo = caseService.genVo(po);
ret.put("reviewResult", caseVo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.util.AuthPassport in project ngtesting-platform by aaronchen2k.
the class CaseAction method rename.
@AuthPassport(validate = true)
@RequestMapping(value = "rename", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> rename(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
TestCase testCasePo = caseService.renamePers(json, userVo);
caseService.updateParentIfNeededPers(testCasePo.getpId());
TestCaseVo caseVo = caseService.genVo(testCasePo);
ret.put("data", caseVo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.util.AuthPassport in project ngtesting-platform by aaronchen2k.
the class CaseCommentsAction method delete.
@AuthPassport(validate = true)
@RequestMapping(value = "delete", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> delete(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
commentsService.delete(json.getLong("id"), userVo.getId());
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
Aggregations