文件上传https

This commit is contained in:
chen-xin-zhi 2025-03-17 19:29:17 +08:00
parent 4f23116407
commit c318d5d7d4
17 changed files with 134 additions and 192 deletions

View File

@ -10,7 +10,6 @@ import com.cultural.heritage.annotation.AuthCheck;
import com.cultural.heritage.common.BaseResponse;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.common.ResultUtils;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.constant.OrderStatusConstant;
import com.cultural.heritage.constant.UserConstant;
import com.cultural.heritage.exception.BusinessException;
@ -289,7 +288,7 @@ public class PhotoProductsController {
PhotoProductsVO photoProductsVO = new PhotoProductsVO();
BeanUtils.copyProperties(photoProducts, photoProductsVO);
// TODO
photoProductsVO.setIntroImg(FileConstant.SERVER_HOST + photoProducts.getIntroImg());
// photoProductsVO.setIntroImg(FileConstant.SERVER_HOST + photoProducts.getIntroImg());
photoProductsVO.setBookingDateVOList(bookingDateVOList);
photoProductsVOList.add(photoProductsVO);
}
@ -400,7 +399,7 @@ public class PhotoProductsController {
PhotoProductsVO photoProductsVO = new PhotoProductsVO();
BeanUtils.copyProperties(photoProducts, photoProductsVO);
// TODO
photoProductsVO.setIntroImg(FileConstant.SERVER_HOST + photoProductsVO.getIntroImg());
// photoProductsVO.setIntroImg(FileConstant.SERVER_HOST + photoProductsVO.getIntroImg());
photoProductsVO.setBookingDateVOList(bookingDateVOList);
return ResultUtils.success(photoProductsVO);

View File

@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cultural.heritage.common.BaseResponse;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.common.ResultUtils;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.exception.BusinessException;
import com.cultural.heritage.exception.ThrowUtils;
import com.cultural.heritage.model.dto.CommonBatchRequest;
@ -268,7 +267,7 @@ public class CartExperienceController {
Long goodId = cartExperience.getGoodId();
Good good = goodMap.get(goodId);
// TODO
good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
// good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
String reservationDate = cartExperience.getReservationDate();
String timeSlot = cartExperience.getTimeSlot();

View File

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cultural.heritage.common.BaseResponse;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.common.ResultUtils;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.exception.BusinessException;
import com.cultural.heritage.exception.ThrowUtils;
import com.cultural.heritage.model.dto.CommonBatchRequest;
@ -224,7 +223,7 @@ public class CartRecordController {
Long goodId = cartRecord.getGoodId();
Good good = goodMap.get(goodId);
// TODO
good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
// good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
CartGoodVO cartGoodVO = new CartGoodVO();
BeanUtils.copyProperties(good, cartGoodVO);

View File

@ -7,7 +7,6 @@ import com.cultural.heritage.annotation.AuthCheck;
import com.cultural.heritage.common.BaseResponse;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.common.ResultUtils;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.constant.UserConstant;
import com.cultural.heritage.exception.BusinessException;
import com.cultural.heritage.exception.ThrowUtils;
@ -194,9 +193,9 @@ public class CategoryController {
userService.getLoginUser(request);
List<Category> list = categoryService.list();
// TODO
for (Category category : list) {
category.setTypeUrl(FileConstant.SERVER_HOST + category.getTypeUrl());
}
// for (Category category : list) {
// category.setTypeUrl(FileConstant.SERVER_HOST + category.getTypeUrl());
// }
return ResultUtils.success(list);
}
@ -216,9 +215,9 @@ public class CategoryController {
// 获取所有存在上架商品的商品类别
List<Category> categoryList = commonService.findByFieldInTargetField(goodList, categoryService, Good::getType, "typeName");
// TODO
for (Category category : categoryList) {
category.setTypeUrl(FileConstant.SERVER_HOST + category.getTypeUrl());
}
// for (Category category : categoryList) {
// category.setTypeUrl(FileConstant.SERVER_HOST + category.getTypeUrl());
// }
return ResultUtils.success(categoryList);
}
@ -248,9 +247,9 @@ public class CategoryController {
queryWrapper.orderByDesc("id");
List<Good> goodList = goodService.list(queryWrapper);
// TODO
for (Good good : goodList) {
good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
}
// for (Good good : goodList) {
// good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
// }
Map<Long, List<Good>> map = new HashMap<>();
map.put(id, goodList);
return ResultUtils.success(map);

View File

@ -5,7 +5,6 @@ import com.cultural.heritage.annotation.AuthCheck;
import com.cultural.heritage.common.BaseResponse;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.common.ResultUtils;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.constant.UserConstant;
import com.cultural.heritage.exception.BusinessException;
import com.cultural.heritage.model.entity.Festival;
@ -74,8 +73,8 @@ public class FestivalController {
for (Festival festival : festivalList) {
if (festival.getName().equals(festivalName)) {
// TODO
String wholeFilePath = FileConstant.SERVER_HOST + festival.getUrl();
return ResultUtils.success(wholeFilePath); // 返回对应的 URL
// String wholeFilePath = FileConstant.SERVER_HOST + festival.getUrl();
return ResultUtils.success(festival.getUrl()); // 返回对应的 URL
}
}
throw new BusinessException(ErrorCode.OPERATION_ERROR, "该节日项不存在");
@ -93,9 +92,9 @@ public class FestivalController {
public BaseResponse<List<Festival>> getFestivalList() {
List<Festival> festivalList = redisTemplate.opsForList().range(FESTIVAL_KEY, 0, -1);
// TODO
for (Festival festival : festivalList) {
festival.setUrl(FileConstant.SERVER_HOST + festival.getUrl());
}
// for (Festival festival : festivalList) {
// festival.setUrl(FileConstant.SERVER_HOST + festival.getUrl());
// }
return ResultUtils.success(festivalList);
}

View File

@ -12,7 +12,6 @@ import com.cultural.heritage.annotation.AuthCheck;
import com.cultural.heritage.common.BaseResponse;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.common.ResultUtils;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.constant.UserConstant;
import com.cultural.heritage.exception.BusinessException;
import com.cultural.heritage.exception.ThrowUtils;
@ -411,14 +410,14 @@ public class GoodController {
Page<Good> page = goodService.page(new Page<>(current, pageSize), goodQueryWrapper);
List<Good> records = page.getRecords();
// TODO
for (Good good : records) {
String[] goodImgArr = good.getGoodImg().split(";");
for (int i = 0; i < goodImgArr.length; i++) {
goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
}
String joinImg = String.join(";", goodImgArr);
good.setGoodImg(joinImg);
}
// for (Good good : records) {
// String[] goodImgArr = good.getGoodImg().split(";");
// for (int i = 0; i < goodImgArr.length; i++) {
// goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
// }
// String joinImg = String.join(";", goodImgArr);
// good.setGoodImg(joinImg);
// }
List<GoodPageVO> goodPageVOS = commonService.convertList(records, GoodPageVO.class);
Page<GoodPageVO> goodPageVOPage = new Page<>();
goodPageVOPage.setRecords(goodPageVOS);
@ -470,12 +469,12 @@ public class GoodController {
Good good = goodService.getById(id);
ThrowUtils.throwIf(good == null, ErrorCode.OPERATION_ERROR, "商品不存在");
// TODO
String[] goodImgArr = good.getGoodImg().split(";");
for (int i = 0; i < goodImgArr.length; i++) {
goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
}
String joinImg = String.join(";", goodImgArr);
good.setGoodImg(joinImg);
// String[] goodImgArr = good.getGoodImg().split(";");
// for (int i = 0; i < goodImgArr.length; i++) {
// goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
// }
// String joinImg = String.join(";", goodImgArr);
// good.setGoodImg(joinImg);
good.setRichText(DecoderUtils.decodeText(good.getRichText()));
GoodPageVO goodPageVO = new GoodPageVO();
@ -507,9 +506,9 @@ public class GoodController {
Page<Good> page = goodService.page(new Page<>(current, pageSize), goodQueryWrapper);
List<Good> records = page.getRecords();
// TODO
for (Good good : records) {
good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
}
// for (Good good : records) {
// good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
// }
// 获取联表(预约日期表, 预约时间段表)查询结果
List<AppointmentDateTimePeriodVO> appointmentDateTimePeriodVOS = appointmentDateService.queryAppointmentDateDetail();
@ -605,7 +604,7 @@ public class GoodController {
Good good = goodService.getById(id);
ThrowUtils.throwIf(good == null, ErrorCode.NOT_FOUND_ERROR, "商品不存在");
// TODO
good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
// good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
ServiceGoodVO serviceGoodVO = new ServiceGoodVO();
BeanUtils.copyProperties(good, serviceGoodVO);
Long goodVOId = serviceGoodVO.getId();
@ -707,9 +706,9 @@ public class GoodController {
List<Good> goodList = commonService.findByFieldEqTargetFields(conditionMap, goodService);
goodList = goodList.stream().filter(good -> good.getName().contains(keyword)).toList();
// TODO
for (Good good : goodList) {
good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
}
// for (Good good : goodList) {
// good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
// }
List<ServiceGoodCardVO> serviceGoodCardVOS = commonService.convertList(goodList, ServiceGoodCardVO.class);
return ResultUtils.success(serviceGoodCardVOS);
}
@ -745,15 +744,15 @@ public class GoodController {
}
return false;
}).toList();
for (Good good : goodList) {
// TODO
String[] goodImgArr = good.getGoodImg().split(";");
for (int i = 0; i < goodImgArr.length; i++) {
goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
}
String joinImg = String.join(";", goodImgArr);
good.setGoodImg(joinImg);
}
// TODO
// for (Good good : goodList) {
// String[] goodImgArr = good.getGoodImg().split(";");
// for (int i = 0; i < goodImgArr.length; i++) {
// goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
// }
// String joinImg = String.join(";", goodImgArr);
// good.setGoodImg(joinImg);
// }
List<ServiceGoodCardVO> serviceGoodCardVOS = commonService.convertList(goodList, ServiceGoodCardVO.class);
return ResultUtils.success(serviceGoodCardVOS);
}
@ -777,9 +776,9 @@ public class GoodController {
map.put("isShelves", 1);
List<Good> goodList = commonService.findByFieldEqTargetFields(map, goodService);
// TODO
for (Good good : goodList) {
good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
}
// for (Good good : goodList) {
// good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
// }
List<ServiceGoodCardVO> serviceGoodCardVOS = commonService.convertList(goodList, ServiceGoodCardVO.class);
return ResultUtils.success(serviceGoodCardVOS);
}
@ -995,7 +994,7 @@ public class GoodController {
Good good = goodService.getById(id);
ThrowUtils.throwIf(good == null, ErrorCode.NOT_FOUND_ERROR, "商品不存在");
// TODO
good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
// good.setGoodImg(FileConstant.SERVER_HOST + good.getGoodImg());
ServiceGoodCardVO serviceGoodVO = new ServiceGoodCardVO();
BeanUtils.copyProperties(good, serviceGoodVO);

View File

@ -10,7 +10,6 @@ import com.cultural.heritage.annotation.AuthCheck;
import com.cultural.heritage.common.BaseResponse;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.common.ResultUtils;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.constant.OrderStatusConstant;
import com.cultural.heritage.constant.UserConstant;
import com.cultural.heritage.exception.BusinessException;
@ -216,11 +215,11 @@ public class AdvanceOrderController {
List<AdvanceOrder> records = page.getRecords();
List<AdvanceOrderVO> advanceOrderVOS = commonService.convertList(records, AdvanceOrderVO.class);
// TODO
for (AdvanceOrderVO advanceOrderVO : advanceOrderVOS) {
PhotoProductsSnapshot photoProductsSnapshot = advanceOrderVO.getPhotoProductsSnapshot();
photoProductsSnapshot.setIntroImg(FileConstant.SERVER_HOST + photoProductsSnapshot.getIntroImg());
advanceOrderVO.setPhotoProductsSnapshot(photoProductsSnapshot);
}
// for (AdvanceOrderVO advanceOrderVO : advanceOrderVOS) {
// PhotoProductsSnapshot photoProductsSnapshot = advanceOrderVO.getPhotoProductsSnapshot();
// photoProductsSnapshot.setIntroImg(FileConstant.SERVER_HOST + photoProductsSnapshot.getIntroImg());
// advanceOrderVO.setPhotoProductsSnapshot(photoProductsSnapshot);
// }
Page<AdvanceOrderVO> voPage = new Page<>();
voPage.setRecords(advanceOrderVOS);
voPage.setTotal(page.getTotal());
@ -246,11 +245,11 @@ public class AdvanceOrderController {
queryWrapper.eq("userId", userId);
List<AdvanceOrder> advanceOrderList = advanceOrderService.list(queryWrapper);
// TODO
for (AdvanceOrder advanceOrder : advanceOrderList) {
PhotoProductsSnapshot photoProductsSnapshot = advanceOrder.getPhotoProductsSnapshot();
photoProductsSnapshot.setIntroImg(FileConstant.SERVER_HOST + photoProductsSnapshot.getIntroImg());
advanceOrder.setPhotoProductsSnapshot(photoProductsSnapshot);
}
// for (AdvanceOrder advanceOrder : advanceOrderList) {
// PhotoProductsSnapshot photoProductsSnapshot = advanceOrder.getPhotoProductsSnapshot();
// photoProductsSnapshot.setIntroImg(FileConstant.SERVER_HOST + photoProductsSnapshot.getIntroImg());
// advanceOrder.setPhotoProductsSnapshot(photoProductsSnapshot);
// }
// 封装成写真预约订单VO
List<AdvanceOrderVO> advanceOrderVOS = commonService.convertList(advanceOrderList, AdvanceOrderVO.class);
Collections.reverse(advanceOrderVOS);

View File

@ -7,7 +7,6 @@ import com.cultural.heritage.annotation.AuthCheck;
import com.cultural.heritage.common.BaseResponse;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.common.ResultUtils;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.constant.OrderStatusConstant;
import com.cultural.heritage.constant.UserConstant;
import com.cultural.heritage.exception.BusinessException;
@ -259,26 +258,26 @@ public class OrderController {
}
// TODO
for (OrderVO orderVO : orderVOS) {
boolean isGeneral = orderService.isGeneralGood(orderVO.getOrderType());
List<OrderItems> orderItemList = orderVO.getOrderItemList();
for (OrderItems orderItems : orderItemList) {
GoodSnapshot goodSnapshot = orderItems.getGoodSnapshot();
String goodImg = goodSnapshot.getGoodImg();
if (isGeneral) {
String[] goodImgArr = goodImg.split(";");
for (int i = 0; i < goodImgArr.length; i++) {
goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
}
String joinImg = String.join(";", goodImgArr);
goodSnapshot.setGoodImg(joinImg);
} else {
goodSnapshot.setGoodImg(FileConstant.SERVER_HOST + goodSnapshot.getGoodImg());
}
orderItems.setGoodSnapshot(goodSnapshot);
}
orderVO.setOrderItemList(orderItemList);
}
// for (OrderVO orderVO : orderVOS) {
// boolean isGeneral = orderService.isGeneralGood(orderVO.getOrderType());
// List<OrderItems> orderItemList = orderVO.getOrderItemList();
// for (OrderItems orderItems : orderItemList) {
// GoodSnapshot goodSnapshot = orderItems.getGoodSnapshot();
// String goodImg = goodSnapshot.getGoodImg();
// if (isGeneral) {
// String[] goodImgArr = goodImg.split(";");
// for (int i = 0; i < goodImgArr.length; i++) {
// goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
// }
// String joinImg = String.join(";", goodImgArr);
// goodSnapshot.setGoodImg(joinImg);
// } else {
// goodSnapshot.setGoodImg(FileConstant.SERVER_HOST + goodSnapshot.getGoodImg());
// }
// orderItems.setGoodSnapshot(goodSnapshot);
// }
// orderVO.setOrderItemList(orderItemList);
// }
Page<OrderVO> orderVOPage = new Page<>();
@ -336,26 +335,26 @@ public class OrderController {
}).toList();
// TODO
for (OrderVO orderVO : orderVOS) {
boolean isGeneral = orderService.isGeneralGood(orderVO.getOrderType());
List<OrderItems> orderItemList = orderVO.getOrderItemList();
for (OrderItems orderItems : orderItemList) {
GoodSnapshot goodSnapshot = orderItems.getGoodSnapshot();
String goodImg = goodSnapshot.getGoodImg();
if (isGeneral) {
String[] goodImgArr = goodImg.split(";");
for (int i = 0; i < goodImgArr.length; i++) {
goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
}
String joinImg = String.join(";", goodImgArr);
goodSnapshot.setGoodImg(joinImg);
} else {
goodSnapshot.setGoodImg(FileConstant.SERVER_HOST + goodSnapshot.getGoodImg());
}
orderItems.setGoodSnapshot(goodSnapshot);
}
orderVO.setOrderItemList(orderItemList);
}
// for (OrderVO orderVO : orderVOS) {
// boolean isGeneral = orderService.isGeneralGood(orderVO.getOrderType());
// List<OrderItems> orderItemList = orderVO.getOrderItemList();
// for (OrderItems orderItems : orderItemList) {
// GoodSnapshot goodSnapshot = orderItems.getGoodSnapshot();
// String goodImg = goodSnapshot.getGoodImg();
// if (isGeneral) {
// String[] goodImgArr = goodImg.split(";");
// for (int i = 0; i < goodImgArr.length; i++) {
// goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
// }
// String joinImg = String.join(";", goodImgArr);
// goodSnapshot.setGoodImg(joinImg);
// } else {
// goodSnapshot.setGoodImg(FileConstant.SERVER_HOST + goodSnapshot.getGoodImg());
// }
// orderItems.setGoodSnapshot(goodSnapshot);
// }
// orderVO.setOrderItemList(orderItemList);
// }
return ResultUtils.success(orderVOS);
}
@ -404,24 +403,24 @@ public class OrderController {
List<OrderItems> orderItemsList = commonService.findByFieldEqTargetField("orderId", orderId, orderItemService);
orderVO.setOrderItemList(orderItemsList);
// TODO
boolean isGeneral = orderService.isGeneralGood(orderVO.getOrderType());
List<OrderItems> orderItemList = orderVO.getOrderItemList();
for (OrderItems orderItems : orderItemList) {
GoodSnapshot goodSnapshot = orderItems.getGoodSnapshot();
String goodImg = goodSnapshot.getGoodImg();
if (isGeneral) {
String[] goodImgArr = goodImg.split(";");
for (int i = 0; i < goodImgArr.length; i++) {
goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
}
String joinImg = String.join(";", goodImgArr);
goodSnapshot.setGoodImg(joinImg);
} else {
goodSnapshot.setGoodImg(FileConstant.SERVER_HOST + goodSnapshot.getGoodImg());
}
orderItems.setGoodSnapshot(goodSnapshot);
}
orderVO.setOrderItemList(orderItemList);
// boolean isGeneral = orderService.isGeneralGood(orderVO.getOrderType());
// List<OrderItems> orderItemList = orderVO.getOrderItemList();
// for (OrderItems orderItems : orderItemList) {
// GoodSnapshot goodSnapshot = orderItems.getGoodSnapshot();
// String goodImg = goodSnapshot.getGoodImg();
// if (isGeneral) {
// String[] goodImgArr = goodImg.split(";");
// for (int i = 0; i < goodImgArr.length; i++) {
// goodImgArr[i] = FileConstant.SERVER_HOST + goodImgArr[i];
// }
// String joinImg = String.join(";", goodImgArr);
// goodSnapshot.setGoodImg(joinImg);
// } else {
// goodSnapshot.setGoodImg(FileConstant.SERVER_HOST + goodSnapshot.getGoodImg());
// }
// orderItems.setGoodSnapshot(goodSnapshot);
// }
// orderVO.setOrderItemList(orderItemList);
return ResultUtils.success(orderVO);
}

View File

@ -7,7 +7,6 @@ import com.cultural.heritage.annotation.AuthCheck;
import com.cultural.heritage.common.BaseResponse;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.common.ResultUtils;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.constant.OrderStatusConstant;
import com.cultural.heritage.constant.UserConstant;
import com.cultural.heritage.exception.BusinessException;
@ -97,7 +96,7 @@ public class PendingServiceGoodController {
List<PendingServiceGoodVO> pendingServiceGoodVOList = new ArrayList<>();
for (PendingServiceGood pendingServiceGood : pendingServiceGoodList) {
// TODO
pendingServiceGood.setGoodImg(FileConstant.SERVER_HOST + pendingServiceGood.getGoodImg());
// pendingServiceGood.setGoodImg(FileConstant.SERVER_HOST + pendingServiceGood.getGoodImg());
PendingServiceGoodVO pendingServiceGoodVO = new PendingServiceGoodVO();
BeanUtils.copyProperties(pendingServiceGood, pendingServiceGoodVO);
Long goodId = pendingServiceGood.getId();

View File

@ -10,7 +10,6 @@ import com.cultural.heritage.common.BaseResponse;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.common.ResultUtils;
import com.cultural.heritage.config.WxOpenConfig;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.constant.UserConstant;
import com.cultural.heritage.exception.BusinessException;
import com.cultural.heritage.exception.ThrowUtils;
@ -149,7 +148,7 @@ public class UserController {
public BaseResponse<UserVO> getLoginUser(HttpServletRequest request) {
User user = userService.getLoginUser(request);
// TODO
user.setUserAvatar(FileConstant.SERVER_HOST + user.getUserAvatar());
// user.setUserAvatar(FileConstant.SERVER_HOST + user.getUserAvatar());
return ResultUtils.success(userService.getUserVO(user));
}
@ -165,7 +164,7 @@ public class UserController {
public BaseResponse<User> getWebLoginUser(HttpServletRequest request) {
User user = userService.getLoginUser(request);
// TODO
user.setUserAvatar(FileConstant.SERVER_HOST + user.getUserAvatar());
// user.setUserAvatar(FileConstant.SERVER_HOST + user.getUserAvatar());
return ResultUtils.success(user);
}
@ -298,9 +297,9 @@ public class UserController {
Page<User> page = userService.page(new Page<>(current, pageSize), queryWrapper);
List<User> userList = page.getRecords();
// TODO
for (User user : userList) {
user.setUserAvatar(FileConstant.SERVER_HOST + user.getUserAvatar());
}
// for (User user : userList) {
// user.setUserAvatar(FileConstant.SERVER_HOST + user.getUserAvatar());
// }
page.setRecords(userList);
return ResultUtils.success(page);
}
@ -328,9 +327,9 @@ public class UserController {
Page<UserVO> userVOPage = new Page<>(current, pageSize, userPage.getTotal());
List<UserVO> userVOS = userService.getUserVO(userPage.getRecords());
// TODO
for (UserVO userVO : userVOS) {
userVO.setUserAvatar(FileConstant.SERVER_HOST + userVO);
}
// for (UserVO userVO : userVOS) {
// userVO.setUserAvatar(FileConstant.SERVER_HOST + userVO);
// }
userVOPage.setRecords(userVOS);
return ResultUtils.success(userVOPage);
}

View File

@ -9,7 +9,7 @@ import java.math.BigDecimal;
@Data
@Schema(description = "优惠券添加请求体", requiredProperties =
{"name", "standardAmount", "conditionAmount", "requirePoints", "content", "startTime", "endTime", "description"})
{"name", "standardAmount", "conditionAmount", "requirePoints", "startTime", "endTime"})
public class CouponAddRequest implements Serializable {
@ -41,13 +41,6 @@ public class CouponAddRequest implements Serializable {
private Integer requirePoints;
/**
* 优惠券内容
*/
@Schema(description = "优惠券简介", example = "满200减50超值优惠")
private String content;
/**
* 有效截止日期
@ -56,12 +49,6 @@ public class CouponAddRequest implements Serializable {
private String endTime;
/**
* 使用说明
*/
@Schema(description = "使用说明", example = "该优惠券只作用于一个材料包类商品;取消订单后优惠券会自动退回")
private String description;
@Serial
private static final long serialVersionUID = 1L;

View File

@ -9,7 +9,7 @@ import java.math.BigDecimal;
@Data
@Schema(description = "优惠券更新请求体", requiredProperties =
{"id", "name", "conditionAmount", "requirePoints", "content", "startTime", "endTime", "description"})
{"id", "name", "conditionAmount", "requirePoints", "startTime", "endTime"})
public class CouponUpdateRequest implements Serializable {
/**
@ -51,13 +51,6 @@ public class CouponUpdateRequest implements Serializable {
private String endTime;
/**
* 使用说明
*/
@Schema(description = "使用说明", example = "该优惠券只作用于一个材料包类商品;取消订单后优惠券会自动退回")
private String description;
@Serial
private static final long serialVersionUID = 1L;

View File

@ -34,12 +34,6 @@ public class Coupon implements Serializable {
private String name;
/**
* 优惠内容
*/
private String content;
/**
* 满减金额
*/
@ -70,12 +64,6 @@ public class Coupon implements Serializable {
private String endTime;
/**
* 使用说明
*/
private String description;
/**
* 是否上架
*/

View File

@ -22,12 +22,6 @@ public class CouponVO implements Serializable {
private String name;
/**
* 优惠内容
*/
private String content;
/**
* 标准金额
*/
@ -58,12 +52,6 @@ public class CouponVO implements Serializable {
private String endTime;
/**
* 使用说明
*/
private String description;
/**
* 优惠券状态
*/

View File

@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.exception.BusinessException;
import com.cultural.heritage.exception.ThrowUtils;
import com.cultural.heritage.mapper.CartExperienceMapper;
@ -136,7 +135,7 @@ public class CartExperienceServiceImpl extends ServiceImpl<CartExperienceMapper,
cartExperienceVO.setCartExperienceGoodVO(cartExperienceGoodVO);
// TODO
cartExperienceGoodVO.setGoodImg(FileConstant.SERVER_HOST + cartExperienceGoodVO.getGoodImg());
// cartExperienceGoodVO.setGoodImg(FileConstant.SERVER_HOST + cartExperienceGoodVO.getGoodImg());
return cartExperienceVO;
}).toList();
}

View File

@ -3,7 +3,6 @@ package com.cultural.heritage.service.good.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cultural.heritage.common.ErrorCode;
import com.cultural.heritage.constant.FileConstant;
import com.cultural.heritage.exception.BusinessException;
import com.cultural.heritage.exception.ThrowUtils;
import com.cultural.heritage.mapper.CartRecordMapper;
@ -115,7 +114,7 @@ public class CartRecordServiceImpl extends ServiceImpl<CartRecordMapper, CartRec
CartGoodVO goodVO = new CartGoodVO();
BeanUtils.copyProperties(good, goodVO);
// TODO
goodVO.setGoodImg(FileConstant.SERVER_HOST + goodVO.getGoodImg());
// goodVO.setGoodImg(FileConstant.SERVER_HOST + goodVO.getGoodImg());
cartRecordVO.setCartGoodVO(goodVO);
return cartRecordVO;
}).toList();

View File

@ -75,8 +75,6 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
Integer requirePoints = coupon.getRequirePoints();
String startTime = coupon.getStartTime();
String endTime = coupon.getEndTime();
String description = coupon.getDescription();
String content = coupon.getContent();
String status = coupon.getStatus();
if (update) {
@ -97,7 +95,7 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
if (ObjectUtils.isEmpty(requirePoints) || requirePoints < 0) {
throw new BusinessException(ErrorCode.PARAMS_ERROR, "积分参数错误");
}
if (StringUtils.isAnyBlank(name, startTime, endTime, description, content, status)) {
if (StringUtils.isAnyBlank(name, startTime, endTime, status)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR, "存在参数为空");
}
if (startTime.compareTo(endTime) >= 0) {