use of com.ngtesting.platform.util.AuthPassport 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.util.AuthPassport 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.util.AuthPassport in project ngtesting-platform by aaronchen2k.
the class CaseCommentsAction 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);
TestCaseCommentsVo vo = commentsService.save(json, userVo);
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 CaseExeStatusAction 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");
if (id == null) {
ret.put("data", new CaseExeStatusVo());
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
TestCaseExeStatus po = (TestCaseExeStatus) caseExeStatusService.get(TestCaseExeStatus.class, id);
CaseExeStatusVo vo = caseExeStatusService.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 CaseExeStatusAction 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();
List<CaseExeStatusVo> vos = caseExeStatusService.listVos(orgId);
ret.put("data", vos);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
Aggregations