|
|
|
@ -0,0 +1,71 @@
|
|
|
|
|
// 声明当前文件所在的包路径
|
|
|
|
|
package com.service.impl;
|
|
|
|
|
|
|
|
|
|
// 导入字符串处理工具类
|
|
|
|
|
import com.utils.StringUtil;
|
|
|
|
|
// 导入字典数据服务接口
|
|
|
|
|
import com.service.DictionaryService;
|
|
|
|
|
// 导入类差异比较工具类
|
|
|
|
|
import com.utils.ClazzDiff;
|
|
|
|
|
// 导入Spring框架的Bean属性复制工具类
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
// 导入Spring依赖注入注解
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
// 导入Spring服务层组件注解
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
// 导入Java反射Field类
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
// 导入Java集合框架核心类
|
|
|
|
|
import java.util.*;
|
|
|
|
|
// 导入MyBatis-Plus分页插件类
|
|
|
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
|
|
|
// 导入MyBatis-Plus服务实现基类
|
|
|
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
|
|
|
// 导入Spring事务管理注解
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
// 导入分页工具类
|
|
|
|
|
import com.utils.PageUtils;
|
|
|
|
|
// 导入查询参数封装类
|
|
|
|
|
import com.utils.Query;
|
|
|
|
|
// 导入Spring上下文加载器
|
|
|
|
|
import org.springframework.web.context.ContextLoader;
|
|
|
|
|
// 导入Servlet上下文接口
|
|
|
|
|
import javax.servlet.ServletContext;
|
|
|
|
|
// 导入HTTP请求对象类
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
// 导入Spring空值标记注解
|
|
|
|
|
import org.springframework.lang.Nullable;
|
|
|
|
|
// 导入Spring断言工具类
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
// 导入课程留言数据访问接口
|
|
|
|
|
import com.dao.JianshenkechengLiuyanDao;
|
|
|
|
|
// 导入课程留言实体类
|
|
|
|
|
import com.entity.JianshenkechengLiuyanEntity;
|
|
|
|
|
// 导入课程留言服务接口
|
|
|
|
|
import com.service.JianshenkechengLiuyanService;
|
|
|
|
|
// 导入课程留言视图对象类
|
|
|
|
|
import com.entity.view.JianshenkechengLiuyanView;
|
|
|
|
|
|
|
|
|
|
// 使用@Service注解声明为Spring服务组件,并指定bean名称
|
|
|
|
|
@Service("jianshenkechengLiuyanService")
|
|
|
|
|
// 使用@Transactional注解声明类级别事务,所有公共方法默认开启事务
|
|
|
|
|
@Transactional
|
|
|
|
|
// 课程留言服务实现类,继承MyBatis-Plus通用服务实现类
|
|
|
|
|
public class JianshenkechengLiuyanServiceImpl
|
|
|
|
|
extends ServiceImpl<JianshenkechengLiuyanDao, JianshenkechengLiuyanEntity>
|
|
|
|
|
implements JianshenkechengLiuyanService {
|
|
|
|
|
|
|
|
|
|
// 实现分页查询接口方法
|
|
|
|
|
@Override
|
|
|
|
|
public PageUtils queryPage(Map<String,Object> params) {
|
|
|
|
|
// 使用Query工具类根据参数创建分页对象
|
|
|
|
|
Page<JianshenkechengLiuyanView> page = new Query<JianshenkechengLiuyanView>(params).getPage();
|
|
|
|
|
|
|
|
|
|
// 调用Mapper查询分页数据并设置到page对象
|
|
|
|
|
page.setRecords(baseMapper.selectListView(page,params));
|
|
|
|
|
|
|
|
|
|
// 返回封装好的分页工具类实例
|
|
|
|
|
return new PageUtils(page);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|