use of com.ngtesting.platform.entity.TestCase 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.entity.TestCase 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;
}
use of com.ngtesting.platform.entity.TestCase in project ngtesting-platform by aaronchen2k.
the class CaseAction 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);
TestCase po = caseService.save(json, userVo);
TestCaseVo caseVo = caseService.genVo(po, true);
ret.put("data", caseVo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.entity.TestCase in project ngtesting-platform by aaronchen2k.
the class CaseAction method saveField.
@AuthPassport(validate = true)
@RequestMapping(value = "saveField", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> saveField(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 po = caseService.saveField(json, userVo);
TestCaseVo caseVo = caseService.genVo(po);
ret.put("data", caseVo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.entity.TestCase 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;
}
Aggregations