use of com.ngtesting.platform.entity.TestVer in project ngtesting-platform by aaronchen2k.
the class VerServiceImpl method save.
@Override
public TestVer save(JSONObject json, UserVo optUser) {
Long id = json.getLong("id");
TestVer po;
TestVerVo vo = JSON.parseObject(JSON.toJSONString(json), TestVerVo.class);
Constant.MsgType action;
if (id != null) {
po = (TestVer) get(TestVer.class, id);
action = Constant.MsgType.update;
} else {
po = new TestVer();
action = Constant.MsgType.create;
}
po.setName(vo.getName());
po.setStartTime(vo.getStartTime());
po.setEndTime(vo.getEndTime());
po.setDescr(vo.getDescr());
po.setProjectId(vo.getProjectId());
saveOrUpdate(po);
return po;
}
use of com.ngtesting.platform.entity.TestVer in project ngtesting-platform by aaronchen2k.
the class VerServiceImpl method getById.
@Override
public TestVerVo getById(Long caseId) {
TestVer po = (TestVer) get(TestVer.class, caseId);
TestVerVo vo = genVo(po);
return vo;
}
use of com.ngtesting.platform.entity.TestVer in project ngtesting-platform by aaronchen2k.
the class VerServiceImpl method delete.
@Override
public TestVer delete(Long id, Long clientId) {
TestVer po = (TestVer) get(TestVer.class, id);
po.setDeleted(true);
saveOrUpdate(po);
return po;
}
use of com.ngtesting.platform.entity.TestVer in project ngtesting-platform by aaronchen2k.
the class VerServiceImpl method genVos.
@Override
public List<TestVerVo> genVos(List<TestVer> pos) {
List<TestVerVo> vos = new LinkedList<TestVerVo>();
for (TestVer po : pos) {
TestVerVo vo = genVo(po);
vos.add(vo);
}
return vos;
}
use of com.ngtesting.platform.entity.TestVer in project ngtesting-platform by aaronchen2k.
the class VerAction 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);
TestVer po = verService.save(json, userVo);
TestVerVo vo = verService.genVo(po);
ret.put("data", vo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
Aggregations