use of com.ngtesting.platform.entity.TestEnv in project ngtesting-platform by aaronchen2k.
the class EnvServiceImpl method genVos.
@Override
public List<TestEnvVo> genVos(List<TestEnv> pos) {
List<TestEnvVo> vos = new LinkedList<TestEnvVo>();
for (TestEnv po : pos) {
TestEnvVo vo = genVo(po);
vos.add(vo);
}
return vos;
}
use of com.ngtesting.platform.entity.TestEnv in project ngtesting-platform by aaronchen2k.
the class EnvServiceImpl method getById.
@Override
public TestEnvVo getById(Long caseId) {
TestEnv po = (TestEnv) get(TestEnv.class, caseId);
TestEnvVo vo = genVo(po);
return vo;
}
use of com.ngtesting.platform.entity.TestEnv in project ngtesting-platform by aaronchen2k.
the class EnvServiceImpl method list.
@Override
public List<TestEnv> list(Long projectId) {
DetachedCriteria dc = DetachedCriteria.forClass(TestEnv.class);
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
dc.add(Restrictions.eq("disabled", Boolean.FALSE));
dc.addOrder(Order.asc("createTime"));
List<TestEnv> ls = findAllByCriteria(dc);
return ls;
}
use of com.ngtesting.platform.entity.TestEnv in project ngtesting-platform by aaronchen2k.
the class EnvServiceImpl method delete.
@Override
public TestEnv delete(Long id, Long clientId) {
TestEnv po = (TestEnv) get(TestEnv.class, id);
po.setDeleted(true);
saveOrUpdate(po);
return po;
}
use of com.ngtesting.platform.entity.TestEnv in project ngtesting-platform by aaronchen2k.
the class EnvAction 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);
TestEnv po = envService.save(json, userVo);
TestEnvVo vo = envService.genVo(po);
optFacade.opt(WsConstant.WS_TODO, userVo.getId().toString());
ret.put("data", vo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
Aggregations