use of com.ngtesting.platform.vo.CaseTypeVo in project ngtesting-platform by aaronchen2k.
the class CaseTypeServiceImpl method listVos.
@Override
public List<CaseTypeVo> listVos(Long orgId) {
List ls = list(orgId);
List<CaseTypeVo> vos = genVos(ls);
return vos;
}
use of com.ngtesting.platform.vo.CaseTypeVo in project ngtesting-platform by aaronchen2k.
the class CaseTypeServiceImpl method genVo.
// @Override
// public void createDefaultBasicDataPers(Long orgId) {
// DetachedCriteria dc = DetachedCriteria.forClass(TestCaseType.class);
// dc.add(Restrictions.eq("isBuildIn", true));
// dc.add(Restrictions.eq("disabled", Boolean.FALSE));
// dc.add(Restrictions.eq("deleted", Boolean.FALSE));
//
// dc.addOrder(Order.asc("displayOrder"));
// List<TestCaseType> ls = findAllByCriteria(dc);
//
// for (TestCaseType p : ls) {
// TestCaseType temp = new TestCaseType();
// BeanUtilEx.copyProperties(temp, p);
// temp.setId(null);
// temp.setOrgId(orgId);
// saveOrUpdate(temp);
// }
// }
@Override
public CaseTypeVo genVo(TestCaseType po) {
if (po == null) {
return null;
}
CaseTypeVo vo = new CaseTypeVo();
BeanUtilEx.copyProperties(vo, po);
return vo;
}
use of com.ngtesting.platform.vo.CaseTypeVo in project ngtesting-platform by aaronchen2k.
the class CaseTypeAction 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 CaseTypeVo());
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
TestCaseType po = (TestCaseType) caseTypeService.get(TestCaseType.class, id);
CaseTypeVo vo = caseTypeService.genVo(po);
ret.put("data", vo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.vo.CaseTypeVo in project ngtesting-platform by aaronchen2k.
the class CaseTypeAction 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();
CaseTypeVo vo = json.getObject("model", CaseTypeVo.class);
TestCaseType po = caseTypeService.save(vo, orgId);
CaseTypeVo projectVo = caseTypeService.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.vo.CaseTypeVo in project ngtesting-platform by aaronchen2k.
the class CaseTypeAction method setDefault.
@AuthPassport(validate = true)
@RequestMapping(value = "setDefault", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> setDefault(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();
Long id = json.getLong("id");
boolean success = caseTypeService.setDefaultPers(id, orgId);
List<CaseTypeVo> vos = caseTypeService.listVos(orgId);
ret.put("data", vos);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
Aggregations