ADD file via upload

杜韦注释
p2x9nfpei 4 months ago
parent e074130ae0
commit bacddb53cf

@ -0,0 +1,67 @@
// 声明该类所在的包为 com.service.impl
package com.service.impl;
// 导入 com.utils 包下的 StringUtil 工具类
import com.utils.StringUtil;
// 导入 com.service 包下的 DictionaryService 接口
import com.service.DictionaryService;
// 导入 com.utils 包下的 ClazzDiff 工具类
import com.utils.ClazzDiff;
// 导入 Spring 框架的 BeanUtils 类,用于 Bean 属性的复制等操作
import org.springframework.beans.BeanUtils;
// 导入 Spring 框架的 Autowired 注解,用于自动装配依赖
import org.springframework.beans.factory.annotation.Autowired;
// 导入 Spring 框架的 Service 注解,将该类标记为服务层组件
import org.springframework.stereotype.Service;
// 导入 Java 反射机制中的 Field 类,用于操作类的字段
import java.lang.reflect.Field;
// 导入 Java 集合框架的相关类,用于处理集合数据
import java.util.*;
// 导入 MyBatis-Plus 的 Page 类,用于分页操作
import com.baomidou.mybatisplus.plugins.Page;
// 导入 MyBatis-Plus 的 ServiceImpl 类,作为服务实现类的基类
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
// 导入 Spring 框架的 Transactional 注解,用于开启事务管理
import org.springframework.transaction.annotation.Transactional;
// 导入自定义的 PageUtils 类,用于处理分页结果
import com.utils.PageUtils;
// 导入自定义的 Query 类,用于构建查询条件和分页信息
import com.utils.Query;
// 导入 Spring 框架的 ContextLoader 类,用于获取 Web 应用上下文
import org.springframework.web.context.ContextLoader;
// 导入 Servlet 上下文类
import javax.servlet.ServletContext;
// 导入 HTTP 请求类
import javax.servlet.http.HttpServletRequest;
// 导入 Spring 框架的 Nullable 注解,标记参数或返回值可以为 null
import org.springframework.lang.Nullable;
// 导入 Spring 框架的 Assert 类,用于进行断言检查
import org.springframework.util.Assert;
// 导入课程收藏的数据访问对象接口
import com.dao.JianshenkechengCollectionDao;
// 导入课程收藏的实体类
import com.entity.JianshenkechengCollectionEntity;
// 导入课程收藏的服务接口
import com.service.JianshenkechengCollectionService;
// 导入课程收藏的视图类
import com.entity.view.JianshenkechengCollectionView;
// 使用 Service 注解将该类注册为 Spring 服务组件,名称为 jianshenkechengCollectionService
@Service("jianshenkechengCollectionService")
// 使用 Transactional 注解开启事务管理
@Transactional
// 定义课程收藏服务实现类,继承自 MyBatis-Plus 的 ServiceImpl 类,并实现 JianshenkechengCollectionService 接口
public class JianshenkechengCollectionServiceImpl extends ServiceImpl<JianshenkechengCollectionDao, JianshenkechengCollectionEntity> implements JianshenkechengCollectionService {
// 重写 JianshenkechengCollectionService 接口中的 queryPage 方法
@Override
// 实现分页查询课程收藏数据的方法,接收一个包含查询参数的 Map 对象
public PageUtils queryPage(Map<String,Object> params) {
// 根据传入的查询参数创建一个 JianshenkechengCollectionView 类型的分页对象
Page<JianshenkechengCollectionView> page = new Query<JianshenkechengCollectionView>(params).getPage();
// 调用数据访问对象的方法查询分页列表数据,并设置到分页对象中
page.setRecords(baseMapper.selectListView(page, params));
// 根据分页对象创建 PageUtils 对象并返回
return new PageUtils(page);
}
}
Loading…
Cancel
Save