产品模块2

This commit is contained in:
xuelijun
2025-07-28 17:51:25 +08:00
parent d07d884286
commit d36f914aa3
8 changed files with 16 additions and 54 deletions

View File

@@ -10,8 +10,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
* 应用服务启动类
*/
@SpringBootApplication
@EnableScheduling
@MapperScan("com.tashow.cloud.product.mapper")
public class ProductServerApplication {
public static void main(String[] args) {

View File

@@ -66,12 +66,11 @@ public class ProdController {
return success(BeanUtils.toBean(prod, ProdRespVO.class));
}
@PermitAll
@GetMapping("/page")
@Operation(summary = "获得商品分页")
@PreAuthorize("@ss.hasPermission('tashow-module-product:prod:query')")
@PermitAll
public CommonResult<PageResult<ProdRespVO>> getProdPage(@Valid ProdPageReqVO pageReqVO) {
PageResult<ProdDO> pageResult = prodService.getProdPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ProdRespVO.class));
public CommonResult<PageResult<List<ProdDO>>> getProdPage(@Valid ProdPageReqVO pageReqVO) {
PageResult<List<ProdDO>> pageResult = prodService.getProdPage(pageReqVO);
return success(pageResult);
}
}

View File

@@ -17,6 +17,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ProdMapper extends BaseMapperX<ProdDO> {
// PageResult<ProdDO> getProdPage1(ProdPageReqVO reqVO);
PageResult<List<ProdDO>> getProdPageList(ProdPageReqVO reqVO);
}

View File

@@ -52,6 +52,6 @@ public interface ProdService {
* @param pageReqVO 分页查询
* @return 商品分页
*/
PageResult<ProdDO> getProdPage(ProdPageReqVO pageReqVO);
PageResult<List<ProdDO>> getProdPage(ProdPageReqVO pageReqVO);
}

View File

@@ -68,8 +68,8 @@ public class ProdServiceImpl implements ProdService {
}
@Override
public PageResult<ProdDO> getProdPage(ProdPageReqVO pageReqVO) {
return null;// prodMapper.getProdPage1(pageReqVO);
public PageResult<List<ProdDO>> getProdPage(ProdPageReqVO pageReqVO) {
return prodMapper.getProdPageList(pageReqVO);
}
}

View File

@@ -1,35 +0,0 @@
<!--
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tashow.cloud.product.mapper.CategoryMapper">
<resultMap id="BaseResultMap" type="com.tashow.cloud.product.domain.Category">
<id property="categoryId" column="category_id" />
<result property="shopId" column="shop_id" />
<result property="parentId" column="parent_id" />
<result property="categoryName" column="category_name" />
<result property="icon" column="icon" />
<result property="pic" column="pic" />
<result property="describe" column="describe" />
<result property="tag" column="tag" />
<result property="seq" column="seq" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="creator" column="creator" />
<result property="grade" column="grade" />
<result property="updateTime" column="update_time" />
<result property="updater" column="updater" />
</resultMap>
<select id="listByParentId" resultType="com.tashow.cloud.product.domain.Category">
select category_id,icon,category_name,`seq`,`status`,pic from tz_category where parent_id = #{parentId} and `status` = 1 order by seq
</select>
<select id="tableCategory" resultType="com.tashow.cloud.product.domain.Category">
select category_id ,parent_id ,category_name,pic,seq,status from tz_category where shop_id = #{shopId} order by seq
</select>
</mapper>
-->

View File

@@ -8,7 +8,7 @@
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<!-- <select id="getProdPage1" resultType="com.tashow.cloud.product.dto.ProdDO">-->
<!-- select * from tz_prod-->
<!-- </select>-->
<select id="getProdPageList" resultType="java.util.List">
select * from tz_prod
</select>
</mapper>