src/main/java/com/mecol/film/service/impl/PlayServiceImpl.java
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.mecol.film.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mecol.film.entity.Film;
import com.mecol.film.entity.Play;
import com.mecol.film.mapper.PlayMapper;
import com.mecol.film.pojo.PlayPojo;
import com.mecol.film.service.PlayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Transactional
@Service
public class PlayServiceImpl implements PlayService {
@Autowired
private PlayMapper playMapper;
public List<Play> filmById(Integer id) {
return playMapper.filmById(id);
}
public Play playById(Integer id) {
return playMapper.playById(id);
}
public Map list(Integer page) {
Map<String,Object> map=new HashMap<String,Object>();
PageHelper.startPage(page,5);
List<Play> list=playMapper.list();
PageInfo<Play> info=new PageInfo<Play>(list);
//总记录
map.put("conut",info.getTotal());
//是否有上一页
map.put("prevopus",info.isHasPreviousPage());
//是否有下一页
map.put("next",info.isHasNextPage());
//总页数
map.put("pages",info.getPages());
//当前页码
map.put("pageNum",info.getPageNum());
//查到的数组
map.put("info",info.getList());
return map;
}
public Map delist(Integer page) {
Map<String,Object> map=new HashMap<String,Object>();
PageHelper.startPage(page,5);
List<Play> list=playMapper.delist();
PageInfo<Play> info=new PageInfo<Play>(list);
//总记录
map.put("conut",info.getTotal());
//是否有上一页
map.put("prevopus",info.isHasPreviousPage());
后面还有 28 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
