Kaynağa Gözat

Merge remote-tracking branch 'origin/main' into main

zhangwei 3 gün önce
ebeveyn
işleme
27c15ff238
23 değiştirilmiş dosya ile 749 ekleme ve 69 silme
  1. 10 0
      edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/commodity/ShopCategoryRemoteController.java
  2. 2 0
      edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/commodity/ShopReviewRemoteController.java
  3. 67 0
      edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/dto/ShopCategoryDto.java
  4. 66 0
      edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/vo/ShopCategoryVo.java
  5. 70 0
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/entity/ShopUnit.java
  6. 16 0
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/exception/GlobalExceptionHandler.java
  7. 6 0
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/mapper/ShopCategoryMapper.java
  8. 7 0
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/mapper/ShopUnitMapper.java
  9. 9 0
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/ShopCategoryService.java
  10. 11 0
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/ShopUnitService.java
  11. 141 22
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/impl/ShopCategoryServiceImpl.java
  12. 6 0
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/impl/ShopReviewServiceImpl.java
  13. 11 0
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/impl/ShopUnitServiceImpl.java
  14. 186 13
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/web/ShopCategoryController.java
  15. 8 4
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/web/ShopReviewController.java
  16. 17 0
      edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/web/ShopUnitController.java
  17. 55 0
      edu-travel-service/edu-travel-service-commodity/src/main/resources/mapper/ShopCategoryMapper.xml
  18. 22 0
      edu-travel-service/edu-travel-service-commodity/src/main/resources/mapper/ShopUnitMapper.xml
  19. 14 2
      edu-travel-service/edu-travel-service-education/src/main/java/edu/travel/education/dto/AddHappyEntryDto.java
  20. 21 23
      edu-travel-service/edu-travel-service-education/src/main/java/edu/travel/education/entity/HappyEntry.java
  21. 0 2
      edu-travel-service/edu-travel-service-education/src/main/java/edu/travel/education/service/impl/HappyEntryServiceImpl.java
  22. 2 1
      edu-travel-service/edu-travel-service-education/src/main/java/edu/travel/education/web/HappyEntryController.java
  23. 2 2
      edu-travel-service/edu-travel-service-education/src/main/resources/mapper/HappyEntryMapper.xml

+ 10 - 0
edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/commodity/ShopCategoryRemoteController.java

@@ -0,0 +1,10 @@
+package edu.travel.remote.commodity;
+
+import edu.travel.remote.base.RemoteBaseController;
+import edu.travel.remote.dto.ShopCategoryDto;
+import edu.travel.remote.vo.ShopCategoryVo;
+import org.springframework.cloud.openfeign.FeignClient;
+
+@FeignClient(name="commodity",path = "/shopCategory")
+public interface ShopCategoryRemoteController extends RemoteBaseController<ShopCategoryVo, ShopCategoryDto> {
+}

+ 2 - 0
edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/commodity/ShopReviewRemoteController.java

@@ -3,6 +3,8 @@ package edu.travel.remote.commodity;
 import edu.travel.remote.base.RemoteBaseController;
 import edu.travel.remote.dto.ShopReviewDto;
 import edu.travel.remote.vo.ShopReviewVo;
+import org.springframework.cloud.openfeign.FeignClient;
 
+@FeignClient(name="commodity",path = "/shopReview")
 public interface ShopReviewRemoteController extends RemoteBaseController<ShopReviewVo, ShopReviewDto> {
 }

+ 67 - 0
edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/dto/ShopCategoryDto.java

@@ -0,0 +1,67 @@
+package edu.travel.remote.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import edu.travel.entity.BaseEntity;
+import edu.travel.po.PagePO;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 商品类型
+ */
+@Data
+public class ShopCategoryDto extends PagePO {
+    /**
+     * 商品类型ID
+     */
+    private Long id;
+
+    /**
+     * 父级分类ID(0表示顶级分类)
+     */
+    private Long parentId;
+    /**
+     * iconID(上传方法返回值)
+     */
+    private String iconId;
+
+    /**
+     * 国家ID
+     */
+    private String countryId;
+
+    /**
+     * 热度值
+     */
+    private Integer heatValue;
+
+    /**
+     * 仓库ID
+     */
+    private Long warehouseId;
+
+    /**
+     * 分类名称
+     */
+    private String typeName;
+
+    /**
+     * 分类图标/封面图
+     */
+    private String imageUrl;
+
+    /**
+     * 排序权重(数值越大越靠前)
+     */
+    private Integer sortOrder;
+
+    /**
+     * 是否启用 0 是 1否
+     */
+    private Integer enable;
+
+}

+ 66 - 0
edu-travel-remote/edu-travel-remote-commodity/src/main/java/edu/travel/remote/vo/ShopCategoryVo.java

@@ -0,0 +1,66 @@
+package edu.travel.remote.vo;
+
+import edu.travel.entity.BaseEntity;
+import lombok.Data;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 商品类型
+ */
+@Data
+
+public class ShopCategoryVo extends BaseEntity {
+    /**
+     * 商品类型ID
+     */
+    private Long id;
+
+    /**
+     * 父级分类ID(0表示顶级分类)
+     */
+    private Long parentId;
+
+    /**
+     * 国家ID
+     */
+    private String countryId;
+
+    /**
+     * 热度值
+     */
+    private Integer heatValue;
+
+    /**
+     * 仓库ID
+     */
+    private Long warehouseId;
+
+    /**
+     * 分类名称
+     */
+    private String typeName;
+
+    /**
+     * 分类图标/封面图
+     */
+    private String imageUrl;
+
+    /**
+     * 排序权重(数值越大越靠前)
+     */
+    private Integer sortOrder;
+
+    /**
+     * 是否启用 0 是 1否
+     */
+    private Integer enable;
+    /**
+     * 子类
+     */
+    private List<ShopCategoryVo> children;
+    /**
+     * map
+     */
+    private Map<String,Object> map;
+}

+ 70 - 0
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/entity/ShopUnit.java

@@ -0,0 +1,70 @@
+package edu.travel.commodity.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 计件单位表
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName(value = "shop_unit")
+public class ShopUnit {
+    /**
+     * 计件单位id
+     */
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    private Long id;
+
+    /**
+     * 单位名
+     */
+    @TableField(value = "unit_name")
+    private String unitName;
+
+    /**
+     * 国家id
+     */
+    @TableField(value = "country_id")
+    private Long countryId;
+
+    /**
+     * 项目code
+     */
+    @TableField(value = "project")
+    private String project;
+
+    /**
+     * 创建人
+     */
+    @TableField(value = "create_user_id")
+    private String createUserId;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    private Date createTime;
+
+    /**
+     * 更新人
+     */
+    @TableField(value = "update_user_id")
+    private String updateUserId;
+
+    @TableField(value = "update_time")
+    private Date updateTime;
+
+    /**
+     * 删除状态
+     */
+    @TableField(value = "delete_flag")
+    private Integer deleteFlag;
+}

+ 16 - 0
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/exception/GlobalExceptionHandler.java

@@ -5,6 +5,9 @@ import edu.travel.exception.BaseException;
 import edu.travel.resp.BaseResponse;
 import edu.travel.resp.PageResponse;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.FieldError;
+import org.springframework.web.bind.MethodArgumentNotValidException;
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.RestControllerAdvice;
 
@@ -21,12 +24,25 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
 @Slf4j
 public class GlobalExceptionHandler {
 
+
     @ExceptionHandler(BaseException.class)
     public BaseResponse<Object> handleUserInfoException(BaseException e){
         e.printStackTrace();
         return new BaseResponse<>(e.getCode(),e.getMessage(),null);
     }
 
+//    @ExceptionHandler(MethodArgumentNotValidException.class)
+//    public BaseResponse<Object> handleValidationException(MethodArgumentNotValidException e) {
+//        BindingResult result = e.getBindingResult();
+//        StringBuilder errorMessage = new StringBuilder();
+//
+//        for (FieldError fieldError : result.getFieldErrors()) {
+//            errorMessage.append(fieldError.getDefaultMessage()).append("; ");
+//        }
+//        return new BaseResponse<>(ResponseCode.LOGIC_ERROR.getCode(), errorMessage.toString().trim(), null);
+//    }
+
+
     @ExceptionHandler(IllegalArgumentException.class)
     public BaseResponse<Object> handleException(IllegalArgumentException e){
         e.printStackTrace();

+ 6 - 0
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/mapper/ShopCategoryMapper.java

@@ -2,6 +2,12 @@ package edu.travel.commodity.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import edu.travel.commodity.entity.ShopCategory;
+import edu.travel.remote.dto.ShopCategoryDto;
+import edu.travel.remote.vo.ShopCategoryVo;
+
+import java.util.List;
 
 public interface ShopCategoryMapper extends BaseMapper<ShopCategory> {
+    List<ShopCategoryVo> selectCategoryWithCountry(ShopCategoryDto shopCategoryDto);
+    int countAll(ShopCategoryDto shopCategoryDto);
 }

+ 7 - 0
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/mapper/ShopUnitMapper.java

@@ -0,0 +1,7 @@
+package edu.travel.commodity.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import edu.travel.commodity.entity.ShopUnit;
+
+public interface ShopUnitMapper extends BaseMapper<ShopUnit> {
+}

+ 9 - 0
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/ShopCategoryService.java

@@ -1,17 +1,26 @@
 package edu.travel.commodity.service;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import edu.travel.commodity.entity.ShopCategory;
 import com.baomidou.mybatisplus.extension.service.IService;
 import edu.travel.remote.dto.BaseDto;
+import edu.travel.remote.dto.ShopCategoryDto;
 import edu.travel.remote.dto.ShopTypeDto;
+import edu.travel.remote.vo.ShopCategoryVo;
 import edu.travel.remote.vo.ShopTypeVo;
+import edu.travel.rpc.RPCBaseResponse;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 
 public interface ShopCategoryService extends IService<ShopCategory>{
 
+    RPCBaseResponse<Page<ShopCategoryVo>> getCategoryPage(ShopCategoryDto shopCategoryDto);
+
     List<ShopTypeVo> getShopType(ShopTypeDto param) throws ExecutionException;
 
     List<ShopTypeVo> getLevelToShopType(BaseDto param) throws ExecutionException;
+
+    RPCBaseResponse<String> uploadIcon(MultipartFile file);
 }

+ 11 - 0
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/ShopUnitService.java

@@ -0,0 +1,11 @@
+package edu.travel.commodity.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import edu.travel.commodity.entity.ShopSpec;
+import edu.travel.commodity.entity.ShopUnit;
+
+
+public interface ShopUnitService extends IService<ShopUnit>{
+
+
+}

+ 141 - 22
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/impl/ShopCategoryServiceImpl.java

@@ -2,44 +2,122 @@ package edu.travel.commodity.service.impl;
 
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileTypeUtil;
+import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import edu.travel.adapter.service.country.CountryAdapter;
+import edu.travel.adapter.service.upload.UploadAdapter;
 import edu.travel.commodity.constant.BaseConstant;
 import edu.travel.commodity.constant.RedisKey;
 import edu.travel.commodity.entity.ShopCategory;
 import edu.travel.commodity.mapper.ShopCategoryMapper;
 import edu.travel.commodity.service.ShopCategoryService;
+import edu.travel.commodity.utils.FIleUtil;
 import edu.travel.commodity.utils.RedisUtil;
 import edu.travel.remote.dto.BaseDto;
+import edu.travel.remote.dto.ShopCategoryDto;
 import edu.travel.remote.dto.ShopTypeDto;
+import edu.travel.remote.feign.mode.vo.banner.BannerVo;
+import edu.travel.remote.upload.dto.EduFileDTO;
+import edu.travel.remote.vo.ShopCategoryVo;
 import edu.travel.remote.vo.ShopTypeVo;
+import edu.travel.rpc.RPCBaseResponse;
+import edu.travel.vo.BaseCountryServeVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.View;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
+import static edu.travel.rpc.RPCBaseResponse.error;
+import static edu.travel.rpc.RPCBaseResponse.success;
+
 @Service
 public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, ShopCategory> implements ShopCategoryService {
     @Autowired
     private RedisUtil redisUtil;
+    @Autowired
+    private UploadAdapter uploadAdapter;
+    @Autowired
+    private CountryAdapter countryAdapter;
+    @Autowired
+    private ShopCategoryMapper shopCategoryMapper;
+
+    @Override
+    public RPCBaseResponse<Page<ShopCategoryVo>> getCategoryPage(ShopCategoryDto shopCategoryDto) {
+        // 查询商品类型数据,确保返回数据正确
+        List<ShopCategoryVo> categoryVos = shopCategoryMapper.selectCategoryWithCountry(shopCategoryDto);
+        int total = shopCategoryMapper.countAll(shopCategoryDto);
+
+        // 提取 CountryID
+        Set<String> countryIds = categoryVos.stream()
+                .map(ShopCategoryVo::getCountryId)
+                .collect(Collectors.toSet());
+
+        // 查询国家信息
+        Map<String, ShopCategoryVo> countryMap = fetchCountryData(countryIds);
+
+        // 遍历并设置国家信息
+        for (ShopCategoryVo shopCategoryVo : categoryVos) {
+            if (shopCategoryVo.getMap() == null) {
+                shopCategoryVo.setMap(new HashMap<>());
+            }
+            // 设置国家信息到 map 中
+            if (countryMap.containsKey(shopCategoryVo.getCountryId())) {
+                shopCategoryVo.getMap().put("countryServe", countryMap.get(shopCategoryVo.getCountryId()));
+            }
+        }
+
+        // 封装返回结果
+        Page<ShopCategoryVo> pageVoLink = new Page<>();
+        pageVoLink.setRecords(categoryVos);
+        pageVoLink.setTotal(total);
+        pageVoLink.setCurrent(shopCategoryDto.getCurrentPage());
+        pageVoLink.setSize(shopCategoryDto.getPageSize());
+        return new RPCBaseResponse<>(200, "SUCCESS", pageVoLink);
+    }
+
+    // 查询国家信息
+    private Map<String, ShopCategoryVo> fetchCountryData(Set<String> countryIds) {
+        Map<String, ShopCategoryVo> countryMap = new HashMap<>();
+        for (String countryId : countryIds) {
+            // 假设 countryAdapter.getFormId(countryId) 返回 RPCBaseResponse<BaseCountryServeVo>
+            BaseCountryServeVo countryServeVo = countryAdapter.getFormId(countryId).getData();
+            if (countryServeVo != null) {
+                ShopCategoryVo countryVo = new ShopCategoryVo();  // 使用 ShopCategoryVo 来存储国家信息
+                countryVo.setCountryId(countryId);
+                countryVo.setMap(new HashMap<>());
+                countryVo.getMap().put("countryNameZh", countryServeVo.getCountryNameZh());
+                countryVo.getMap().put("countryNameEn", countryServeVo.getCountryNameEn());
+                countryVo.getMap().put("countryNameLocal", countryServeVo.getCountryNameLocal());
+
+                // 将国家信息放入 countryMap
+                countryMap.put(countryId, countryVo);
+            }
+        }
+        return countryMap;
+    }
 
     @Override
     public List<ShopTypeVo> getShopType(ShopTypeDto shopTypeDto) {
-        String redisKey="";
-        if(shopTypeDto.getIsHeat().equals(BaseConstant.BASIC_STATUS_NO_STR)){
-            redisKey=RedisKey.PRODUCT_HOT_TYPE;
-        }else {
-            redisKey=RedisKey.PRODUCT_TYPE;
+        String redisKey = "";
+        if (shopTypeDto.getIsHeat().equals(BaseConstant.BASIC_STATUS_NO_STR)) {
+            redisKey = RedisKey.PRODUCT_HOT_TYPE;
+        } else {
+            redisKey = RedisKey.PRODUCT_TYPE;
         }
-        String string = redisUtil.getString(redisKey+shopTypeDto.getCountryId());
-        if(!ObjectUtil.isEmpty(string)){
+        String string = redisUtil.getString(redisKey + shopTypeDto.getCountryId());
+        if (!ObjectUtil.isEmpty(string)) {
             JSONArray objects = JSONUtil.parseArray(string);
             return JSONUtil.toList(objects, ShopTypeVo.class);
         }
@@ -47,18 +125,18 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
         //条件构建
         query.eq(ShopCategory::getCountryId, shopTypeDto.getCountryId());
 
-        if(shopTypeDto.getIsHeat().equals(BaseConstant.BASIC_STATUS_NO_STR)){
+        if (shopTypeDto.getIsHeat().equals(BaseConstant.BASIC_STATUS_NO_STR)) {
             query.orderByDesc(ShopCategory::getHeatValue);
-        }else {
+        } else {
             query.orderByDesc(ShopCategory::getSortOrder);
         }
         List<ShopCategory> list = list(query);
-        if(list.isEmpty()){
+        if (list.isEmpty()) {
             return new ArrayList<>();
         }
         //父级
         List<ShopCategory> collect = list.stream().filter(item -> item.getParentId().equals(0L)).collect(Collectors.toList());
-        if(collect.isEmpty()){
+        if (collect.isEmpty()) {
             return new ArrayList<>();
         }
         List<ShopTypeVo> parent = BeanUtil.copyToList(collect, ShopTypeVo.class);
@@ -67,33 +145,74 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
             List<ShopTypeVo> shopTypeVos = BeanUtil.copyToList(children, ShopTypeVo.class);
             shopCategory.setChildren(shopTypeVos);
         }
-        if(shopTypeDto.getIsHeat().equals(BaseConstant.BASIC_STATUS_NO_STR)){
+        if (shopTypeDto.getIsHeat().equals(BaseConstant.BASIC_STATUS_NO_STR)) {
             //24小时热门过期
-            redisUtil.setString(RedisKey.PRODUCT_HOT_TYPE+shopTypeDto.getCountryId(),JSONUtil.toJsonStr(parent),24*60*60*60, TimeUnit.SECONDS);
-        }else {
-            redisUtil.setString(RedisKey.PRODUCT_TYPE+shopTypeDto.getCountryId(),JSONUtil.toJsonStr(parent));
+            redisUtil.setString(RedisKey.PRODUCT_HOT_TYPE + shopTypeDto.getCountryId(), JSONUtil.toJsonStr(parent), 24 * 60 * 60 * 60, TimeUnit.SECONDS);
+        } else {
+            redisUtil.setString(RedisKey.PRODUCT_TYPE + shopTypeDto.getCountryId(), JSONUtil.toJsonStr(parent));
         }
         return parent;
     }
 
     @Override
     public List<ShopTypeVo> getLevelToShopType(BaseDto param) {
-        String string = redisUtil.getString(RedisKey.PRODUCT_TO_HOT_TYPE+param.getCountryId());
-        if(!ObjectUtil.isEmpty(string)){
+        String string = redisUtil.getString(RedisKey.PRODUCT_TO_HOT_TYPE + param.getCountryId());
+        if (!ObjectUtil.isEmpty(string)) {
             JSONArray objects = JSONUtil.parseArray(string);
             return JSONUtil.toList(objects, ShopTypeVo.class);
         }
         LambdaQueryWrapper<ShopCategory> query = Wrappers.lambdaQuery();
         //条件构建
         query.eq(ShopCategory::getCountryId, param.getCountryId())
-                .orderByDesc(ShopCategory::getHeatValue).ne(ShopCategory::getParentId,0);
+                .orderByDesc(ShopCategory::getHeatValue).ne(ShopCategory::getParentId, 0);
         List<ShopCategory> list = list(query);
-        if(list.isEmpty()){
+        if (list.isEmpty()) {
             return new ArrayList<>();
         }
         List<ShopTypeVo> parent = BeanUtil.copyToList(list, ShopTypeVo.class);
         //24小时热门过期
-        redisUtil.setString(RedisKey.PRODUCT_TO_HOT_TYPE+param.getCountryId(),JSONUtil.toJsonStr(parent),24*60*60*60, TimeUnit.SECONDS);
+        redisUtil.setString(RedisKey.PRODUCT_TO_HOT_TYPE + param.getCountryId(), JSONUtil.toJsonStr(parent), 24 * 60 * 60 * 60, TimeUnit.SECONDS);
         return parent;
     }
+
+    //上传商品类型icon
+    @Override
+    public RPCBaseResponse<String> uploadIcon(MultipartFile file) {
+        //判断上传的文件是否为空或未选择
+        if (file == null || file.isEmpty()) {
+            return error();
+        }
+        try {
+            //获取文件类型
+            String fileType = FileTypeUtil.getType(file.getInputStream());
+            //检查文件类型是否有效且是否在允许的评论图片类型列表中
+            if (fileType != null && BaseConstant.getReviewImageTypes().contains(fileType.toLowerCase())) {
+                //获取用户上传的文件名
+                String filename = file.getOriginalFilename();
+                //检查文件名是否为空
+                if (ObjectUtil.isEmpty(filename)) {
+                    return error();
+                }
+                //初始化上传,获取上传 ID
+                RPCBaseResponse<String> stringRPCBaseResponse = uploadAdapter.initializeUpload();
+                //创建文件 DTO 对象,用于存储文件相关信息
+                EduFileDTO eduFileDTO = new EduFileDTO();
+                eduFileDTO.setUploadId(stringRPCBaseResponse.getData());
+                eduFileDTO.setFileType(fileType);
+                eduFileDTO.setFileName(filename);
+                //生成系统文件名
+                eduFileDTO.setFileSysName(IdUtil.fastSimpleUUID() + DateUtil.format(new Date(), "yyyyMMddHHmmss") + "." + fileType);
+                //计算文件的 MD5 值以便后续验证
+                eduFileDTO.setFileMd5(FIleUtil.calculateFileMd5(file.getBytes()));
+                //调用上传适配器进行文件上传
+                RPCBaseResponse<?> rpcBaseResponse = uploadAdapter.uploadFile(eduFileDTO, file);
+               // 返回成功响应,包含上传后的数据
+                return success(rpcBaseResponse.getData().toString());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return error("file upload fail");
+        }
+        return error();
+    }
 }

+ 6 - 0
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/impl/ShopReviewServiceImpl.java

@@ -190,6 +190,12 @@ public class ShopReviewServiceImpl extends ServiceImpl<ShopReviewMapper, ShopRev
         }
         return error();
     }
+
+    /**
+     * 上传多张图片
+     * @param files
+     * @return
+     */
     public RPCBaseResponse<String> uploadReviewImages(List<MultipartFile> files) {
         // 判断上传的文件列表是否为空或未选择
         if (files == null || files.isEmpty()) {

+ 11 - 0
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/service/impl/ShopUnitServiceImpl.java

@@ -0,0 +1,11 @@
+package edu.travel.commodity.service.impl;
+
+import edu.travel.commodity.mapper.ShopUnitMapper;
+import edu.travel.commodity.service.ShopUnitService;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import edu.travel.commodity.entity.ShopUnit;
+@Service
+public class ShopUnitServiceImpl extends ServiceImpl<ShopUnitMapper, ShopUnit> implements ShopUnitService {
+
+}

+ 186 - 13
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/web/ShopCategoryController.java

@@ -1,39 +1,56 @@
 package edu.travel.commodity.web;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import edu.travel.adapter.service.country.CountryAdapter;
+import edu.travel.adapter.service.upload.UploadAdapter;
 import edu.travel.commodity.entity.ShopCategory;
 import edu.travel.commodity.service.ShopCategoryService;
+import edu.travel.remote.commodity.ShopCategoryRemoteController;
 import edu.travel.remote.dto.BaseDto;
+import edu.travel.remote.dto.ShopCategoryDto;
 import edu.travel.remote.dto.ShopTypeDto;
 import edu.travel.remote.feign.mode.vo.tenant.AddMenuVo;
+import edu.travel.remote.vo.ShopCategoryVo;
+import edu.travel.remote.vo.ShopTypeVo;
 import edu.travel.resp.BaseResponse;
 import edu.travel.rpc.RPCBaseResponse;
-import edu.travel.remote.vo.ShopTypeVo;
+import edu.travel.vo.BaseCountryServeVo;
+import edu.travel.vo.BaseCountryVo;
 import edu.travel.web.BaseController;
-import org.springframework.web.bind.annotation.*;
-
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.ExecutionException;
 
 import static edu.travel.rpc.RPCBaseResponse.success;
 
 /**
-* 商品类型(shop_category)表控制层
-*
-* @author xxxxx
-*/
+ * 商品类型(shop_category)表控制层
+ *
+ * @author xxxxx
+ */
 @RestController
 @RequestMapping("/shopCategory")
-public class ShopCategoryController  extends BaseController<ShopCategory> {
-/**
-* 服务对象
-*/
+public class ShopCategoryController extends BaseController<ShopCategory> implements ShopCategoryRemoteController {
+    /**
+     * 服务对象
+     */
     @Autowired
     private ShopCategoryService shopCategoryService;
+    @Autowired
+    private UploadAdapter uploadAdapter;
+    @Autowired
+    private CountryAdapter countryAdapter;
 
     /**
-     *  获取商品类型
+     * 获取商品类型
+     *
      * @return {@link BaseResponse }<{@link AddMenuVo }>
      */
     @GetMapping("/getShopType")
@@ -42,7 +59,8 @@ public class ShopCategoryController  extends BaseController<ShopCategory> {
     }
 
     /**
-     *  获取二级热门商品类型
+     * 获取二级热门商品类型
+     *
      * @return {@link BaseResponse }<{@link AddMenuVo }>
      */
     @GetMapping("/getLevelToShopType")
@@ -50,4 +68,159 @@ public class ShopCategoryController  extends BaseController<ShopCategory> {
         return success(shopCategoryService.getLevelToShopType(param));
     }
 
+    /**
+     * icon上传
+     */
+    @PostMapping("/uploadIcon")
+    public RPCBaseResponse<String> uploadIcon(MultipartFile file) {
+        return shopCategoryService.uploadIcon(file);
+    }
+
+    /**
+     * 通过id获取商品类型
+     */
+    @Override
+    @GetMapping("/getFormId")
+    public RPCBaseResponse<ShopCategoryVo> getFormId(String id) {
+        RPCBaseResponse<ShopCategory> shopCurrencyRPCBaseResponse = super.getId(id);
+        RPCBaseResponse<ShopCategoryVo> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopCurrencyRPCBaseResponse, shopCurrencyVoRPCBaseResponse);
+        return shopCurrencyVoRPCBaseResponse;
+    }
+
+    /**
+     * 通过id更新商品类型
+     */
+    @Override
+    @PostMapping("/updateTargetFormId")
+    public RPCBaseResponse<ShopCategoryVo> updateTargetFormId(ShopCategoryDto entity) {
+        ShopCategory shopCurrency = new ShopCategory();
+        BeanUtils.copyProperties(entity, shopCurrency);
+        //调用接口获取地址,填入ImageUrl
+        // 检查 iconId 是否为空,
+        if (entity.getIconId() != null) {
+            shopCurrency.setImageUrl(uploadAdapter.getFormId(entity.getIconId()).toString());
+        }
+        RPCBaseResponse<ShopCategory> shopCurrencyRPCBaseResponse = super.updateTargetById(shopCurrency);
+        RPCBaseResponse<ShopCategoryVo> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopCurrencyRPCBaseResponse, shopCurrencyVoRPCBaseResponse);
+        return shopCurrencyVoRPCBaseResponse;
+    }
+
+    /**
+     * 新增商品类型
+     */
+    @Override
+    @PostMapping("/saveFormTarget")
+    public RPCBaseResponse<ShopCategoryVo> saveFormTarget(@RequestBody ShopCategoryDto entity) {
+        ShopCategory shopCurrency = new ShopCategory();
+        BeanUtils.copyProperties(entity, shopCurrency);
+        //调用接口获取地址,填入ImageUrl
+        // 检查 iconId 是否为空,避免 NullPointerException
+        if (entity.getIconId() != null) {
+            shopCurrency.setImageUrl(uploadAdapter.getFormId(entity.getIconId()).toString());
+        } else {
+            shopCurrency.setImageUrl(null);
+        }
+        RPCBaseResponse<ShopCategory> shopCurrencyRPCBaseResponse = super.saveTarget(shopCurrency);
+        RPCBaseResponse<ShopCategoryVo> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopCurrencyRPCBaseResponse, shopCurrencyVoRPCBaseResponse);
+        return shopCurrencyVoRPCBaseResponse;
+    }
+
+    /**
+     * 删除商品类型
+     */
+    @Override
+    @PostMapping("/deleteTargetFormId")
+    public RPCBaseResponse<ShopCategoryVo> deleteTargetFormId(List<String> ids) {
+        RPCBaseResponse<ShopCategory> shopCurrencyRPCBaseResponse = super.deleteTargetById(ids);
+        RPCBaseResponse<ShopCategoryVo> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopCurrencyRPCBaseResponse, shopCurrencyVoRPCBaseResponse);
+        return shopCurrencyVoRPCBaseResponse;
+    }
+
+    /**
+     * 获取所有商品类型(树形结构)
+     */
+    @Override
+    @GetMapping("/getAllForm")
+    public RPCBaseResponse<List<ShopCategoryVo>> getAllForm() {
+        RPCBaseResponse<List<ShopCategory>> shopCurrencyRPCBaseResponse = super.listAll();
+
+        // 创建一个用于存储每个节点的映射
+        Map<Long, ShopCategoryVo> categoryMap = new HashMap<>();
+        List<ShopCategoryVo> result = new ArrayList<>();
+        // 创建一个 Map,用于存储 countryId 对应的数据
+        Map<String, BaseCountryVo> countryDataMap = new HashMap<>();
+
+        // 将所有 ShopCategory 转换为 ShopCategoryVo,并存储在 map 中
+        if (shopCurrencyRPCBaseResponse.getData() != null) {
+            for (ShopCategory category : shopCurrencyRPCBaseResponse.getData()) {
+                ShopCategoryVo categoryVo = new ShopCategoryVo();
+                BeanUtils.copyProperties(category, categoryVo);
+                categoryMap.put(category.getId(), categoryVo);
+
+                // 利用 countryId 查找相关数据并存储到 countryDataMap 中
+                if (category.getCountryId() != null) {
+                    // 假设 countryAdapter.getFormId 是 RPCBaseResponse<BaseCountryServeVo> 类型
+                    RPCBaseResponse<BaseCountryServeVo> countryResponse = countryAdapter.getFormId(category.getCountryId());
+
+                    // 确保 countryResponse 不为 null,并提取数据
+                    if (countryResponse != null && countryResponse.getData() != null) {
+                        BaseCountryServeVo serveVo = countryResponse.getData();
+                        BaseCountryVo countryData = convertToBaseCountryVo(serveVo); // 需要实现此方法进行转换
+                        countryDataMap.put(category.getCountryId(), countryData);
+                    }
+                }
+            }
+
+            // 构建树结构
+            for (ShopCategoryVo categoryVo : categoryMap.values()) {
+                if (categoryVo.getParentId() == null || categoryVo.getParentId() == 0) {
+                    result.add(categoryVo);
+                } else {
+                    ShopCategoryVo parent = categoryMap.get(categoryVo.getParentId());
+                    if (parent != null) {
+                        if (parent.getChildren() == null) {
+                            parent.setChildren(new ArrayList<>());
+                        }
+                        parent.getChildren().add(categoryVo);
+                    }
+                }
+
+                // 如果有对应的 countryData,将其添加到 categoryVo 的 map 属性中
+                if (countryDataMap.containsKey(categoryVo.getCountryId())) {
+                    Map<String, Object> countryDataMapEntry = new HashMap<>();
+                    countryDataMapEntry.put("countryData", countryDataMap.get(categoryVo.getCountryId()));
+                    categoryVo.setMap(countryDataMapEntry);
+                }
+            }
+        }
+        // 创建返回的 RPCBaseResponse
+        RPCBaseResponse<List<ShopCategoryVo>> shopCurrencyVoRPCBaseResponse = new RPCBaseResponse<>();
+        BeanUtils.copyProperties(shopCurrencyRPCBaseResponse, shopCurrencyVoRPCBaseResponse);
+        shopCurrencyVoRPCBaseResponse.setData(result); // 设置树形结构的根节点
+
+        return shopCurrencyVoRPCBaseResponse;
+    }
+
+    // 实现 BaseCountryServeVo 到 BaseCountryVo 的转换方法
+    private BaseCountryVo convertToBaseCountryVo(BaseCountryServeVo serveVo) {
+        BaseCountryVo countryVo = new BaseCountryVo();
+        // 假设 serveVo 有与 countryVo 对应的字段
+        countryVo.setId(serveVo.getId());
+        countryVo.setCountryNameZh(serveVo.getCountryNameZh());
+        countryVo.setCountryNameEn(serveVo.getCountryNameEn());
+        countryVo.setAreaCode(serveVo.getAreaCode());
+        return countryVo;
+    }
+    /**
+     * 查询分页
+     */
+    @GetMapping("/getCategoryPage")
+    public RPCBaseResponse<Page<ShopCategoryVo>>getCategoryPage(ShopCategoryDto shopCategoryDto){
+        return shopCategoryService.getCategoryPage(shopCategoryDto);
+    }
+
 }

+ 8 - 4
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/web/ShopReviewController.java

@@ -59,19 +59,23 @@ public class ShopReviewController extends BaseController<ShopReview> implements
     public RPCBaseResponse<String> addReview(@RequestBody AddReviewDto params) {
         return success(shopReviewService.addReview(params));
     }
+
     /**
      * 上传评论图片
      */
     @PostMapping("/uploadReviewImage")
     public RPCBaseResponse<String> uploadReviewImage(MultipartFile file) {
-        return shopReviewService.uploadReviewImage(file);    }
-/**
- * 上传多张图片/视频
- */
+        return shopReviewService.uploadReviewImage(file);
+    }
+
+    /**
+     * 上传多张图片/视频
+     */
     @PostMapping("/uploadReviewImages")
     public RPCBaseResponse<String> uploadReviewImages(List<MultipartFile> files) {
         return shopReviewService.uploadReviewImages(files);
     }
+
     /**
      * 通过id查找商品评论
      */

+ 17 - 0
edu-travel-service/edu-travel-service-commodity/src/main/java/edu/travel/commodity/web/ShopUnitController.java

@@ -0,0 +1,17 @@
+package edu.travel.commodity.web;
+import edu.travel.commodity.entity.ShopUnit;
+import org.springframework.web.bind.annotation.*;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+* 计件单位表(shop_unit)表控制层
+*
+* @author xxxxx
+*/
+@RestController
+@RequestMapping("/shop_unit")
+public class ShopUnitController {
+
+
+}

+ 55 - 0
edu-travel-service/edu-travel-service-commodity/src/main/resources/mapper/ShopCategoryMapper.xml

@@ -26,4 +26,59 @@
     sort_order, `enable`, project, create_time, create_user_id, update_time, update_user_id, 
     delete_flag
   </sql>
+  <select id="selectCategoryWithCountry" resultType="edu.travel.remote.vo.ShopCategoryVo">
+    SELECT
+    sc.id,
+    sc.parent_id,
+    sc.country_id,
+    sc.heat_value,
+    sc.warehouse_id,
+    sc.type_name,
+    sc.image_url,
+    sc.sort_order,
+    sc.enable,
+    sc.project,
+    sc.create_time,
+    sc.create_user_id,
+    sc.update_time,
+    sc.update_user_id,
+    sc.delete_flag
+    FROM
+   shop_category sc
+    <where>
+      <if test="countryId != null and countryId != ''">
+        AND sc.country_id = #{countryId}
+      </if>
+      <if test="parentId != null and parentId != ''">
+        AND sc.parent_id = #{parentId}
+      </if>
+      <if test="typeName != null and typeName != ''">
+        AND sc.type_name LIKE CONCAT('%', #{typeName}, '%')
+      </if>
+      <if test="enable != null and enable != ''">
+        AND sc.enable = #{enable}
+      </if>
+
+    </where>
+  </select>
+  <select id="countAll" resultType="int">
+    SELECT
+    COUNT(*)
+    FROM
+    shop_category sc
+    <where>
+      <if test="countryId != null and countryId != ''">
+        AND sc.country_id = #{countryId}
+      </if>
+      <if test="parentId != null and parentId != ''">
+        AND sc.parent_id = #{parentId}
+      </if>
+      <if test="typeName != null and typeName != ''">
+        AND sc.type_name LIKE CONCAT('%', #{typeName}, '%')
+      </if>
+      <if test="enable != null and enable != ''">
+        AND sc.enable = #{enable}
+      </if>
+    </where>
+  </select>
 </mapper>

+ 22 - 0
edu-travel-service/edu-travel-service-commodity/src/main/resources/mapper/ShopUnitMapper.xml

@@ -0,0 +1,22 @@
+<?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="edu.travel.commodity.mapper.ShopUnitMapper">
+  <resultMap id="BaseResultMap" type="edu.travel.commodity.entity.ShopUnit">
+    <!--@mbg.generated-->
+    <!--@Table shop_unit-->
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="unit_name" jdbcType="VARCHAR" property="unitName" />
+    <result column="country_id" jdbcType="BIGINT" property="countryId" />
+    <result column="project" jdbcType="VARCHAR" property="project" />
+    <result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id, unit_name, country_id, project, create_user_id, create_time, update_user_id, 
+    update_time, delete_flag
+  </sql>
+</mapper>

+ 14 - 2
edu-travel-service/edu-travel-service-education/src/main/java/edu/travel/education/dto/AddHappyEntryDto.java

@@ -15,61 +15,73 @@ import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
+import javax.validation.constraints.NotNull;
+
 /**
  * 开心中文报名表
  */
 @Data
 @AllArgsConstructor
 @NoArgsConstructor
-public class AddHappyEntryDto{
+public class AddHappyEntryDto {
 
     /**
      * 姓
      */
+    @NotNull(message = "姓不能为空")
     private String surname;
 
     /**
      * 名
      */
+    @NotNull(message = "名不能为空")
     private String name;
 
     /**
      * 电话号码
      */
+    @NotNull(message = "电话号码不能为空")
     private String phone;
 
     /**
      * 国家区号
      */
+    @NotNull(message = "国家区号不能为空")
     private String areaCode;
 
     /**
      * 课程类型
      */
+    @NotNull(message = "课程类型不能为空")
     private Integer courseType;
 
     /**
      * 最小年龄
      */
+    @NotNull(message = "最小年龄不能为空")
     private Integer minAge;
 
     /**
      * 最大年龄
      */
+    @NotNull(message = "最大年龄不能为空")
     private Integer maxAge;
 
     /**
      * 邮箱
      */
+    @NotNull(message = "邮箱不能为空")
     private String email;
 
     /**
      * 项目code
      */
+//    @NotNull(message = "项目code不能为空")
     private String project;
 
     /**
      * 所属国家id
      */
+    @NotNull(message = "所属国家不能为空")
     private Long countryId;
-}
+}

+ 21 - 23
edu-travel-service/edu-travel-service-education/src/main/java/edu/travel/education/entity/HappyEntry.java

@@ -30,65 +30,63 @@ public class HappyEntry extends BaseEntity {
     @TableId(value = "id", type = IdType.ASSIGN_ID)
     private Long id;
 
-    /**
-    * 姓
-    */
-    @NotNull
+    @NotNull(message = "姓不能为空")
     @TableField(value = "surname")
     private String surname;
 
     /**
      * 国家
      */
-    @NotNull
+    @NotNull(message = "国家不能为空")
     @TableField(value = "country_id")
     private Long countryId;
+
     /**
-    * 名
-    */
-    @NotNull
+     * 名
+     */
+    @NotNull(message = "名不能为空")
     @TableField(value = "name")
     private String name;
 
     /**
-    * 电话号码
-    */
-    @NotNull
+     * 电话号码
+     */
+    @NotNull(message = "电话号码不能为空")
     @TableField(value = "phone")
     private String phone;
 
     /**
-    * 国家区号
-    */
-    @NotNull
+     * 国家区号
+     */
+    @NotNull(message = "国家区号不能为空")
     @TableField(value = "area_code")
     private String areaCode;
 
     /**
-    * 课程类型
-    */
-    @NotNull
+     * 课程类型
+     */
+    @NotNull(message = "课程类型不能为空")
     @TableField(value = "course_type")
     private Integer courseType;
 
     /**
-    * 最小年龄
-    */
-    @NotNull
+     * 最小年龄
+     */
+    @NotNull(message = "最小年龄不能为空")
     @TableField(value = "min_age")
     private Integer minAge;
 
     /**
      * 最大年龄
      */
-    @NotNull
+    @NotNull(message = "最大年龄不能为空")
     @TableField(value = "max_age")
     private Integer maxAge;
 
     /**
      * 邮箱
      */
-    @NotNull
+    @NotNull(message = "邮箱不能为空")
     @TableField(value = "email")
     private String email;
 
@@ -96,7 +94,7 @@ public class HappyEntry extends BaseEntity {
      * 课程类型字典
      */
     @TableField(exist = false)
-    @LinkConst(fieldName = "courseType",clazz = CourseTypeDict.class)
+    @LinkConst(fieldName = "courseType", clazz = CourseTypeDict.class)
     private Map CodeCourseTypeDict;
 
     /**

+ 0 - 2
edu-travel-service/edu-travel-service-education/src/main/java/edu/travel/education/service/impl/HappyEntryServiceImpl.java

@@ -33,8 +33,6 @@ import static com.alibaba.druid.sql.visitor.SQLEvalVisitorUtils.like;
 @Service
 public class HappyEntryServiceImpl  extends SysServiceImpl<HappyEntryMapper, HappyEntry> implements HappyEntryService{
 
-    @Autowired
-    private HappyEntryMapper happyEntryMapper;
 
     @Override
     @Transactional

+ 2 - 1
edu-travel-service/edu-travel-service-education/src/main/java/edu/travel/education/web/HappyEntryController.java

@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
 
 import org.springframework.beans.factory.annotation.Autowired;
 
+import javax.validation.Valid;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -38,7 +39,7 @@ public class HappyEntryController extends BaseController<HappyEntry> {
      */
     @PostMapping("/addHappyEntry")
     @PreAuthorize("permitAll()")
-    public RPCBaseResponse<HappyEntryVo> addHappyEntry(@RequestBody AddHappyEntryDto happyEntryDto){
+    public RPCBaseResponse<HappyEntryVo> addHappyEntry(@Valid @RequestBody AddHappyEntryDto happyEntryDto){
         HappyEntryVo vo = happyEntryService.addHappyEntry(happyEntryDto);
         HappyEntry oneLink = happyEntryService.getOneLink(new LambdaQueryWrapper<HappyEntry>().eq(HappyEntry::getId, vo.getId()));
         HappyEntryVo happyEntryVo = BeanUtil.copyProperties(oneLink, HappyEntryVo.class);

+ 2 - 2
edu-travel-service/edu-travel-service-education/src/main/resources/mapper/HappyEntryMapper.xml

@@ -45,8 +45,8 @@
       min_age,max_age, email, project,
       create_time, create_user_id, update_time, 
       update_user_id, delete_flag)
-    values (#{id,jdbcType=BIGINT}, #{surname,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},  #{countryId,jdbcType=BIGINT},
-      #{phone,jdbcType=VARCHAR}, #{areaCode,jdbcType=VARCHAR}, #{courseType,jdbcType=INTEGER}, 
+    values (#{id,jdbcType=BIGINT}, #{surname,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
+      #{phone,jdbcType=VARCHAR}, #{areaCode,jdbcType=VARCHAR}, #{courseType,jdbcType=INTEGER}, #{countryId,jdbcType=BIGINT},
       #{minAge,jdbcType=INTEGER},#{maxAge,jdbcType=INTEGER}, #{email,jdbcType=VARCHAR}, #{project,jdbcType=VARCHAR},
       #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, 
       #{updateUserId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=INTEGER})