Przeglądaj źródła

'评论服务测试成功'

wuxw7 7 lat temu
rodzic
commit
e75a487188

+ 10 - 9
CommentService/src/main/java/com/java110/comment/listener/DeleteCommentOrSubCommentListener.java

@@ -42,7 +42,7 @@ public class DeleteCommentOrSubCommentListener extends AbstractCommentBusinessSe
 
     @Override
     public String getServiceCode() {
-        return ServiceCodeConstant.SERVICE_CODE_DELETE_SHOP_INFO;
+        return ServiceCodeConstant.SERVICE_CODE_DELETE_COMMENT_INFO;
     }
 
     /**
@@ -98,30 +98,30 @@ public class DeleteCommentOrSubCommentListener extends AbstractCommentBusinessSe
         Map delInfo = new HashMap();
         delInfo.put("bId",business.getbId());
         delInfo.put("operate",StatusConstant.STATUS_CD_VALID);
-        //商户信息
+        //评论信息
         Map comment = commentServiceDaoImpl.getComment(info);
         if(comment != null && !comment.isEmpty()){
             commentServiceDaoImpl.updateCommentInstance(delInfo);
         }
 
-        //商户信息
+        //评论信息
         List<Map> subComments = commentServiceDaoImpl.getSubComments(info);
         if(subComments != null && subComments.size() > 0){
             commentServiceDaoImpl.updateSubCommentInstance(delInfo);
         }
 
-        //商户信息
+        //评论属性信息
         List<Map> commentAttrs = commentServiceDaoImpl.getSubCommentAttrs(info);
         if(commentAttrs != null && commentAttrs.size() > 0){
             commentServiceDaoImpl.updateSubCommentAttrInstance(delInfo);
         }
 
-        //商户信息
+        //评论照片信息
         List<Map> commentPhotos = commentServiceDaoImpl.getSubCommentPhotos(info);
         if(commentPhotos != null && commentPhotos.size() > 0){
             commentServiceDaoImpl.updateSubCommentPhotoInstance(delInfo);
         }
-
+        //评论分数信息
         List<Map> commentScores = commentServiceDaoImpl.getCommentScores(info);
         if(commentScores != null && commentScores.size() > 0){
             commentServiceDaoImpl.updateCommentScoreInstance(delInfo);
@@ -144,7 +144,7 @@ public class DeleteCommentOrSubCommentListener extends AbstractCommentBusinessSe
         info.put("statusCd",StatusConstant.STATUS_CD_VALID);
 
         Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
+        //delInfo.put("bId",business.getbId());
         delInfo.put("statusCd",StatusConstant.STATUS_CD_INVALID);
 
         Map commentMap = commentServiceDaoImpl.getComment(info);
@@ -164,7 +164,7 @@ public class DeleteCommentOrSubCommentListener extends AbstractCommentBusinessSe
         // 作废 sub_comment
         List<Map> subComments = commentServiceDaoImpl.getSubComments(info);
 
-        if(subComments == null || subComments.size()>0){
+        if(subComments == null || subComments.size() == 0){
             return ;
         }
         commentServiceDaoImpl.updateSubCommentInstance(delInfo);
@@ -192,7 +192,8 @@ public class DeleteCommentOrSubCommentListener extends AbstractCommentBusinessSe
         info.put("statusCd",StatusConstant.STATUS_CD_VALID);
 
         Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
+        //delInfo.put("bId",business.getbId());
+        delInfo.put("subCommentId",subComment.getString("subCommentId"));
         delInfo.put("statusCd",StatusConstant.STATUS_CD_INVALID);
 
 

+ 1 - 1
CommentService/src/main/java/com/java110/comment/listener/SaveSubCommentPhotoListener.java

@@ -105,7 +105,7 @@ public class SaveSubCommentPhotoListener extends AbstractCommentBusinessServiceD
             JSONObject subCommentPhoto = subCommentPhotos.getJSONObject(subCommentPhotoIndex);
             Assert.jsonObjectHaveKey(subCommentPhoto,"commentPhotoTypeCd","subCommentPhoto 节点下没有包含 commentPhotoTypeCd 节点");
             subCommentPhoto.put("bId",business.getbId());
-            commentServiceDaoImpl.saveSubCommentAttrInstance(subCommentPhoto);
+            commentServiceDaoImpl.saveSubCommentPhotoInstance(subCommentPhoto);
         }
     }
 

BIN
MicroCommunity_qq.png


+ 3 - 3
Readme.md

@@ -64,10 +64,10 @@ Java + spring cloud + mybatis + mysql + kafka + redis
   ![image](ConsoleService/doc/img/20180511010848.jpg)
 
 
-10、统一接口地址:http://yourIp:8001/httpApi/service
+10、统一接口地址:http://ip:8001/httpApi/service
 
-加入钉钉java110 工作群随时了解项目进度,和java110开发者零距离沟通
+加入微小区交流群随时了解项目进度,和java110开发者零距离沟通 qq群号 827669685,邮箱:928255095@qq.com
 
-![image](dingding_java110.jpg)
+![image](MicroCommunity_qq.png)
 
 

+ 5 - 2
java110-common/src/main/java/com/java110/common/constant/ServiceCodeConstant.java

@@ -141,9 +141,12 @@ public class ServiceCodeConstant {
     /**
      * 保存评论
      */
-    public static final String SERVICE_CODE_SAVE_COMMENT_INFO = "sava.comment.info";
-
+    public static final String SERVICE_CODE_SAVE_COMMENT_INFO = "save.comment.info";
 
+    /**
+     * 删除评论
+     */
+    public static final String SERVICE_CODE_DELETE_COMMENT_INFO = "delete.comment.info";
 
 
 

+ 7 - 0
java110-config/db/CenterService/create_table.db

@@ -306,6 +306,13 @@ INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_i
 VALUES('delete.shop.catalog','D','删除商品目录信息',1,'http://shop-service/shopApi/service','8000418003');
 
 
+INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
+VALUES('save.comment.info','D','保存评论',1,'http://comment-service/commentApi/service','8000418003');
+
+INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
+VALUES('delete.comment.info','D','删除评论',1,'http://comment-service/commentApi/service','8000418003');
+
+
 insert into c_route(app_id,service_id,invoke_model,order_type_cd,status_cd) values(
 '8000418001','1','S','Q','0'
 );

+ 5 - 5
java110-config/db/CommentService/create_table.sql

@@ -117,12 +117,12 @@ PARTITION BY RANGE (`month`) (
 CREATE INDEX idx_sub_comment_photo_b_id ON c_sub_comment_photo(b_id);
 CREATE INDEX idx_sub_comment_photo_sub_comment_id ON c_sub_comment_photo(sub_comment_id);
 -- 评论分数
-create table c_comment_score(
-    comment_score_id varchar(30) not null comment '评论分数ID',
-    comment_id varchar(30) not null comment '评论ID',
+CREATE TABLE c_comment_score(
+    comment_score_id VARCHAR(30) NOT NULL COMMENT '评论分数ID',
+    comment_id VARCHAR(30) NOT NULL COMMENT '评论ID',
     b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
-    score_type_cd varchar(30) not null comment '打分类别,S 商品相符,U 卖家打分,T 物流打分'
-    value int not null comment '分数',
+    score_type_cd VARCHAR(30) NOT NULL COMMENT '打分类别,S 商品相符,U 卖家打分,T 物流打分',
+    `value` INT NOT NULL COMMENT '分数',
     `month` INT NOT NULL COMMENT '月份',
     create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
     status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效'