Commit 1aa7c201 by 1244575290@qq.com

聚合页修改

parent 521f33f6
...@@ -6,6 +6,7 @@ import com.pcloud.common.core.constant.MQQueueConstant; ...@@ -6,6 +6,7 @@ import com.pcloud.common.core.constant.MQQueueConstant;
import com.pcloud.common.core.constant.MQTopicProducer; import com.pcloud.common.core.constant.MQTopicProducer;
import com.pcloud.common.core.mq.RabbitMQFactory; import com.pcloud.common.core.mq.RabbitMQFactory;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.amqp.core.Binding; import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.Queue; import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -37,6 +38,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; ...@@ -37,6 +38,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@PropertySource({"classpath:properties/book.properties", "classpath:public_system.properties"}) @PropertySource({"classpath:properties/book.properties", "classpath:public_system.properties"})
@Configuration @Configuration
@EnableSwagger2 @EnableSwagger2
@MapperScan(basePackages = {"com.pcloud.book.*.mapper"})
public class BookApplication { public class BookApplication {
public static void main(String[] args) { public static void main(String[] args) {
......
package com.pcloud.book.keywords.biz; package com.pcloud.book.keywords.biz;
import com.pcloud.book.keywords.entity.SelfRobotKeyword; import com.pcloud.book.keywords.entity.SelfRobotKeyword;
import com.pcloud.book.keywords.vo.GuideWordVO;
import com.pcloud.book.keywords.vo.LabelVO;
import com.pcloud.book.keywords.vo.SelfRobotReplyVO;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import java.util.List; import java.util.List;
...@@ -18,4 +21,17 @@ public interface SelfRobotKeywordBiz { ...@@ -18,4 +21,17 @@ public interface SelfRobotKeywordBiz {
String getAppOrProductServeUrl(Long bookGroupId, Long serveId, String serveType, String serveUrl); String getAppOrProductServeUrl(Long bookGroupId, Long serveId, String serveType, String serveUrl);
List<LabelVO> listLabelByType(Integer type);
List<SelfRobotReplyVO> getReplyByLabel(Integer type, Long labelId, String robotId, String wxUserId);
List<SelfRobotReplyVO> getReplyByKeyWord(Integer type, String keyWord, String robotId, String wxUserId);
List<GuideWordVO> getGuideWordListByType(Integer type);
List<SelfRobotReplyVO> getReplyBuyGuide(Integer type, Integer id, String robotId, String wxUserId);
String getResource(Integer id, String robotId, String wxUserId);
String joinGroup(Integer id, String robotId, String wxUserId);
} }
package com.pcloud.book.keywords.entity;
import lombok.Data;
import java.io.Serializable;
@Data
public class TempRobotSkill implements Serializable {
private Integer id;
private Integer type;
private String keyWord;
private String guideWord;
private Integer depthId;
private String depthLabel;
private String resourceType;
private String text;
private String imgUrl;
private Integer productId;
private String fileUrl;
private String fileName;
private String groupId;
private String groupName;
private String replyContent;
}
\ No newline at end of file
...@@ -78,4 +78,43 @@ public interface SelfRobotKeywordFacade { ...@@ -78,4 +78,43 @@ public interface SelfRobotKeywordFacade {
@RequestParam("serveUrl") @ApiParam("作品或应用链接") String serveUrl @RequestParam("serveUrl") @ApiParam("作品或应用链接") String serveUrl
) throws BizException, PermissionException; ) throws BizException, PermissionException;
/* 个人号H5聚合页面 */
@ApiOperation("根据类型获取引导语列表")
@GetMapping("getGuideWordListByType")
ResponseDto<?> getGuideWordListByType(
@RequestParam("type") @ApiParam("技能类型") Integer type
) throws BizException, PermissionException;
@ApiOperation("根据类型获取标签列表")
@GetMapping("listLabelByType")
ResponseDto<?> listLabelByType(
@RequestParam("type") @ApiParam("技能类型") Integer type
) throws BizException, PermissionException;
@ApiOperation("根据标签获取引导语列表")
@GetMapping("getReplyByLabel")
ResponseDto<?> getReplyByLabel(
@RequestParam("type") @ApiParam("技能类型") Integer type, Long labelId, String robotId, String wxUserId
) throws BizException, PermissionException;
@ApiOperation("根据关键词获取回复")
@GetMapping("getReplyByKeyWord")
ResponseDto<?> getReplyByKeyWord(
@RequestParam("keyWord") @ApiParam("关键词") String keyWord,
@RequestParam("type") @ApiParam("技能类型") Integer type,
@RequestParam("robotId") @ApiParam("小号WXID") String robotId,
@RequestParam("wxUserId") @ApiParam("用户WXID") String wxUserId
) throws BizException, PermissionException;
@ApiOperation(value = "根据引导语获取任务列表", httpMethod = "GET")
@GetMapping("getReplyByGuide")
ResponseDto<?> getReplyByGuide(Integer type, Integer id, String robotId, String wxUserId);
@ApiOperation(value = "获取资料", httpMethod = "GET")
@GetMapping("getResource")
ResponseDto<?> getResource(Integer id, String robotId, String wxUserId);
@ApiOperation(value = "进群", httpMethod = "GET")
@GetMapping("joinGroup")
ResponseDto<?> joinGroup(Integer id, String robotId, String wxUserId);
} }
...@@ -3,6 +3,8 @@ package com.pcloud.book.keywords.facade.impl; ...@@ -3,6 +3,8 @@ package com.pcloud.book.keywords.facade.impl;
import com.pcloud.book.keywords.biz.SelfRobotKeywordBiz; import com.pcloud.book.keywords.biz.SelfRobotKeywordBiz;
import com.pcloud.book.keywords.entity.SelfRobotKeyword; import com.pcloud.book.keywords.entity.SelfRobotKeyword;
import com.pcloud.book.keywords.facade.SelfRobotKeywordFacade; import com.pcloud.book.keywords.facade.SelfRobotKeywordFacade;
import com.pcloud.book.keywords.vo.LabelVO;
import com.pcloud.book.keywords.vo.SelfRobotReplyVO;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.permission.PermissionException; import com.pcloud.common.permission.PermissionException;
...@@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -124,4 +127,55 @@ public class SelfRobotKeywordFacadeImpl implements SelfRobotKeywordFacade { ...@@ -124,4 +127,55 @@ public class SelfRobotKeywordFacadeImpl implements SelfRobotKeywordFacade {
return new ResponseDto<>(selfRobotKeywordBiz.getAppOrProductServeUrl(bookGroupId,serveId,serveType,serveUrl)); return new ResponseDto<>(selfRobotKeywordBiz.getAppOrProductServeUrl(bookGroupId,serveId,serveType,serveUrl));
} }
@Override
@GetMapping("getGuideWordListByType")
public ResponseDto<?> getGuideWordListByType(@RequestParam("type") Integer type) throws BizException, PermissionException {
return new ResponseDto<>(selfRobotKeywordBiz.getGuideWordListByType(type));
}
@Override
@GetMapping("listLabelByType")
public ResponseDto<?> listLabelByType(@RequestParam("type") Integer type) throws BizException, PermissionException {
List<LabelVO> list = selfRobotKeywordBiz.listLabelByType(type);
return new ResponseDto<>(list);
}
@Override
@GetMapping("getReplyByLabel")
public ResponseDto<?> getReplyByLabel(@RequestParam("type") Integer type, @RequestParam Long labelId,@RequestParam String robotId, @RequestParam String wxUserId) throws BizException, PermissionException {
List<SelfRobotReplyVO> list = selfRobotKeywordBiz.getReplyByLabel(type, labelId, robotId, wxUserId);
return new ResponseDto<>(list);
}
@Override
@GetMapping("getReplyByKeyWord")
public ResponseDto<?> getReplyByKeyWord(@RequestParam("keyWord") String keyWord,
@RequestParam("type") Integer type,
@RequestParam("robotId") String robotId,
@RequestParam("wxUserId") String wxUserId) throws BizException, PermissionException {
List<SelfRobotReplyVO> list = selfRobotKeywordBiz.getReplyByKeyWord(type, keyWord, robotId, wxUserId);
return new ResponseDto<>(list);
}
@Override
@GetMapping("getReplyByGuide")
public ResponseDto<?> getReplyByGuide(@RequestParam Integer type, @RequestParam Integer id, @RequestParam String robotId, @RequestParam String wxUserId) {
List<SelfRobotReplyVO> list = selfRobotKeywordBiz.getReplyBuyGuide(type, id, robotId, wxUserId);
return new ResponseDto<>(list);
}
@Override
@GetMapping("getResource")
public ResponseDto<?> getResource(@RequestParam Integer id, @RequestParam String robotId, @RequestParam String wxUserId) {
return new ResponseDto<>(selfRobotKeywordBiz.getResource(id, robotId, wxUserId));
}
@Override
@GetMapping("joinGroup")
public ResponseDto<?> joinGroup(@RequestParam Integer id, @RequestParam String robotId, @RequestParam String wxUserId) {
return new ResponseDto<>(selfRobotKeywordBiz.joinGroup(id, robotId, wxUserId));
}
} }
package com.pcloud.book.keywords.mapper;
import com.pcloud.book.keywords.entity.TempRobotSkill;
import com.pcloud.book.keywords.vo.LabelVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
@Component("tempRobotSkillDao")
public interface TempRobotSkillDao {
List<TempRobotSkill> getTempRobotSkillListByType(@Param("type") Integer type);
List<TempRobotSkill> getTempRobotSkillListByKeyword(@Param("type") Integer type, @Param("keyword") String keyword);
List<TempRobotSkill> getTempRobotSkillListByLabelId(@Param("type") Integer type, @Param("labelId") Integer labelId);
List<LabelVO> getLabelListByType(@Param("type") Integer type);
TempRobotSkill getById(@Param("id") Integer id);
}
package com.pcloud.book.keywords.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GuideWordVO implements Serializable {
private Integer id;
private Integer type;
private String keyWord;
private String guideWord;
}
package com.pcloud.book.keywords.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class LabelVO implements Serializable {
private static final long serialVersionUID = 1437986453453219619L;
@ApiModelProperty("标签ID")
private Long labelId;
@ApiModelProperty("标签名称")
private String labelName;
}
package com.pcloud.book.keywords.vo;
import java.io.Serializable;
import lombok.Data;
/**
* @Description:TODO
* @Author:zcy
* @Date:2020-02-04
* @Version:1.0
*/
@Data
public class SelfRobotReplyVO implements Serializable {
private Integer id;
private String keyWord;
private String guideWord;
private Integer taskId;
private String taskName;
private String taskIntroduce;
private Integer subscribeState;
private String replyContent;
private String wxGroupId;
private String wxGroupName;
private String wxGroupUserCount;
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.keywords.mapper.TempRobotSkillDao">
<resultMap id="BaseResultMap" type="tempRobotSkill">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="key_word" jdbcType="VARCHAR" property="keyWord" />
<result column="guide_word" jdbcType="VARCHAR" property="guideWord" />
<result column="depth_id" jdbcType="INTEGER" property="depthId" />
<result column="depth_label" jdbcType="VARCHAR" property="depthLabel" />
<result column="resource_type" jdbcType="VARCHAR" property="resourceType" />
<result column="text" jdbcType="VARCHAR" property="text" />
<result column="img_url" jdbcType="VARCHAR" property="imgUrl" />
<result column="product_id" jdbcType="INTEGER" property="productId" />
<result column="file_url" jdbcType="VARCHAR" property="fileUrl" />
<result column="file_name" jdbcType="VARCHAR" property="fileName" />
<result column="group_id" jdbcType="VARCHAR" property="groupId" />
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
<result column="reply_content" jdbcType="VARCHAR" property="replyContent" />
</resultMap>
<sql id="Base_Column_List">
id, type, key_word, guide_word, depth_id, depth_label, resource_type, text, img_url,
product_id, file_url, file_name, group_id, group_name, reply_content
</sql>
<select id="getById" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM temp_robot_skill
WHERE id = #{id}
</select>
<select id="getTempRobotSkillListByType" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM temp_robot_skill
WHERE type = #{type}
</select>
<select id="getTempRobotSkillListByKeyword" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM temp_robot_skill
WHERE type = #{type}
and key_word = #{keyword}
</select>
<select id="getTempRobotSkillListByLabelId" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM temp_robot_skill
WHERE type = #{type}
and depth_id = #{labelId}
</select>
<select id="getLabelListByType" resultType="LabelVO">
SELECT
depth_id labelId, depth_label labelName
FROM temp_robot_skill
WHERE type = #{type}
group by depth_id
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment