From 18df96e3b5df666a6b9b4df6b6e5138067d2afcb Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Tue, 18 Mar 2025 15:08:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0https?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../book/PhotoProductsController.java | 22 ++++++ .../PhotoProductsMainInfoVO.java | 76 +++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 src/main/java/com/cultural/heritage/model/vo/photoProducts/PhotoProductsMainInfoVO.java diff --git a/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java b/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java index bacd6ce..7c7568b 100644 --- a/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java +++ b/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java @@ -27,6 +27,7 @@ import com.cultural.heritage.model.entity.BookingTime; import com.cultural.heritage.model.entity.PhotoProducts; import com.cultural.heritage.model.vo.bookingDate.BookingDateVO; import com.cultural.heritage.model.vo.bookingTime.BookingTimeVO; +import com.cultural.heritage.model.vo.photoProducts.PhotoProductsMainInfoVO; import com.cultural.heritage.model.vo.photoProducts.PhotoProductsVO; import com.cultural.heritage.service.book.AdvanceOrderService; import com.cultural.heritage.service.book.BookingDateService; @@ -304,6 +305,27 @@ public class PhotoProductsController { + /** + * 小程序端用户根据id查询写真产品主要信息 + * @param commonRequest 写真产品id + * @return 写真产品 + */ + @PostMapping("/list/main/id") + @Operation(summary = "小程序端用户根据id查询写真产品主要信息", description = "参数:写真产品id,权限:所有人,方法名:getPhotoProductsMainInfoById") + @AuthCheck(mustRole = UserConstant.ADMIN_ROLE) + public BaseResponse getPhotoProductsMainInfoById(@RequestBody CommonRequest commonRequest) { + if (commonRequest == null || commonRequest.getId() <= 0) { + throw new BusinessException(ErrorCode.PARAMS_ERROR); + } + Long id = commonRequest.getId(); + PhotoProducts photoProducts = photoProductsService.getById(id); + PhotoProductsMainInfoVO photoProductsMainInfoVO = new PhotoProductsMainInfoVO(); + BeanUtils.copyProperties(photoProducts, photoProductsMainInfoVO); + return ResultUtils.success(photoProductsMainInfoVO); + } + + + /** * 小程序端用户根据id查询写真产品 diff --git a/src/main/java/com/cultural/heritage/model/vo/photoProducts/PhotoProductsMainInfoVO.java b/src/main/java/com/cultural/heritage/model/vo/photoProducts/PhotoProductsMainInfoVO.java new file mode 100644 index 0000000..49701cf --- /dev/null +++ b/src/main/java/com/cultural/heritage/model/vo/photoProducts/PhotoProductsMainInfoVO.java @@ -0,0 +1,76 @@ +package com.cultural.heritage.model.vo.photoProducts; + +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +public class PhotoProductsMainInfoVO implements Serializable { + + + /** + * 产品id + */ + private Long id; + + + /** + * 产品名称 + */ + private String name; + + + /** + * 介绍图片 + */ + private String introImg; + + + /** + * 产品详情(富文本) + */ + private String richText; + + + /** + * 最小预约人数 + */ + private Integer minNumber; + + + /** + * 最大预约人数 + */ + private Integer maxNumber; + + + /** + * 拍摄场景 + */ + private String shotScene; + + + /** + * 产品价格 + */ + private BigDecimal price; + + + /** + * 写真类别名称 + */ + private String categoryName; + + + /** + * 是否上架 + */ + private Integer isShelves; + + + + @Serial + private static final long serialVersionUID = 1L; +}