use of com.ngtesting.platform.entity.TestDocument in project ngtesting-platform by aaronchen2k.
the class DocumentServiceImpl method genVos.
@Override
public List<DocumentVo> genVos(List<TestDocument> pos) {
List<DocumentVo> vos = new LinkedList<DocumentVo>();
for (TestDocument po : pos) {
DocumentVo vo = genVo(po);
vos.add(vo);
}
return vos;
}
use of com.ngtesting.platform.entity.TestDocument in project ngtesting-platform by aaronchen2k.
the class DocumentServiceImpl method save.
@Override
public TestDocument save(DocumentVo vo) {
if (vo == null) {
return null;
}
TestDocument po = new TestDocument();
if (vo.getId() != null) {
po = (TestDocument) get(TestDocument.class, vo.getId());
}
po.setEventId(vo.getEventId());
po.setTitle(vo.getTitle());
po.setUri(vo.getUri());
saveOrUpdate(po);
return po;
}
use of com.ngtesting.platform.entity.TestDocument in project ngtesting-platform by aaronchen2k.
the class DocumentAction method save.
@AuthPassport(validate = true)
@RequestMapping(value = "save", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> save(HttpServletRequest request, @RequestBody DocumentVo vo) {
Map<String, Object> ret = new HashMap<String, Object>();
TestDocument doc = documentService.save(vo);
ret.put("code", Constant.RespCode.SUCCESS.getCode());
return ret;
}
use of com.ngtesting.platform.entity.TestDocument in project ngtesting-platform by aaronchen2k.
the class DocumentServiceImpl method listByEvent.
@Override
public List<TestDocument> listByEvent(Long eventId, DocType type) {
DetachedCriteria dc = DetachedCriteria.forClass(TestDocument.class);
dc.add(Restrictions.eq("eventId", eventId));
if (type != null) {
dc.add(Restrictions.eq("docType", type));
}
dc.add(Restrictions.eq("deleted", Boolean.FALSE));
dc.add(Restrictions.eq("disabled", Boolean.FALSE));
dc.addOrder(Order.asc("id"));
List<TestDocument> docPos = findAllByCriteria(dc);
return docPos;
}
use of com.ngtesting.platform.entity.TestDocument in project ngtesting-platform by aaronchen2k.
the class DocumentServiceImpl method remove.
@Override
public boolean remove(Long id) {
TestDocument po = (TestDocument) get(TestDocument.class, id);
po.setDeleted(true);
saveOrUpdate(po);
return true;
}
Aggregations