Explorar el Código

init 自动回复

Joe hace 7 meses
padre
commit
2e6a040804
Se han modificado 15 ficheros con 858 adiciones y 0 borrados
  1. 24 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/enums/cgi/ReplyStrategyServiceEnum.java
  2. 114 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/response/CommonResponse.java
  3. 33 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/response/Constant.java
  4. 6 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/response/ErrcodeNamespace.java
  5. 153 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/response/ExceptionCodeEnum.java
  6. 220 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/cgi/BucketDataParam.java
  7. 24 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/cgi/FilterData.java
  8. 27 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/cgi/GroupData.java
  9. 94 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/cgi/MsgData.java
  10. 28 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/cgi/ReplyBucketData.java
  11. 8 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/cgi/CgiReplyService.java
  12. 46 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/cgi/impl/CgiReplyServiceImpl.java
  13. 13 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/strategy/reply/ReplyStrategyService.java
  14. 40 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/strategy/reply/impl/BuckStrategyV1.java
  15. 28 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/web/CgiReplyController.java

+ 24 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/enums/cgi/ReplyStrategyServiceEnum.java

@@ -0,0 +1,24 @@
+package com.tzld.longarticle.recommend.server.common.enums.cgi;
+
+public enum ReplyStrategyServiceEnum {
+
+     BUCKET_STRATEGY_V1("BUCKET_STRATEGY_V1", "分桶策略v1"),
+
+     ;
+
+     private final String key;
+     private final String desc;
+
+    ReplyStrategyServiceEnum(String key, String desc) {
+         this.key = key;
+         this.desc = desc;
+     }
+
+     public String getKey() {
+         return key;
+     }
+
+     public String getDesc() {
+         return desc;
+     }
+}

+ 114 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/response/CommonResponse.java

@@ -0,0 +1,114 @@
+package com.tzld.longarticle.recommend.server.common.response;
+
+import static com.tzld.longarticle.recommend.server.common.response.Constant.SUCCESS_CODE;
+import static com.tzld.longarticle.recommend.server.common.response.Constant.SUCCESS_MSG;
+
+/**
+ * Common Response
+ *
+ * @author ehlxr
+ */
+public class CommonResponse<T> {
+    /**
+     * 返回状态码,0 表示业务成功
+     */
+    private int code = 0;
+    /**
+     * 返回消息
+     */
+    private String msg = "success";
+    /**
+     * 业务成功时返回数据
+     */
+    private T data;
+    /**
+     * 重定向
+     */
+    private String redirect;
+
+    public static <T> CommonResponse<T> success() {
+        CommonResponse<T> commonResponse = new CommonResponse<>();
+        commonResponse.setCode(SUCCESS_CODE);
+        commonResponse.setMsg(SUCCESS_MSG);
+        return commonResponse;
+    }
+
+    public static <T> CommonResponse<T> success(T data) {
+        CommonResponse<T> commonResponse = new CommonResponse<>();
+        commonResponse.setCode(SUCCESS_CODE);
+        commonResponse.setMsg(SUCCESS_MSG);
+        commonResponse.setData(data);
+        return commonResponse;
+    }
+
+    public static <T> CommonResponse<T> create() {
+        return create(SUCCESS_CODE, SUCCESS_MSG, null);
+    }
+
+    public static <T> CommonResponse<T> create(T data) {
+        return create(SUCCESS_CODE, SUCCESS_MSG, data);
+    }
+    public static <T> CommonResponse<T> create(ExceptionCodeEnum exceptionCodeEnum) {
+        return create(exceptionCodeEnum.getCode(), exceptionCodeEnum.getMsg(), null);
+    }
+    public static <T> CommonResponse<T> create(ExceptionCodeEnum exceptionCodeEnum, String msg) {
+        return create(exceptionCodeEnum.getCode(), msg, null);
+    }
+    public static <T> CommonResponse<T> create(int code, String msg) {
+        return create(code, msg, null);
+    }
+
+    public static <T> CommonResponse<T> create(int code, String msg, T data) {
+        CommonResponse<T> commonResponse = new CommonResponse<>();
+        commonResponse.setCode(code);
+        commonResponse.setMsg(msg);
+        commonResponse.setData(data);
+        return commonResponse;
+    }
+
+    public boolean isSuccess() {
+        return this.code == SUCCESS_CODE;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public T getData() {
+        return data;
+    }
+
+    public void setData(T data) {
+        this.data = data;
+    }
+
+    public String getRedirect() {
+        return redirect;
+    }
+
+    public void setRedirect(String redirect) {
+        this.redirect = redirect;
+    }
+
+    @Override
+    public String toString() {
+        return "CommonResponse{" +
+                "code=" + code +
+                ", msg='" + msg + '\'' +
+                ", data=" + data +
+                ", redirect='" + redirect + '\'' +
+                '}';
+    }
+}

+ 33 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/response/Constant.java

@@ -0,0 +1,33 @@
+package com.tzld.longarticle.recommend.server.common.response;
+
+/**
+ * 常量
+ *
+ * @author ehlxr
+ */
+public interface Constant {
+    /**
+     * traceID
+     */
+    String LOG_TRACE_ID = "logTraceId";
+
+    /**
+     * 接口请求开始时间戳
+     */
+    String REQUEST_START_TIME = "request_start_time";
+
+    int SUCCESS_CODE = 0;
+
+    String SUCCESS_MSG = "success";
+
+    // Integer INTEGER_TRUE = 1;
+    // Integer INTEGER_FALSE = 0;
+
+    // long DAYS_1 = 24 * 60 * 60 * 1000L;
+
+    int TEN = 10;
+
+    // int HUNDRED = 100;
+
+    String MID_PREFIX = "weixin_openid_";
+}

+ 6 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/response/ErrcodeNamespace.java

@@ -0,0 +1,6 @@
+package com.tzld.longarticle.recommend.server.common.response;
+
+public interface ErrcodeNamespace {
+
+  public final static String NS_GENERAL = "manager";
+}

+ 153 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/response/ExceptionCodeEnum.java

@@ -0,0 +1,153 @@
+package com.tzld.longarticle.recommend.server.common.response;
+
+
+import static com.tzld.longarticle.recommend.server.common.response.ErrcodeNamespace.NS_GENERAL;
+
+public enum ExceptionCodeEnum {
+
+  LOGIN_ERROR(NS_GENERAL, -999, "用户未登录"),
+  ACCOUNT_FREEZE(NS_GENERAL, -888, "账户被锁定"),
+  SYS_ERROR(NS_GENERAL, -111, "系统异常"),
+  PARAM_ERROR(NS_GENERAL, -990, "参数错误"),
+  WX_GET_ACCESS_TOKEN(NS_GENERAL, -995, "获取线上的微信accessToken失败"),
+  WX_GET_OPENID_ERROR(NS_GENERAL,-992,"微信用户获取OPENID出错"),
+
+  VIDEO_NOTEXIST(NS_GENERAL, 1, "视频不存在"),
+  DATA_ERROR(NS_GENERAL, 2, "数据不匹配"),
+  USER_NOTEXIST(NS_GENERAL, 3, "用户不存在"),
+  PAPAM_ERROR(NS_GENERAL, 4, "参数不对"),
+  ACCOUNT_EXIST(NS_GENERAL, 5, "账号已被占用"),
+  PASSWORD_ERROR(NS_GENERAL, 6, "密码不准确"),
+  DATA_NOTEXIST(NS_GENERAL, 7, "数据不匹配"),
+  MENU_EXIST(NS_GENERAL, 8, "菜单标示已存在"),
+  MENU_NOTEXIST(NS_GENERAL, 9, "菜单不存在"),
+  NOT_lOGIN(NS_GENERAL, 10, "未登录"),
+  KAIYAN_VIDEO_SEND(NS_GENERAL, 11, "开眼视频已经发过"),
+
+  MONITORING_ALARM_CONFIG_NOT_EXIST(NS_GENERAL, 12, "数据库容量告警手机号码未配置"),
+
+  OPERAATION_FAIL(NS_GENERAL, 13, "操作失败"),
+
+  PUSH_MSG_CANNT_UPDATE(NS_GENERAL,14,"立即推送的信息不能修改"),
+  PUSH_MSG_CANNT_DELETE(NS_GENERAL,15,"立即推送的信息不能撤销"),
+  SEND_PUSH_MSG_CANNT_UPDATE(NS_GENERAL,16,"已推送的信息不能修改"),
+  PUSH_TARGET_NOTEXIST(NS_GENERAL,17,"没有找到推送目标的绑定设备"),
+  PUSH_PLATFORM_ERROR(NS_GENERAL,18,"推送平台错误"),
+  PUSH_SCHEDULE_ERROR(NS_GENERAL,19,"定时推送时间必须大于当前时间"),
+
+  DATA_REPORT_TYPE_NOT_EXISTS(NS_GENERAL,20,"对应的报表不存在"),
+  DATA_REPORT_PARAM_NOT_EXISTS(NS_GENERAL,21,"报表扩展参数有缺失"),
+  NOTEXAMINEVIDEO_CONFIG_NOT_EXIST(NS_GENERAL, 23, "未审核的视频数手机号码未配置"),
+  SENSITIVE_WORD_EXISTS(NS_GENERAL,22,"该词已存在"),
+  USERPROHIBITION_NOTEXIST(NS_GENERAL, 24, "封禁类型或者标示不存在"),
+
+  VERSION_CONTROLLER_DEFAULT_CONFIG(NS_GENERAL, 25, "没有默认配置,请联系管理员直接添加。"),
+  CONFIG_EXIST(NS_GENERAL, 26, "该版本配置已存在,不能重复添加。"),
+
+  BARRAGE_UP_VSIBILITY(NS_GENERAL, 27, "不能操作弹幕UP主删除"),
+  BARRAGE_TIME_ERROR(NS_GENERAL, 28, "视频时间不能为0"),
+  VIDEO_AUDITTRANSCATIONID_NOT_NEW(NS_GENERAL, 29, "视频审核ID不是最新"),
+  VIDEO_IS_DELETE(NS_GENERAL, 30, "视频已被用户删除"),
+  VIDEO_NOT_NOAML(NS_GENERAL, 29, "视频不是正常可见的"),
+  VIDEO_SHOULD_UNFREEZE(NS_GENERAL, 31, "请先解冻视频"),
+
+  AD_ALGO_THRESHOLD_PUSH_UPDATE_ERROR(NS_GENERAL, 32, "更新远程广告算法阈值失败"),
+
+
+  VIDEO_CONTENT_SENSITIVE_MATCH(NS_GENERAL,1015,"输入内容包含违禁词汇,请修改"),
+  VIDEO_TITLE_SENSITIVE_MATCH(NS_GENERAL,1016,"输入标题包含违禁词汇,请修改"),
+  VIDEO_RECOMMEND_TITLE_SENSITIVE_MATCH(NS_GENERAL,1017,"输入分发标题包含违禁词汇,请修改"),
+
+  CANNOT_GET_LOCK(NS_GENERAL, 3001,"已有相同操作在进行"),
+  COMMENT_NOT_EXIST(NS_GENERAL, 3002,"评论不存在"),
+  COMMENT_IS_DELETE(NS_GENERAL, 3003,"评论已经删除存在"),
+
+  VIDEO_MEASURE_PROCEEDING(NS_GENERAL, 4000,"此视频正在曝光池中"),
+  VIDEO_NOT_TAG(NS_GENERAL, 4001, "视频没有标签"),
+  RECOMMENT_PARAM_INDEX_ERROR(NS_GENERAL, 4002, "推荐配置的限制个数和位置个数对应不上"),
+  RECOMMENT_PARAM_SCORE_ERROR(NS_GENERAL, 4003, "分数设置不对"),
+  VIDEO_UNRECOMMEND(NS_GENERAL, 4002, "待推荐视频不能加入曝光池"),
+
+  TAG_NAME_IS_UNUSED(NS_GENERAL, 5001,"同名视频标签%s不存在"),
+  MAJIAHAO_IS_ALL_USED(NS_GENERAL, 5001,"马甲号已全部用完"),
+
+  SECOND_CATEGORY_IS_NULL(NS_GENERAL, 6002,"二级分类不能为空"),
+  PARENT_CATEGORY_IS_NULL(NS_GENERAL, 6001,"一级分类不能为空"),
+
+  CANNOT_REVOCER_UNDELETED_VIDEO(NS_GENERAL, 7001, "不能恢复未删除的视频"),
+  CANNOT_REVOCER_DELETED_FILENOTFIND_VIDEO(NS_GENERAL, 7002, "视频文件已经被迁移,请先恢复文件后再恢复视频"),
+
+  VIDEO_AUDIT_PERMISSION_DENIED(NS_GENERAL, 8001, "你没有修改视频审核状态的权限"),
+  CAN_NOT_FETCHTASK_FOR_NOT_ONDUTY(NS_GENERAL, 8002, "你已经下班了,无法分配审核任务"),
+
+  DELOGO_VIDEO_NOT_EXISTS(NS_GENERAL, 8003, "去视频视频不存在"),
+  DELOGO_VIDEO_AUDIT_ERROR(NS_GENERAL, 8004, "已转码成功的视频不能改成审核不通过"),
+  DELOGO_VIDEO_AUDIT_WRONG(NS_GENERAL, 8004, "已审核通过且已发起转码的视频不能改成审核不通过"),
+  VIDEO_NOT_SLICE(NS_GENERAL, 8005, "不可搜视频不能分剪"),
+  VIDEO_SLICE_EXISTS(NS_GENERAL, 8006, "视频分剪已存在"),
+  MUSIC_NOT_EXISTS(NS_GENERAL, 8007, "音乐素材不存在"),
+  MUSIC_CATE_EXISTS(NS_GENERAL, 8008, "音乐素材分类已存在"),
+  MUSIC_CRAWER_NOT_EDIT(NS_GENERAL, 8009, "音乐爬取素材不能编辑"),
+  MUSIC_HOT_NOT_DELETE(NS_GENERAL, 8010, "热门音乐不能被删除"),
+
+  VIDEO_CROP_PROCESSING(NS_GENERAL, 9001, "该视频有正在处理中的剪切任务"),
+
+
+  AD_POSITION_FLOW_CONTROL_OVERFLOW(NS_GENERAL, 1001, "该广告位下流量控制不能大于 100%"),
+  INVOKE_VIDEO_API_WEAPP_URLLINK_ERROR(NS_GENERAL, 1002, "调用 video api 获取小程序 URL Link 失败"),
+  INVOKE_INCENTIVE_API_ERROR(NS_GENERAL, 1003, "调用激励服务失败"),
+  ADCAMPAIGN_REPEAT_ERROR(NS_GENERAL, -1, "名称重复,请修改"),
+  ADCAMPAIGN_RUNNING_DELETE_ERROR(NS_GENERAL, -1, "计划启用中,不能删除"),
+  ADAD_RUNNING_DELETE_ERROR(NS_GENERAL, -1, "广告启用中,不能删除"),
+  ADAD_HAS_CREATIVE_DELETE_ERROR(NS_GENERAL, -1, "广告下存在绑定创意,请删除对应创意后操作删除广告"),
+  ADCREATIVE_RUNNING_DELETE_ERROR(NS_GENERAL, -1, "创意启用中,不能删除"),
+  GET_AGENT_ERROR(NS_GENERAL, -1, "获取agent错误"),
+  DELETE_ADVERTISER_ERROR(NS_GENERAL, -1, "该广告主下绑定有计划,不能删除"),
+  OPERATE_ADVERTISER_ERROR(NS_GENERAL, -1, "该代理商下没有该广告主,不能操作"),
+  DELETE_CAMPAIGN_ERROR(NS_GENERAL, -1, "该计划下绑定广告投放中,不能删除"),
+  ADCAMPAIGN_HAS_AD_DELETE_ERROR(NS_GENERAL, -1, "该计划下存在绑定广告,请删除对应广告后操作删除计划"),
+  PHONE_EXIST(NS_GENERAL, 10001, "手机号已存在"),
+
+  NO_AD(NS_GENERAL, 11001, "无分发激励广告")
+  ;
+
+
+  ExceptionCodeEnum(String namespace, int code, String msg) {
+    this.code = code;
+    this.msg = msg;
+    this.namespace = namespace;
+  }
+  private int code;
+  private String msg;
+  private String namespace;
+
+  public int getCode() {
+    return code;
+  }
+
+  public void setCode(int code) {
+    this.code = code;
+  }
+
+  public String getMsg() {
+    return msg;
+  }
+
+  public void setMsg(String msg) {
+    this.msg = msg;
+  }
+
+  public String getNamespace() {
+    return namespace;
+  }
+
+  public void setNamespace(String namespace) {
+    this.namespace = namespace;
+  }
+
+  @Override
+  public String toString() {
+    return String.format("[code=%s, msg=%s]", this.code, this.msg);
+  }
+
+}

+ 220 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/cgi/BucketDataParam.java

@@ -0,0 +1,220 @@
+package com.tzld.longarticle.recommend.server.model.cgi;
+
+import java.util.List;
+
+public class BucketDataParam {
+
+    private Long accountId;
+
+    private String accountName;
+
+    private String ghId;
+
+    private String strategy;
+
+    private String planId;
+
+    private List<Article> articleList;
+
+    public Long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+
+    public String getAccountName() {
+        return accountName;
+    }
+
+    public void setAccountName(String accountName) {
+        this.accountName = accountName;
+    }
+
+    public String getGhId() {
+        return ghId;
+    }
+
+    public void setGhId(String ghId) {
+        this.ghId = ghId;
+    }
+
+    public String getStrategy() {
+        return strategy;
+    }
+
+    public void setStrategy(String strategy) {
+        this.strategy = strategy;
+    }
+
+    public String getPlanId() {
+        return planId;
+    }
+
+    public void setPlanId(String planId) {
+        this.planId = planId;
+    }
+
+    public List<Article> getArticleList() {
+        return articleList;
+    }
+
+    public void setArticleList(List<Article> articleList) {
+        this.articleList = articleList;
+    }
+}
+
+
+class Article{
+
+    private String publishContentId;
+
+    private String title;
+
+    private String content;
+
+    private String coverUrl;
+
+    private List<String> imageUrls;
+
+    private Long createTimestamp;
+
+    private String producePlanName;
+
+    private String crawlerChannelContentId;
+
+    private String crawlerLink;
+
+    private String crawlerTitle;
+
+    private String crawlerCoverUrl;
+
+    private Integer crawlerViewCount;
+
+    private Integer crawlerLikeCount;
+
+    private Long crawlerPublishTimestamp;
+
+    private String crawlerAccountName;
+
+    public String getPublishContentId() {
+        return publishContentId;
+    }
+
+    public void setPublishContentId(String publishContentId) {
+        this.publishContentId = publishContentId;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getCoverUrl() {
+        return coverUrl;
+    }
+
+    public void setCoverUrl(String coverUrl) {
+        this.coverUrl = coverUrl;
+    }
+
+    public List<String> getImageUrls() {
+        return imageUrls;
+    }
+
+    public void setImageUrls(List<String> imageUrls) {
+        this.imageUrls = imageUrls;
+    }
+
+    public Long getCreateTimestamp() {
+        return createTimestamp;
+    }
+
+    public void setCreateTimestamp(Long createTimestamp) {
+        this.createTimestamp = createTimestamp;
+    }
+
+    public String getProducePlanName() {
+        return producePlanName;
+    }
+
+    public void setProducePlanName(String producePlanName) {
+        this.producePlanName = producePlanName;
+    }
+
+    public String getCrawlerChannelContentId() {
+        return crawlerChannelContentId;
+    }
+
+    public void setCrawlerChannelContentId(String crawlerChannelContentId) {
+        this.crawlerChannelContentId = crawlerChannelContentId;
+    }
+
+    public String getCrawlerLink() {
+        return crawlerLink;
+    }
+
+    public void setCrawlerLink(String crawlerLink) {
+        this.crawlerLink = crawlerLink;
+    }
+
+    public String getCrawlerTitle() {
+        return crawlerTitle;
+    }
+
+    public void setCrawlerTitle(String crawlerTitle) {
+        this.crawlerTitle = crawlerTitle;
+    }
+
+    public String getCrawlerCoverUrl() {
+        return crawlerCoverUrl;
+    }
+
+    public void setCrawlerCoverUrl(String crawlerCoverUrl) {
+        this.crawlerCoverUrl = crawlerCoverUrl;
+    }
+
+    public Integer getCrawlerViewCount() {
+        return crawlerViewCount;
+    }
+
+    public void setCrawlerViewCount(Integer crawlerViewCount) {
+        this.crawlerViewCount = crawlerViewCount;
+    }
+
+    public Integer getCrawlerLikeCount() {
+        return crawlerLikeCount;
+    }
+
+    public void setCrawlerLikeCount(Integer crawlerLikeCount) {
+        this.crawlerLikeCount = crawlerLikeCount;
+    }
+
+    public Long getCrawlerPublishTimestamp() {
+        return crawlerPublishTimestamp;
+    }
+
+    public void setCrawlerPublishTimestamp(Long crawlerPublishTimestamp) {
+        this.crawlerPublishTimestamp = crawlerPublishTimestamp;
+    }
+
+    public String getCrawlerAccountName() {
+        return crawlerAccountName;
+    }
+
+    public void setCrawlerAccountName(String crawlerAccountName) {
+        this.crawlerAccountName = crawlerAccountName;
+    }
+}

+ 24 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/cgi/FilterData.java

@@ -0,0 +1,24 @@
+package com.tzld.longarticle.recommend.server.model.cgi;
+
+public class FilterData {
+
+    private String publishContentId;
+
+    private String filterReason;
+
+    public String getPublishContentId() {
+        return publishContentId;
+    }
+
+    public void setPublishContentId(String publishContentId) {
+        this.publishContentId = publishContentId;
+    }
+
+    public String getFilterReason() {
+        return filterReason;
+    }
+
+    public void setFilterReason(String filterReason) {
+        this.filterReason = filterReason;
+    }
+}

+ 27 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/cgi/GroupData.java

@@ -0,0 +1,27 @@
+package com.tzld.longarticle.recommend.server.model.cgi;
+
+import java.util.List;
+
+public class GroupData {
+
+    private Integer groupIndex;
+
+    private List<MsgData> msgDataList;
+
+
+    public Integer getGroupIndex() {
+        return groupIndex;
+    }
+
+    public void setGroupIndex(Integer groupIndex) {
+        this.groupIndex = groupIndex;
+    }
+
+    public List<MsgData> getMsgDataList() {
+        return msgDataList;
+    }
+
+    public void setMsgDataList(List<MsgData> msgDataList) {
+        this.msgDataList = msgDataList;
+    }
+}

+ 94 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/cgi/MsgData.java

@@ -0,0 +1,94 @@
+package com.tzld.longarticle.recommend.server.model.cgi;
+
+public class MsgData {
+
+    private Integer msgType;
+
+    private String title;
+
+    private String coverUrl;
+
+    private String miniAppId;
+
+    private String miniPagePath;
+
+    private Long miniVideoId;
+
+    private String newsPublishContentId;
+
+    private String newsUrl;
+
+    private String newsDescription;
+
+    public Integer getMsgType() {
+        return msgType;
+    }
+
+    public void setMsgType(Integer msgType) {
+        this.msgType = msgType;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getCoverUrl() {
+        return coverUrl;
+    }
+
+    public void setCoverUrl(String coverUrl) {
+        this.coverUrl = coverUrl;
+    }
+
+    public String getMiniAppId() {
+        return miniAppId;
+    }
+
+    public void setMiniAppId(String miniAppId) {
+        this.miniAppId = miniAppId;
+    }
+
+    public String getMiniPagePath() {
+        return miniPagePath;
+    }
+
+    public void setMiniPagePath(String miniPagePath) {
+        this.miniPagePath = miniPagePath;
+    }
+
+    public Long getMiniVideoId() {
+        return miniVideoId;
+    }
+
+    public void setMiniVideoId(Long miniVideoId) {
+        this.miniVideoId = miniVideoId;
+    }
+
+    public String getNewsPublishContentId() {
+        return newsPublishContentId;
+    }
+
+    public void setNewsPublishContentId(String newsPublishContentId) {
+        this.newsPublishContentId = newsPublishContentId;
+    }
+
+    public String getNewsUrl() {
+        return newsUrl;
+    }
+
+    public void setNewsUrl(String newsUrl) {
+        this.newsUrl = newsUrl;
+    }
+
+    public String getNewsDescription() {
+        return newsDescription;
+    }
+
+    public void setNewsDescription(String newsDescription) {
+        this.newsDescription = newsDescription;
+    }
+}

+ 28 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/cgi/ReplyBucketData.java

@@ -0,0 +1,28 @@
+package com.tzld.longarticle.recommend.server.model.cgi;
+
+import java.util.List;
+
+public class ReplyBucketData {
+
+    private List<FilterData> filterList;
+
+    private List<GroupData> groupList;
+
+    public List<FilterData> getFilterList() {
+        return filterList;
+    }
+
+    public void setFilterList(List<FilterData> filterList) {
+        this.filterList = filterList;
+    }
+
+    public List<GroupData> getGroupList() {
+        return groupList;
+    }
+
+    public void setGroupList(List<GroupData> groupList) {
+        this.groupList = groupList;
+    }
+}
+
+

+ 8 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/cgi/CgiReplyService.java

@@ -0,0 +1,8 @@
+package com.tzld.longarticle.recommend.server.service.cgi;
+
+import com.tzld.longarticle.recommend.server.model.cgi.BucketDataParam;
+import com.tzld.longarticle.recommend.server.model.cgi.ReplyBucketData;
+
+public interface CgiReplyService {
+    ReplyBucketData getRgiReplyData(BucketDataParam bucketDataParam);
+}

+ 46 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/cgi/impl/CgiReplyServiceImpl.java

@@ -0,0 +1,46 @@
+package com.tzld.longarticle.recommend.server.service.cgi.impl;
+
+import com.tzld.longarticle.recommend.server.common.enums.cgi.ReplyStrategyServiceEnum;
+import com.tzld.longarticle.recommend.server.model.cgi.BucketDataParam;
+import com.tzld.longarticle.recommend.server.model.cgi.ReplyBucketData;
+import com.tzld.longarticle.recommend.server.service.cgi.CgiReplyService;
+import com.tzld.longarticle.recommend.server.service.strategy.reply.ReplyStrategyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import java.util.Map;
+
+@Service
+public class CgiReplyServiceImpl implements CgiReplyService {
+
+    @Autowired
+    private ApplicationContext applicationContext;
+
+    private Map<String, ReplyStrategyService> strategyServiceMap;
+
+    @PostConstruct
+    public void init() {
+        strategyServiceMap = applicationContext.getBeansOfType(ReplyStrategyService.class);
+    }
+
+    /**
+     * 当前使用策略
+     */
+    private final ReplyStrategyServiceEnum useStrategy = ReplyStrategyServiceEnum.BUCKET_STRATEGY_V1;
+
+
+    @Override
+    public ReplyBucketData getRgiReplyData(BucketDataParam bucketDataParam) {
+        for (Map.Entry<String, ReplyStrategyService> stringReplyStrategyServiceEntry : strategyServiceMap.entrySet()) {
+            ReplyStrategyService replyStrategyService = stringReplyStrategyServiceEntry.getValue();
+            // 使用策略层
+            if (replyStrategyService.support(useStrategy)) {
+                return replyStrategyService.getResult(bucketDataParam);
+            }
+        }
+        // 无执行策略 不会走到这里
+        return null;
+    }
+}

+ 13 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/strategy/reply/ReplyStrategyService.java

@@ -0,0 +1,13 @@
+package com.tzld.longarticle.recommend.server.service.strategy.reply;
+
+import com.tzld.longarticle.recommend.server.common.enums.cgi.ReplyStrategyServiceEnum;
+import com.tzld.longarticle.recommend.server.model.cgi.BucketDataParam;
+import com.tzld.longarticle.recommend.server.model.cgi.ReplyBucketData;
+
+public interface ReplyStrategyService {
+
+    ReplyBucketData getResult(BucketDataParam bucketDataParam);
+
+    Boolean support(ReplyStrategyServiceEnum key);
+
+}

+ 40 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/strategy/reply/impl/BuckStrategyV1.java

@@ -0,0 +1,40 @@
+package com.tzld.longarticle.recommend.server.service.strategy.reply.impl;
+
+import com.tzld.longarticle.recommend.server.common.enums.cgi.ReplyStrategyServiceEnum;
+import com.tzld.longarticle.recommend.server.model.cgi.BucketDataParam;
+import com.tzld.longarticle.recommend.server.model.cgi.ReplyBucketData;
+import com.tzld.longarticle.recommend.server.service.strategy.reply.ReplyStrategyService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class BuckStrategyV1 implements ReplyStrategyService {
+
+    /**
+     * 实验分桶数量
+     */
+    private static final Integer bucketNum = 10;
+
+    /**
+     * 自动回复使用小程序Id
+     */
+    private static final String CGI_Id = "gh_1ee2e1b39ccf";
+
+    @Override
+    public ReplyBucketData getResult(BucketDataParam bucketDataParam) {
+        // 1 处理文章数据
+
+        // 2 处理小程序数据
+
+        // 2.1 获取小程序落地页地址 http调用 判断如果库里有复用
+
+        // 3 入库读表 组装数据
+
+        // 4 返回
+        return null;
+    }
+
+    @Override
+    public Boolean support(ReplyStrategyServiceEnum key) {
+        return ReplyStrategyServiceEnum.BUCKET_STRATEGY_V1.equals(key);
+    }
+}

+ 28 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/web/CgiReplyController.java

@@ -0,0 +1,28 @@
+package com.tzld.longarticle.recommend.server.web;
+
+import com.tzld.longarticle.recommend.server.common.response.CommonResponse;
+import com.tzld.longarticle.recommend.server.model.cgi.BucketDataParam;
+import com.tzld.longarticle.recommend.server.model.cgi.ReplyBucketData;
+import com.tzld.longarticle.recommend.server.service.cgi.CgiReplyService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/cgi/reply")
+@Slf4j
+public class CgiReplyController {
+
+    @Autowired
+    private CgiReplyService cgiReplyService;
+
+    @PostMapping("/bucketData")
+    public CommonResponse<ReplyBucketData> getBucketData(@RequestBody BucketDataParam bucketDataParam) {
+        ReplyBucketData replyBucketData = cgiReplyService.getRgiReplyData(bucketDataParam);
+        return CommonResponse.success(replyBucketData);
+    }
+
+}