use of com.ngtesting.platform.vo.TestCaseStepVo in project ngtesting-platform by aaronchen2k.
the class CaseStepServiceImpl method genVo.
@Override
public TestCaseStepVo genVo(TestCaseStep po) {
TestCaseStepVo vo = new TestCaseStepVo();
BeanUtilEx.copyProperties(vo, po);
return vo;
}
use of com.ngtesting.platform.vo.TestCaseStepVo in project ngtesting-platform by aaronchen2k.
the class CaseStepAction method up.
@AuthPassport(validate = true)
@RequestMapping(value = "up", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> up(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
TestCaseStep po = caseStepService.changeOrderPers(json, "up", userVo.getId());
TestCaseStepVo stepVo = caseStepService.genVo(po);
ret.put("data", stepVo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.TestCaseStepVo in project ngtesting-platform by aaronchen2k.
the class CaseStepAction method down.
@AuthPassport(validate = true)
@RequestMapping(value = "down", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> down(HttpServletRequest request, @RequestBody JSONObject json) {
Map<String, Object> ret = new HashMap<String, Object>();
UserVo userVo = (UserVo) request.getSession().getAttribute(Constant.HTTP_SESSION_USER_KEY);
TestCaseStep po = caseStepService.changeOrderPers(json, "down", userVo.getId());
TestCaseStepVo stepVo = caseStepService.genVo(po);
ret.put("data", stepVo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.TestCaseStepVo in project ngtesting-platform by aaronchen2k.
the class CaseStepAction 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);
TestCaseStep po = caseStepService.save(json, userVo.getId());
TestCaseStepVo stepVo = caseStepService.genVo(po);
ret.put("data", stepVo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.TestCaseStepVo in project ngtesting-platform by aaronchen2k.
the class CaseStepServiceImpl method save.
@Override
public TestCaseStep save(JSONObject json, Long userId) {
TestCaseStepVo vo = JSON.parseObject(JSON.toJSONString(json), TestCaseStepVo.class);
TestCaseStep po = new TestCaseStep();
if (vo.getId() != null) {
po = (TestCaseStep) get(TestCaseStep.class, vo.getId());
BeanUtilEx.copyProperties(po, vo);
} else {
BeanUtilEx.copyProperties(po, vo);
po.setId(null);
moveOthersPers(vo.getTestCaseId(), vo.getOrdr(), "down");
}
saveOrUpdate(po);
return po;
}
Aggregations