use of com.ngtesting.platform.entity.TestCasePriority in project ngtesting-platform by aaronchen2k.
the class CasePriorityServiceImpl method delete.
@Override
public boolean delete(Long id) {
TestCasePriority po = (TestCasePriority) get(TestCasePriority.class, id);
po.setDeleted(true);
saveOrUpdate(po);
return true;
}
use of com.ngtesting.platform.entity.TestCasePriority in project ngtesting-platform by aaronchen2k.
the class CasePriorityServiceImpl method genVos.
@Override
public List<CasePriorityVo> genVos(List<TestCasePriority> pos) {
List<CasePriorityVo> vos = new LinkedList<CasePriorityVo>();
for (TestCasePriority po : pos) {
CasePriorityVo vo = genVo(po);
vos.add(vo);
}
return vos;
}
use of com.ngtesting.platform.entity.TestCasePriority in project ngtesting-platform by aaronchen2k.
the class CasePropertyServiceImpl method getPriorityMap.
@Override
public Map<String, String> getPriorityMap(Long orgId) {
DetachedCriteria dc = DetachedCriteria.forClass(TestCasePriority.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<TestCasePriority> ls = findAllByCriteria(dc);
Map<String, String> map = new LinkedHashMap();
for (TestCasePriority item : ls) {
map.put(item.getCode(), item.getName());
}
return map;
}
use of com.ngtesting.platform.entity.TestCasePriority in project ngtesting-platform by aaronchen2k.
the class CasePriorityAction 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();
CasePriorityVo vo = json.getObject("model", CasePriorityVo.class);
TestCasePriority po = casePriorityService.save(vo, orgId);
CasePriorityVo projectVo = casePriorityService.genVo(po);
Map<String, Map<String, String>> casePropertyMap = casePropertyService.getMap(orgId);
ret.put("casePropertyMap", casePropertyMap);
ret.put("data", projectVo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.entity.TestCasePriority in project ngtesting-platform by aaronchen2k.
the class CasePriorityAction 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 CasePriorityVo());
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
TestCasePriority po = (TestCasePriority) casePriorityService.get(TestCasePriority.class, id);
CasePriorityVo vo = casePriorityService.genVo(po);
ret.put("data", vo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
Aggregations