use of com.ngtesting.platform.util.AuthPassport in project ngtesting-platform by aaronchen2k.
the class RunAction 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);
TestRun po = runService.save(json, userVo);
TestRunVo vo = runService.genVo(po);
optFacade.opt(WsConstant.WS_TODO, userVo.getId().toString());
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 SuiteAction 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>();
Long id = json.getLong("id");
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
TestSuite po = suiteService.delete(id, userVo.getId());
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 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 id = json.getLong("id");
TestSuiteVo vo = suiteService.getById(id, false);
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 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>();
Long id = json.getLong("id");
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
TestCase testCase = caseService.delete(id, userVo);
caseService.updateParentIfNeededPers(testCase.getpId());
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 changeContentType.
@AuthPassport(validate = true)
@RequestMapping(value = "changeContentType", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> changeContentType(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
Long id = json.getLong("id");
String contentType = json.getString("contentType");
TestCase po = caseService.changeContentTypePers(id, contentType);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
Aggregations