Search in sources :

Example 1 with DocumentVo

use of com.ngtesting.platform.vo.DocumentVo 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;
}
Also used : TestDocument(com.ngtesting.platform.entity.TestDocument) DocumentVo(com.ngtesting.platform.vo.DocumentVo) LinkedList(java.util.LinkedList)

Example 2 with DocumentVo

use of com.ngtesting.platform.vo.DocumentVo in project ngtesting-platform by aaronchen2k.

the class DocumentAction method list.

@AuthPassport(validate = true)
@RequestMapping(value = "list", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> list(HttpServletRequest request, @RequestBody JSONObject json) {
    Map<String, Object> ret = new HashMap<String, Object>();
    long eventId = json.getLong("eventId");
    int page = json.getInteger("page") == null ? 0 : json.getInteger("page") - 1;
    int pageSize = json.getInteger("pageSize") == null ? Constant.PAGE_SIZE : json.getInteger("pageSize");
    Page pageData = documentService.listByPage(eventId, page, pageSize, null);
    List<DocumentVo> vos = documentService.genVos(pageData.getItems());
    ret.put("collectionSize", pageData.getTotal());
    ret.put("data", vos);
    ret.put("code", Constant.RespCode.SUCCESS.getCode());
    return ret;
}
Also used : HashMap(java.util.HashMap) JSONObject(com.alibaba.fastjson.JSONObject) Page(com.ngtesting.platform.vo.Page) DocumentVo(com.ngtesting.platform.vo.DocumentVo) AuthPassport(com.ngtesting.platform.util.AuthPassport) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 3 with DocumentVo

use of com.ngtesting.platform.vo.DocumentVo in project ngtesting-platform by aaronchen2k.

the class DocumentServiceImpl method genVo.

@Override
public DocumentVo genVo(TestDocument po) {
    DocumentVo vo = new DocumentVo();
    BeanUtilEx.copyProperties(vo, po);
    return vo;
}
Also used : DocumentVo(com.ngtesting.platform.vo.DocumentVo)

Aggregations

DocumentVo (com.ngtesting.platform.vo.DocumentVo)3 JSONObject (com.alibaba.fastjson.JSONObject)1 TestDocument (com.ngtesting.platform.entity.TestDocument)1 AuthPassport (com.ngtesting.platform.util.AuthPassport)1 Page (com.ngtesting.platform.vo.Page)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1