Search in sources :

Example 1 with LibraryPublishForTeacher

use of com.cas.sim.tis.vo.LibraryPublishForTeacher in project TeachingInSimulation by ScOrPiOzzy.

the class LibraryPublishServiceImpl method findPublishForTeacher.

@Override
public PageInfo<LibraryPublishForTeacher> findPublishForTeacher(int pageIndex, int pageSize, int creator) {
    LibraryPublishMapper publishMapper = (LibraryPublishMapper) mapper;
    PageHelper.startPage(pageIndex, pageSize);
    List<LibraryPublishForTeacher> result = publishMapper.findPublishForTeacher(creator);
    PageInfo<LibraryPublishForTeacher> page = new PageInfo<>(result);
    LOG.info("成功查找到{}条资源,当前页码{},每页{}条资源,共{}页", result.size(), pageIndex, pageSize, page.getPages());
    return page;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) LibraryPublishMapper(com.cas.sim.tis.mapper.LibraryPublishMapper) LibraryPublishForTeacher(com.cas.sim.tis.vo.LibraryPublishForTeacher)

Example 2 with LibraryPublishForTeacher

use of com.cas.sim.tis.vo.LibraryPublishForTeacher in project TeachingInSimulation by ScOrPiOzzy.

the class PublishListForTeacher method reload.

private void reload(Integer pageIndex) {
    int pageSize = 10;
    int creator = Session.get(Session.KEY_LOGIN_ID);
    PageInfo<LibraryPublishForTeacher> pageInfo = SpringUtil.getBean(LibraryPublishAction.class).findPublishForTeacher(pageIndex + 1, pageSize, creator);
    if (pageInfo == null) {
        pagination.setPageCount(0);
        table.setItems(null);
        table.build();
    } else {
        pagination.setPageCount((int) pageInfo.getPages());
        JSONArray array = new JSONArray();
        array.addAll(pageInfo.getList());
        table.setItems(array);
        table.build();
    }
}
Also used : LibraryPublishAction(com.cas.sim.tis.action.LibraryPublishAction) JSONArray(com.alibaba.fastjson.JSONArray) LibraryPublishForTeacher(com.cas.sim.tis.vo.LibraryPublishForTeacher)

Aggregations

LibraryPublishForTeacher (com.cas.sim.tis.vo.LibraryPublishForTeacher)2 JSONArray (com.alibaba.fastjson.JSONArray)1 LibraryPublishAction (com.cas.sim.tis.action.LibraryPublishAction)1 LibraryPublishMapper (com.cas.sim.tis.mapper.LibraryPublishMapper)1 PageInfo (com.github.pagehelper.PageInfo)1