Skip to content

Commit e75a487

Browse files
author
wuxw7
committed
'评论服务测试成功'
1 parent 9663ede commit e75a487

File tree

7 files changed

+31
-20
lines changed

7 files changed

+31
-20
lines changed

CommentService/src/main/java/com/java110/comment/listener/DeleteCommentOrSubCommentListener.java

+10-9
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public int getOrder() {
4242

4343
@Override
4444
public String getServiceCode() {
45-
return ServiceCodeConstant.SERVICE_CODE_DELETE_SHOP_INFO;
45+
return ServiceCodeConstant.SERVICE_CODE_DELETE_COMMENT_INFO;
4646
}
4747

4848
/**
@@ -98,30 +98,30 @@ protected void doRecover(DataFlowContext dataFlowContext, Business business) {
9898
Map delInfo = new HashMap();
9999
delInfo.put("bId",business.getbId());
100100
delInfo.put("operate",StatusConstant.STATUS_CD_VALID);
101-
//商户信息
101+
//评论信息
102102
Map comment = commentServiceDaoImpl.getComment(info);
103103
if(comment != null && !comment.isEmpty()){
104104
commentServiceDaoImpl.updateCommentInstance(delInfo);
105105
}
106106

107-
//商户信息
107+
//评论信息
108108
List<Map> subComments = commentServiceDaoImpl.getSubComments(info);
109109
if(subComments != null && subComments.size() > 0){
110110
commentServiceDaoImpl.updateSubCommentInstance(delInfo);
111111
}
112112

113-
//商户信息
113+
//评论属性信息
114114
List<Map> commentAttrs = commentServiceDaoImpl.getSubCommentAttrs(info);
115115
if(commentAttrs != null && commentAttrs.size() > 0){
116116
commentServiceDaoImpl.updateSubCommentAttrInstance(delInfo);
117117
}
118118

119-
//商户信息
119+
//评论照片信息
120120
List<Map> commentPhotos = commentServiceDaoImpl.getSubCommentPhotos(info);
121121
if(commentPhotos != null && commentPhotos.size() > 0){
122122
commentServiceDaoImpl.updateSubCommentPhotoInstance(delInfo);
123123
}
124-
124+
//评论分数信息
125125
List<Map> commentScores = commentServiceDaoImpl.getCommentScores(info);
126126
if(commentScores != null && commentScores.size() > 0){
127127
commentServiceDaoImpl.updateCommentScoreInstance(delInfo);
@@ -144,7 +144,7 @@ private void doComment(Business business,JSONObject comment){
144144
info.put("statusCd",StatusConstant.STATUS_CD_VALID);
145145

146146
Map delInfo = new HashMap();
147-
delInfo.put("bId",business.getbId());
147+
//delInfo.put("bId",business.getbId());
148148
delInfo.put("statusCd",StatusConstant.STATUS_CD_INVALID);
149149

150150
Map commentMap = commentServiceDaoImpl.getComment(info);
@@ -164,7 +164,7 @@ private void doComment(Business business,JSONObject comment){
164164
// 作废 sub_comment
165165
List<Map> subComments = commentServiceDaoImpl.getSubComments(info);
166166

167-
if(subComments == null || subComments.size()>0){
167+
if(subComments == null || subComments.size() == 0){
168168
return ;
169169
}
170170
commentServiceDaoImpl.updateSubCommentInstance(delInfo);
@@ -192,7 +192,8 @@ private void doSubComment(Business business,JSONObject subComment){
192192
info.put("statusCd",StatusConstant.STATUS_CD_VALID);
193193

194194
Map delInfo = new HashMap();
195-
delInfo.put("bId",business.getbId());
195+
//delInfo.put("bId",business.getbId());
196+
delInfo.put("subCommentId",subComment.getString("subCommentId"));
196197
delInfo.put("statusCd",StatusConstant.STATUS_CD_INVALID);
197198

198199

CommentService/src/main/java/com/java110/comment/listener/SaveSubCommentPhotoListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private void doSubCommentPhoto(Business business, JSONArray subCommentPhotos) {
105105
JSONObject subCommentPhoto = subCommentPhotos.getJSONObject(subCommentPhotoIndex);
106106
Assert.jsonObjectHaveKey(subCommentPhoto,"commentPhotoTypeCd","subCommentPhoto 节点下没有包含 commentPhotoTypeCd 节点");
107107
subCommentPhoto.put("bId",business.getbId());
108-
commentServiceDaoImpl.saveSubCommentAttrInstance(subCommentPhoto);
108+
commentServiceDaoImpl.saveSubCommentPhotoInstance(subCommentPhoto);
109109
}
110110
}
111111

MicroCommunity_qq.png

7.13 KB
Loading

Readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ Java + spring cloud + mybatis + mysql + kafka + redis
6464
![image](ConsoleService/doc/img/20180511010848.jpg)
6565

6666

67-
10、统一接口地址:http://yourIp:8001/httpApi/service
67+
10、统一接口地址:http://ip:8001/httpApi/service
6868

69-
加入钉钉java110 工作群随时了解项目进度,和java110开发者零距离沟通
69+
加入微小区交流群随时了解项目进度,和java110开发者零距离沟通 qq群号 827669685,邮箱:928255095@qq.com
7070

71-
![image](dingding_java110.jpg)
71+
![image](MicroCommunity_qq.png)
7272

7373

java110-common/src/main/java/com/java110/common/constant/ServiceCodeConstant.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,12 @@ public class ServiceCodeConstant {
141141
/**
142142
* 保存评论
143143
*/
144-
public static final String SERVICE_CODE_SAVE_COMMENT_INFO = "sava.comment.info";
145-
144+
public static final String SERVICE_CODE_SAVE_COMMENT_INFO = "save.comment.info";
146145

146+
/**
147+
* 删除评论
148+
*/
149+
public static final String SERVICE_CODE_DELETE_COMMENT_INFO = "delete.comment.info";
147150

148151

149152

java110-config/db/CenterService/create_table.db

+7
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,13 @@ INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_i
306306
VALUES('delete.shop.catalog','D','删除商品目录信息',1,'http://shop-service/shopApi/service','8000418003');
307307

308308

309+
INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
310+
VALUES('save.comment.info','D','保存评论',1,'http://comment-service/commentApi/service','8000418003');
311+
312+
INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
313+
VALUES('delete.comment.info','D','删除评论',1,'http://comment-service/commentApi/service','8000418003');
314+
315+
309316
insert into c_route(app_id,service_id,invoke_model,order_type_cd,status_cd) values(
310317
'8000418001','1','S','Q','0'
311318
);

java110-config/db/CommentService/create_table.sql

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

0 commit comments

Comments
 (0)