Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-web
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
cloud-web
Commits
6283efc6
Commit
6283efc6
authored
Jan 02, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查看我的投稿接口
parent
08f00124
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
244 additions
and
12 deletions
+244
-12
cloud-web-manage/src/main/java/com/yizhi/application/WebManageApplication.java
+0
-6
cloud-web-student/src/main/java/com/yizhi/application/WebStudentApplication.java
+0
-6
cloud-web-student/src/main/java/com/yizhi/application/project/controller/SitePCPublicationManageController.java
+227
-0
cloud-web-student/src/main/java/com/yizhi/application/project/controller/TpCommentApiController.java
+17
-0
No files found.
cloud-web-manage/src/main/java/com/yizhi/application/WebManageApplication.java
View file @
6283efc6
package
com
.
yizhi
.
application
;
import
com.yizhi.core.application.security.config.SpringSecurityConfig
;
import
feign.RequestInterceptor
;
import
feign.RequestTemplate
;
import
org.springframework.boot.SpringApplication
;
...
...
@@ -11,7 +10,6 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.DependsOn
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
...
...
@@ -31,11 +29,7 @@ public class WebManageApplication {
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
WebManageApplication
.
class
,
args
);
}
@Bean
public
SpringSecurityConfig
springSecurityConfig
(){
return
new
SpringSecurityConfig
();
}
@Bean
public
RequestInterceptor
headerInterceptor
()
{
return
new
RequestInterceptor
()
{
...
...
cloud-web-student/src/main/java/com/yizhi/application/WebStudentApplication.java
View file @
6283efc6
package
com
.
yizhi
.
application
;
import
com.yizhi.core.application.security.config.SpringSecurityConfig
;
import
feign.RequestInterceptor
;
import
feign.RequestTemplate
;
import
org.springframework.boot.SpringApplication
;
...
...
@@ -11,7 +10,6 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.DependsOn
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
...
...
@@ -31,11 +29,7 @@ public class WebStudentApplication {
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
WebStudentApplication
.
class
,
args
);
}
@Bean
public
SpringSecurityConfig
springSecurityConfig
(){
return
new
SpringSecurityConfig
();
}
@Bean
public
RequestInterceptor
headerInterceptor
()
{
return
new
RequestInterceptor
()
{
...
...
cloud-web-student/src/main/java/com/yizhi/application/project/controller/SitePCPublicationManageController.java
0 → 100644
View file @
6283efc6
package
com
.
yizhi
.
application
.
project
.
controller
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.core.application.enums.InternationalEnums
;
import
com.yizhi.lecturer.application.enums.DeleteFlag
;
import
com.yizhi.site.application.feign.PortalManagePCFeignClients
;
import
com.yizhi.site.application.feign.PublicationManageFeignClients
;
import
com.yizhi.site.application.vo.domain.ProtalPlateVo
;
import
com.yizhi.site.application.vo.domain.PublicationVo
;
import
com.yizhi.site.application.vo.site.IdOneVO
;
import
com.yizhi.site.application.vo.site.ParamVO
;
import
com.yizhi.site.application.vo.site.PublicationParamReleaseVO
;
import
com.yizhi.site.application.vo.site.PublicationParamVO
;
import
com.yizhi.util.application.constant.ReturnCode
;
import
com.yizhi.util.application.domain.Response
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
import
java.util.List
;
/**
* 投稿管理
*
* @author yanglang
* @Date: 2024/12/17 16:30
*/
@Api
(
tags
=
"投稿管理"
)
@RestController
@RequestMapping
(
"/pc/site/classify/publication"
)
public
class
SitePCPublicationManageController
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
SitePCPublicationManageController
.
class
);
@Autowired
private
PublicationManageFeignClients
publicationManageFeignClients
;
@Autowired
private
PortalManagePCFeignClients
portalManagePCFeignClient
;
/**
* 投稿列表
*
* @return
*/
@ApiOperation
(
value
=
"查看投稿"
,
notes
=
"查看投稿"
,
response
=
PublicationParamVO
.
class
)
@PostMapping
(
"/list"
)
public
Response
<
Page
<
PublicationVo
>>
list
(
@RequestBody
PublicationParamVO
vo
)
{
try
{
vo
.
setSiteId
(
ContextHolder
.
get
().
getSiteId
());
return
Response
.
ok
(
publicationManageFeignClients
.
list
(
vo
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
LOGGER
.
error
(
""
,
e
);
return
Response
.
fail
(
ReturnCode
.
SERVICE_UNAVAILABLE
.
getCode
(),
ReturnCode
.
SERVICE_UNAVAILABLE
.
getMsg
());
}
}
/**
* 投稿列表
*
* @return
*/
@ApiOperation
(
value
=
"查看我的投稿"
,
notes
=
"查看我的投稿"
,
response
=
PublicationParamVO
.
class
)
@PostMapping
(
"/listByMyself"
)
public
Response
<
Page
<
PublicationVo
>>
listByMyself
(
@RequestBody
PublicationParamVO
vo
)
{
try
{
vo
.
setCreateById
(
ContextHolder
.
get
().
getAccountId
());
vo
.
setSiteId
(
ContextHolder
.
get
().
getSiteId
());
return
Response
.
ok
(
publicationManageFeignClients
.
list
(
vo
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
LOGGER
.
error
(
""
,
e
);
return
Response
.
fail
(
ReturnCode
.
SERVICE_UNAVAILABLE
.
getCode
(),
ReturnCode
.
SERVICE_UNAVAILABLE
.
getMsg
());
}
}
/**
* 投稿发布的列表
*
*/
@ApiOperation
(
value
=
"查看投稿发布列表"
,
notes
=
"查看投稿发布列表"
,
response
=
PublicationVo
.
class
)
@PostMapping
(
"/release/list"
)
public
Response
<
Page
<
PublicationVo
>>
releaseList
(
@RequestBody
PublicationParamReleaseVO
vo
)
{
try
{
RequestContext
context
=
ContextHolder
.
get
();
vo
.
setCompanyCode
(
context
.
getCompanyCode
());
vo
.
setCompanyId
(
context
.
getCompanyId
());
vo
.
setSiteCode
(
context
.
getSiteCode
());
vo
.
setSiteId
(
context
.
getSiteId
());
vo
.
setAccountId
(
vo
.
getAccountId
());
vo
.
setAdmin
(
context
.
isAdmin
());
vo
.
setOrgId
(
context
.
getOrgId
());
vo
.
setOrgIds
(
context
.
getOrgIds
());
vo
.
setOrgName
(
context
.
getOrgName
());
return
Response
.
ok
(
publicationManageFeignClients
.
releaseList
(
vo
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
LOGGER
.
error
(
""
,
e
);
return
Response
.
fail
(
ReturnCode
.
SERVICE_UNAVAILABLE
.
getCode
(),
ReturnCode
.
SERVICE_UNAVAILABLE
.
getMsg
());
}
}
@ApiOperation
(
value
=
"保存资料分类"
,
notes
=
"保存资料分类"
)
@PostMapping
(
"/insert"
)
public
Response
<
Boolean
>
insert
(
@RequestBody
PublicationVo
information
)
{
try
{
Date
date
=
new
Date
();
RequestContext
context
=
ContextHolder
.
get
();
information
.
setCreateById
(
context
.
getAccountId
());
information
.
setCreateByName
(
context
.
getAccountName
());
information
.
setCreateTime
(
date
);
information
.
setUpdateById
(
context
.
getAccountId
());
information
.
setUpdateByName
(
context
.
getAccountName
());
information
.
setUpdateTime
(
date
);
information
.
setSiteId
(
context
.
getSiteId
());
Long
id
=
publicationManageFeignClients
.
insert
(
information
);
if
(
id
==
null
)
{
Response
.
fail
(
InternationalEnums
.
SITEINFORMATIONMANAGECONTROLLER
.
getCode
());
}
information
.
setId
(
id
);
return
Response
.
ok
(
true
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
LOGGER
.
error
(
""
,
e
);
return
Response
.
fail
(
ReturnCode
.
SERVICE_UNAVAILABLE
.
getCode
(),
ReturnCode
.
SERVICE_UNAVAILABLE
.
getMsg
());
}
}
@ApiOperation
(
value
=
"修改资料分类"
,
notes
=
"修改资料分类"
)
@PostMapping
(
"/update"
)
public
Response
<
Boolean
>
update
(
@RequestBody
PublicationVo
information
)
{
try
{
RequestContext
context
=
ContextHolder
.
get
();
information
.
setUpdateById
(
context
.
getAccountId
());
information
.
setUpdateByName
(
context
.
getAccountName
());
information
.
setUpdateTime
(
new
Date
());
Boolean
update
=
publicationManageFeignClients
.
update
(
information
);
return
Response
.
ok
(
true
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
LOGGER
.
error
(
""
+
e
);
return
Response
.
fail
(
ReturnCode
.
UPDATE_FAIL
.
getCode
(),
ReturnCode
.
UPDATE_FAIL
.
getMsg
());
}
}
@PostMapping
(
"/delete"
)
@ApiOperation
(
value
=
"删除站点"
,
notes
=
"删除站点"
)
public
Response
<
String
>
deleteById
(
@RequestBody
IdOneVO
vo
)
{
if
(
vo
==
null
)
{
return
Response
.
fail
(
InternationalEnums
.
SITEINFORMATIONMANAGECONTROLLER1
.
getCode
());
}
if
(
vo
.
getId
()
==
null
)
{
return
Response
.
fail
(
InternationalEnums
.
SITEINFORMATIONMANAGECONTROLLER1
.
getCode
());
}
try
{
return
Response
.
ok
(
publicationManageFeignClients
.
deleteById
(
vo
));
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
""
,
e
);
return
Response
.
fail
();
}
}
@PostMapping
(
"/releases"
)
@ApiOperation
(
value
=
"投稿发布"
,
notes
=
"投稿发布"
)
public
Response
<
Boolean
>
releases
(
@RequestBody
ParamVO
vo
)
{
if
(
vo
==
null
)
{
return
Response
.
fail
(
InternationalEnums
.
SITEINFORMATIONMANAGECONTROLLER1
.
getCode
());
}
if
(
vo
.
getIds
()
==
null
||
vo
.
getIds
().
size
()
==
0
)
{
return
Response
.
fail
(
InternationalEnums
.
SITEINFORMATIONMANAGECONTROLLER1
.
getCode
());
}
return
Response
.
ok
(
publicationManageFeignClients
.
releases
(
vo
));
}
@PostMapping
(
"/unreleases"
)
@ApiOperation
(
value
=
"投稿取消发布"
,
notes
=
"投稿取消发布"
)
public
Response
<
Boolean
>
unreleases
(
@RequestBody
ParamVO
vo
)
{
if
(
vo
==
null
)
{
return
Response
.
fail
(
InternationalEnums
.
SITEINFORMATIONMANAGECONTROLLER1
.
getCode
());
}
if
(
vo
.
getIds
()
==
null
||
vo
.
getIds
().
size
()
==
0
)
{
return
Response
.
fail
(
InternationalEnums
.
SITEINFORMATIONMANAGECONTROLLER1
.
getCode
());
}
//新增新闻下架,校验是否关联首页模块
List
<
Long
>
ids
=
vo
.
getIds
();
for
(
Long
infoId
:
ids
)
{
ProtalPlateVo
protalPlate
=
new
ProtalPlateVo
();
protalPlate
.
setLinkContent
(
infoId
);
protalPlate
.
setState
(
DeleteFlag
.
YES
.
ordinal
());
ProtalPlateVo
plate
=
portalManagePCFeignClient
.
getPlate
(
protalPlate
);
if
(
plate
!=
null
)
{
LOGGER
.
info
(
"新闻下架失败;informationId={},新闻已经关联到首页配置模块;不能下架"
,
infoId
);
return
Response
.
fail
(
InternationalEnums
.
TRAININGPROJECTCONTROLLER2
.
getCode
());
}
}
boolean
b
=
publicationManageFeignClients
.
unreleases
(
vo
);
return
Response
.
ok
(
b
);
}
@GetMapping
(
"/view"
)
@ApiOperation
(
value
=
"投稿预览"
,
notes
=
"投稿预览"
,
response
=
PublicationVo
.
class
)
public
Response
<
PublicationVo
>
releases
(
@RequestParam
(
name
=
"id"
)
Long
id
)
{
PublicationVo
info
=
publicationManageFeignClients
.
publicationView
(
id
);
return
Response
.
ok
(
info
);
}
@GetMapping
(
"/approve"
)
@ApiOperation
(
value
=
"投稿审批通过"
,
notes
=
"投稿审批通过"
,
response
=
PublicationVo
.
class
)
public
Response
<
PublicationVo
>
approve
(
@RequestParam
(
name
=
"id"
)
Long
id
)
{
boolean
info
=
publicationManageFeignClients
.
approve
(
id
);
return
Response
.
ok
(
info
);
}
@GetMapping
(
"/unApprove"
)
@ApiOperation
(
value
=
"投稿审批不通过"
,
notes
=
"投稿审批通过"
,
response
=
PublicationVo
.
class
)
public
Response
<
PublicationVo
>
unApprove
(
@RequestParam
(
name
=
"id"
)
Long
id
)
{
boolean
info
=
publicationManageFeignClients
.
unApprove
(
id
);
return
Response
.
ok
(
info
);
}
}
cloud-web-student/src/main/java/com/yizhi/application/project/controller/TpCommentApiController.java
View file @
6283efc6
...
...
@@ -111,6 +111,23 @@ public class TpCommentApiController {
return
Response
.
ok
(
commentVoPage
,
(
Map
<
String
,
Integer
>)
pair
.
getRight
());
}
/**
* PC端培训项目展现我的评论列表
*
* @param trCommentVo
* @return
*/
@PostMapping
(
"/pc/listByMyself"
)
@ApiOperation
(
value
=
"PC端培训项目展现我的评论列表"
)
Response
<
PageCommentVo
>
tpCommentMyList
(
@ApiParam
(
value
=
"trCommentVo"
)
@RequestBody
TrCommentVo
trCommentVo
)
{
RequestContext
requestContext
=
ContextHolder
.
get
();
Page
<
PageCommentVo
>
commentVoPage
=
tpCommentClient
.
listByMyself
(
trCommentVo
.
getTrainingProjectId
(),
trCommentVo
.
getBizType
(),
requestContext
.
getAccountId
(),
trCommentVo
.
getPageNo
(),
trCommentVo
.
getPageSize
(),
1
);
commentVoPage
=
workUtil
.
fillData
(
commentVoPage
,
requestContext
);
Pair
pair
=
PageTools
.
split
(
commentVoPage
);
return
Response
.
ok
(
commentVoPage
,
(
Map
<
String
,
Integer
>)
pair
.
getRight
());
}
/**
* PC端发表评论
*
...
...
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