Quellcode durchsuchen

添加查询详情接口

luobo vor 3 Jahren
Ursprung
Commit
7a9eda7bed

+ 16 - 0
smart-admin/src/main/java/com/huijy/web/controller/api/ApiIndexController.java

@@ -112,6 +112,22 @@ public class ApiIndexController extends ApiAbstractController {
 
     }
 
+
+    //分页获取主要内容信息
+    @GetMapping("/getContentInfo/{contentId}")
+    @ApiOperation("获取主要内容详细信息")
+    @UnLogin
+
+    public AjaxResult getContentInfo(@ApiIgnore Member member, @PathVariable  Integer contentId) {
+        // AboutUs aboutUs = aboutUsService.selectAboutUsByAboutUsId(1L);
+
+        Content info = contentService.selectContentByContentId(contentId.longValue());
+        Map<String, Object> resultObj = new HashMap<String, Object>();
+        resultObj.put("info", info);
+        return AjaxResult.success(resultObj);
+
+    }
+
     //门店开通申请
     @PostMapping("/shopApply")
     @ApiOperation("商铺开通申请")

+ 11 - 7
smart-system/src/main/resources/mapper/management/ContentMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.huijy.management.mapper.ContentMapper">
-    
+
     <resultMap type="Content" id="ContentResult">
         <result property="contentId"    column="content_id"    />
         <result property="serviceInfo"    column="service_info"    />
@@ -30,20 +30,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select content_id, service_info, title, author, show_pictures, brief_content, content, create_time, create_at, audit_flag, audit_at, audit_time, audit_msg, release_flag, release_time, release_at, end_audit_at, end_audit_time, end_audit_msg from t_content
     </sql>
 
+    <sql id="selectListContentVo">
+        select content_id, service_info, title, author, show_pictures, brief_content,create_time, create_at, audit_flag, audit_at, audit_time, audit_msg, release_flag, release_time, release_at, end_audit_at, end_audit_time, end_audit_msg from t_content
+    </sql>
+
     <select id="selectContentList" parameterType="Content" resultMap="ContentResult">
-        <include refid="selectContentVo"/>
-        <where>  
+        <include refid="selectListContentVo"/>
+        <where>
             <if test="serviceInfo != null  and serviceInfo != ''"> and service_info = #{serviceInfo}</if>
             <if test="auditFlag != null  and auditFlag != ''"> and audit_flag = #{auditFlag}</if>
             <if test="releaseFlag != null  and releaseFlag != ''"> and release_flag = #{releaseFlag}</if>
         </where>
     </select>
-    
+
     <select id="selectContentByContentId" parameterType="Long" resultMap="ContentResult">
         <include refid="selectContentVo"/>
         where content_id = #{contentId}
     </select>
-        
+
     <insert id="insertContent" parameterType="Content" useGeneratedKeys="true" keyProperty="contentId">
         insert into t_content
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -118,9 +122,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteContentByContentIds" parameterType="String">
-        delete from t_content where content_id in 
+        delete from t_content where content_id in
         <foreach item="contentId" collection="array" open="(" separator="," close=")">
             #{contentId}
         </foreach>
     </delete>
-</mapper>
+</mapper>