use of com.ngtesting.platform.entity.TestCaseExeStatus in project ngtesting-platform by aaronchen2k.
the class CaseExeStatusServiceImpl method genVos.
@Override
public List<CaseExeStatusVo> genVos(List<TestCaseExeStatus> pos) {
List<CaseExeStatusVo> vos = new LinkedList<CaseExeStatusVo>();
for (TestCaseExeStatus po : pos) {
CaseExeStatusVo vo = genVo(po);
vos.add(vo);
}
return vos;
}
use of com.ngtesting.platform.entity.TestCaseExeStatus in project ngtesting-platform by aaronchen2k.
the class CasePropertyServiceImpl method getExeStatusMap.
@Override
public Map<String, String> getExeStatusMap(Long orgId) {
DetachedCriteria dc = DetachedCriteria.forClass(TestCaseExeStatus.class);
dc.add(Restrictions.eq("orgId", orgId));
dc.add(Restrictions.eq("disabled", Boolean.FALSE));
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
dc.addOrder(Order.asc("displayOrder"));
List<TestCaseExeStatus> ls = findAllByCriteria(dc);
Map<String, String> map = new LinkedHashMap();
for (TestCaseExeStatus item : ls) {
map.put(item.getCode(), item.getName());
}
return map;
}
use of com.ngtesting.platform.entity.TestCaseExeStatus 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.entity.TestCaseExeStatus in project ngtesting-platform by aaronchen2k.
the class CaseExeStatusAction 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);
Long orgId = userVo.getDefaultOrgId();
CaseExeStatusVo vo = json.getObject("model", CaseExeStatusVo.class);
TestCaseExeStatus po = caseExeStatusService.save(vo, orgId);
CaseExeStatusVo projectVo = caseExeStatusService.genVo(po);
ret.put("data", projectVo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.entity.TestCaseExeStatus in project ngtesting-platform by aaronchen2k.
the class CaseExeStatusServiceImpl method delete.
@Override
public boolean delete(Long id) {
TestCaseExeStatus po = (TestCaseExeStatus) get(TestCaseExeStatus.class, id);
po.setDeleted(true);
saveOrUpdate(po);
return true;
}
Aggregations