Forráskód Böngészése

fix 开心中文age字段修改

classic_blue 5 napja
szülő
commit
f21e4effeb

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

@@ -49,9 +49,14 @@ public class AddHappyEntryDto{
     private Integer courseType;
 
     /**
-     * 年龄
+     * 最小年龄
      */
-    private String age;
+    private Integer minAge;
+
+    /**
+     * 最大年龄
+     */
+    private Integer maxAge;
 
     /**
      * 邮箱

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

@@ -1,6 +1,7 @@
 package edu.travel.education.web;
 import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import edu.travel.education.dto.AddHappyEntryDto;
 import edu.travel.education.dto.HappyEntryDto;
 import edu.travel.education.entity.HappyEntry;
@@ -11,6 +12,7 @@ import edu.travel.resp.PageResponse;
 import edu.travel.rpc.RPCBaseResponse;
 import edu.travel.rpc.RPCPageResponse;
 import edu.travel.web.BaseController;
+import org.springframework.beans.BeanUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
@@ -100,10 +102,13 @@ public class HappyEntryController extends BaseController<HappyEntry> {
      */
     @GetMapping("/listPageHappyEntry")
     @PreAuthorize("hasRole('超级管理员')")
-    public RPCPageResponse<List<HappyEntryVo>> listPageHappyEntry(HappyEntryDto happyEntryDto){
+    public RPCBaseResponse<Page<HappyEntryVo>> listPageHappyEntry(HappyEntryDto happyEntryDto){
         IPage<HappyEntry> page = happyEntryService.listPageHappyEntry(happyEntryDto);
         List<HappyEntryVo> happyEntryVos = BeanUtil.copyToList(page.getRecords(), HappyEntryVo.class);
-        return  RPCPageResponse.success("200",happyEntryVos,(int) page.getTotal(),(int)page.getSize(),(int)page.getCurrent());
+        Page<HappyEntryVo> target = new Page<HappyEntryVo>();
+        BeanUtils.copyProperties(page, target);
+        target.setRecords(happyEntryVos);
+        return new RPCBaseResponse<>(200,"success",target);
     }
 
 }

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

@@ -10,7 +10,8 @@
     <result column="phone" jdbcType="VARCHAR" property="phone" />
     <result column="area_code" jdbcType="VARCHAR" property="areaCode" />
     <result column="course_type" jdbcType="INTEGER" property="courseType" />
-    <result column="age" jdbcType="INTEGER" property="age" />
+    <result column="min_age" jdbcType="INTEGER" property="minAge" />
+    <result column="max_age" jdbcType="INTEGER" property="maxAge" />
     <result column="email" jdbcType="VARCHAR" property="email" />
     <result column="project" jdbcType="VARCHAR" property="project" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@@ -21,7 +22,7 @@
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, surname, `name`, phone, area_code, course_type, age, email, project, create_time, 
+    id, surname, `name`, phone, area_code, course_type, min_age,max_age, email, project, create_time,
     create_user_id, update_time, update_user_id, delete_flag
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -40,12 +41,12 @@
     <!--@mbg.generated-->
     insert into happy_entry (id, surname, `name`, 
       phone, area_code, course_type, 
-      age, email, project, 
+      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}, 
       #{phone,jdbcType=VARCHAR}, #{areaCode,jdbcType=VARCHAR}, #{courseType,jdbcType=INTEGER}, 
-      #{age,jdbcType=INTEGER}, #{email,jdbcType=VARCHAR}, #{project,jdbcType=VARCHAR}, 
+      #{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})
   </insert>
@@ -71,8 +72,11 @@
       <if test="courseType != null">
         course_type,
       </if>
-      <if test="age != null">
-        age,
+      <if test="minAge != null">
+        min_age,
+      </if>
+      <if test="maxAge != null">
+        max_age,
       </if>
       <if test="email != null">
         email,
@@ -115,8 +119,11 @@
       <if test="courseType != null">
         #{courseType,jdbcType=INTEGER},
       </if>
-      <if test="age != null">
-        #{age,jdbcType=INTEGER},
+      <if test="minAge != null">
+        #{minAge,jdbcType=INTEGER},
+      </if>
+      <if test="maxAge != null">
+        #{maxAge,jdbcType=INTEGER},
       </if>
       <if test="email != null">
         #{email,jdbcType=VARCHAR},
@@ -160,8 +167,11 @@
       <if test="courseType != null">
         course_type = #{courseType,jdbcType=INTEGER},
       </if>
-      <if test="age != null">
-        age = #{age,jdbcType=INTEGER},
+      <if test="minAge != null">
+        min_age = #{minAge,jdbcType=INTEGER},
+      </if>
+      <if test="maxAge != null">
+        max_age = #{maxAge,jdbcType=INTEGER},
       </if>
       <if test="email != null">
         email = #{email,jdbcType=VARCHAR},
@@ -195,7 +205,8 @@
       phone = #{phone,jdbcType=VARCHAR},
       area_code = #{areaCode,jdbcType=VARCHAR},
       course_type = #{courseType,jdbcType=INTEGER},
-      age = #{age,jdbcType=INTEGER},
+      min_age = #{minAge,jdbcType=INTEGER},
+      max_age = #{maxAge,jdbcType=INTEGER},
       email = #{email,jdbcType=VARCHAR},
       project = #{project,jdbcType=VARCHAR},
       create_time = #{createTime,jdbcType=TIMESTAMP},