Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
6f895232
Commit
6f895232
authored
Jul 12, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口修改
parent
108f9fda
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
10 deletions
+18
-10
CommentController.java
...ava/com/tanpu/community/controller/CommentController.java
+12
-4
FeignClientForProducts.java
...tanpu/community/feign/product/FeignClientForProducts.java
+2
-2
FeignClientForTanpuroom.java
...pu/community/feign/tanpuroom/FeignClientForTanpuroom.java
+2
-2
FeignClientForZhibo.java
.../com/tanpu/community/feign/zhibo/FeignClientForZhibo.java
+2
-2
No files found.
community-service/src/main/java/com/tanpu/community/controller/CommentController.java
View file @
6f895232
...
@@ -2,6 +2,8 @@ package com.tanpu.community.controller;
...
@@ -2,6 +2,8 @@ package com.tanpu.community.controller;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.api.CommonResp
;
import
com.tanpu.common.auth.AuthLogin
;
import
com.tanpu.common.auth.UserHolder
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.qo.CommentQo
;
import
com.tanpu.community.api.beans.req.comment.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.comment.CreateCommentReq
;
import
com.tanpu.community.api.beans.req.comment.LikeCommentReq
;
import
com.tanpu.community.api.beans.req.comment.LikeCommentReq
;
...
@@ -14,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -14,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
@RestController
@RestController
...
@@ -24,21 +27,26 @@ public class CommentController {
...
@@ -24,21 +27,26 @@ public class CommentController {
@Autowired
@Autowired
private
CommentManager
commentManager
;
private
CommentManager
commentManager
;
@Resource
private
UserHolder
userHolder
;
@ApiOperation
(
"发表评论"
)
@ApiOperation
(
"发表评论"
)
@AuthLogin
@PostMapping
(
value
=
"/publishComment"
)
@PostMapping
(
value
=
"/publishComment"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Void
>
publishCommet
(
@RequestBody
CreateCommentReq
req
)
{
public
CommonResp
<
Void
>
publishCommet
(
@RequestBody
CreateCommentReq
req
)
{
String
userId
=
"liujm"
;
String
userId
=
userHolder
.
getUserInfo
().
getId
()
;
commentManager
.
comment
(
req
,
userId
);
commentManager
.
comment
(
req
,
userId
);
return
CommonResp
.
success
();
return
CommonResp
.
success
();
}
}
@ApiOperation
(
"查看评论"
)
@ApiOperation
(
"查看评论"
)
@AuthLogin
@PostMapping
(
value
=
"/queryComment"
)
@PostMapping
(
value
=
"/queryComment"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Page
<
CommentQo
>>
queryComment
(
@RequestBody
QueryCommentReq
req
)
{
public
CommonResp
<
Page
<
CommentQo
>>
queryComment
(
@RequestBody
QueryCommentReq
req
)
{
//todo
//todo
String
userId
=
"liujm"
;
String
userId
=
userHolder
.
getUserInfo
().
getId
()
;
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
req
.
getThemeId
(),
userId
);
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
req
.
getThemeId
(),
userId
);
return
CommonResp
.
success
(
PageUtils
.
page
(
req
.
getPage
(),
result
));
return
CommonResp
.
success
(
PageUtils
.
page
(
req
.
getPage
(),
result
));
}
}
...
@@ -47,7 +55,7 @@ public class CommentController {
...
@@ -47,7 +55,7 @@ public class CommentController {
@PostMapping
(
value
=
"/likeComment"
)
@PostMapping
(
value
=
"/likeComment"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Void
>
likeComment
(
@RequestBody
LikeCommentReq
req
)
{
public
CommonResp
<
Void
>
likeComment
(
@RequestBody
LikeCommentReq
req
)
{
String
userId
=
"liujm"
;
String
userId
=
userHolder
.
getUserId
()
;
commentManager
.
likeComment
(
req
,
userId
);
commentManager
.
likeComment
(
req
,
userId
);
return
CommonResp
.
success
();
return
CommonResp
.
success
();
}
}
...
@@ -57,7 +65,7 @@ public class CommentController {
...
@@ -57,7 +65,7 @@ public class CommentController {
@ResponseBody
@ResponseBody
public
CommonResp
<
Void
>
reportComment
(
@RequestParam
String
commentId
)
{
public
CommonResp
<
Void
>
reportComment
(
@RequestParam
String
commentId
)
{
//todo
//todo
String
userId
=
"liujm"
;
String
userId
=
userHolder
.
getUserId
()
;
return
CommonResp
.
failed
(
"功能暂未开放"
);
return
CommonResp
.
failed
(
"功能暂未开放"
);
}
}
}
}
community-service/src/main/java/com/tanpu/community/feign/product/FeignClientForProducts.java
View file @
6f895232
...
@@ -10,8 +10,8 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -10,8 +10,8 @@ import org.springframework.web.bind.annotation.RequestParam;
import
java.util.List
;
import
java.util.List
;
@FeignClient
(
value
=
"service-product"
,
url
=
"${tanpu.feo-product.svc:}"
,
fallbackFactory
=
FeignBackClientForProducts
.
class
,
path
=
"/product"
)
//
@FeignClient(value = "service-product", url = "${tanpu.feo-product.svc:}", fallbackFactory = FeignBackClientForProducts.class, path = "/product")
//@FeignClient(value = "service-product", contextId = "product", fallbackFactory = FeignBackClientForProducts.class, url = "http://127.0.0.1
:8194/product")
@FeignClient
(
value
=
"service-product"
,
contextId
=
"product"
,
fallbackFactory
=
FeignBackClientForProducts
.
class
,
url
=
"http://172.20.0.68
:8194/product"
)
public
interface
FeignClientForProducts
{
public
interface
FeignClientForProducts
{
@ApiOperation
(
"获取产品详情"
)
@ApiOperation
(
"获取产品详情"
)
...
...
community-service/src/main/java/com/tanpu/community/feign/tanpuroom/FeignClientForTanpuroom.java
View file @
6f895232
...
@@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.RequestParam;
import
java.util.List
;
import
java.util.List
;
@FeignClient
(
value
=
"service-tanpuroom"
,
url
=
"${tanpu.feo-tanpuroom.svc:}"
,
fallbackFactory
=
FeignBackClientForTanpuroom
.
class
,
path
=
"/tanpuroom"
)
//
@FeignClient(value = "service-tanpuroom", url = "${tanpu.feo-tanpuroom.svc:}", fallbackFactory = FeignBackClientForTanpuroom.class, path = "/tanpuroom")
//@FeignClient(value = "service-tanpuroom", contextId = "tanpuroom", fallbackFactory = FeignBackClientForTanpuroom.class, url = "http://127.0.0.
1:8086/tanpuroom")
@FeignClient
(
value
=
"service-tanpuroom"
,
contextId
=
"tanpuroom"
,
fallbackFactory
=
FeignBackClientForTanpuroom
.
class
,
url
=
"http://172.20.1.22
1:8086/tanpuroom"
)
public
interface
FeignClientForTanpuroom
{
public
interface
FeignClientForTanpuroom
{
...
...
community-service/src/main/java/com/tanpu/community/feign/zhibo/FeignClientForZhibo.java
View file @
6f895232
...
@@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import
java.util.List
;
import
java.util.List
;
@FeignClient
(
value
=
"service-zhibo"
,
url
=
"${tanpu.feo-zhibo.svc:}"
,
fallbackFactory
=
FeignbackForZhibo
.
class
,
path
=
"/zhibo"
)
//
@FeignClient(value = "service-zhibo", url = "${tanpu.feo-zhibo.svc:}", fallbackFactory = FeignbackForZhibo.class, path = "/zhibo")
//@FeignClient(value = "service-zhibo", fallbackFactory = FeignbackForZhibo.class, url = "http://127.0.0.1
:8183/zhibo")
@FeignClient
(
value
=
"service-zhibo"
,
fallbackFactory
=
FeignbackForZhibo
.
class
,
url
=
"http://172.20.0.169
:8183/zhibo"
)
public
interface
FeignClientForZhibo
{
public
interface
FeignClientForZhibo
{
@ApiOperation
(
value
=
"根据直播间id查询直播间信息"
)
@ApiOperation
(
value
=
"根据直播间id查询直播间信息"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment