Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
auth-master
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
auth-master
Commits
158c5404
Commit
158c5404
authored
Nov 14, 2025
by
zhouguibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公告列表,详情
parent
2a2d6a97
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
511 行增加
和
4 行删除
+511
-4
src/main/java/com/metro/auth/platform/domain/dto/FileDownDTO.java
+4
-1
src/main/java/com/metro/auth/platform/domain/dto/NoticeManageActivitiDTO.java
+4
-1
src/main/java/com/metro/auth/platform/metrointerface/ExternalController.java
+431
-2
src/main/java/com/metro/auth/platform/outlineapi/PlatformUrlManager.java
+56
-0
src/main/resources/application-test153.yml
+16
-0
没有找到文件。
src/main/java/com/metro/auth/platform/domain/dto/FileDownDTO.java
View file @
158c5404
...
...
@@ -48,5 +48,8 @@ public class FileDownDTO {
@ApiModelProperty
(
value
=
"filepath"
)
private
String
filepath
;
//
private
List
<
FileDownFileDTO
>
filelist
;
@ApiModelProperty
(
value
=
"collectNum"
)
private
String
collectNum
;
//
@ApiModelProperty
(
value
=
"video"
)
private
String
video
;
//
}
src/main/java/com/metro/auth/platform/domain/dto/NoticeManageActivitiDTO.java
View file @
158c5404
...
...
@@ -48,5 +48,8 @@ public class NoticeManageActivitiDTO {
private
String
first
;
private
String
sortRules
;
private
String
realNoticeId
;
private
String
isCollect
;
private
String
isSubscriber
;
private
String
accountId
;
}
src/main/java/com/metro/auth/platform/metrointerface/ExternalController.java
View file @
158c5404
package
com
.
metro
.
auth
.
platform
.
metrointerface
;
import
java.util.Base64
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageInfo
;
...
...
@@ -62,7 +64,26 @@ public class ExternalController {
}
return
ResultJson
.
ok
(
result
);
}
/**
* 接口1:
* 功能描述: <br>获取固定栏目信息集合
* 〈〉
* @Author: lx
*/
@GetMapping
(
"/noticemanage/api/fiedColumn/{userid}"
)
public
ResultJson
queryFiexdColumnList
(
@PathVariable
String
userid
,
HttpServletRequest
request
){
String
token
=
request
.
getHeader
(
"Auth3"
);
String
url
=
SpringUtil
.
getBean
(
PlatformUrlManager
.
class
).
getPlatformURI
(
PlatformUrlManager
.
API_FIXED_COLUMN_URL
);
JSONObject
result
=
null
;
try
{
result
=
httpAPIService
.
doPostHeader
(
url
,
""
,
token
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ResultJson
.
ok
(
result
);
}
/**
* 接口2:
* 功能描述: <br>获取公告信息集合
...
...
@@ -364,6 +385,289 @@ public class ExternalController {
fileDownDTO
.
setThumbsNum
(
jsonObject
.
getString
(
"thumbsNum"
));
fileDownDTO
.
setTitle
(
jsonObject
.
getString
(
"title"
));
fileDownDTO
.
setContent
(
jsonObject
.
getString
(
"content"
));
fileDownDTO
.
setVideo
(
jsonObject
.
getString
(
"video"
));
list
.
add
(
fileDownDTO
);
});
}
}
Pagination
pagination
=
new
Pagination
(
list
,
new
Long
(
dataCount
),
pageSize
,
pageIndex
);
return
ResultJson
.
ok
(
pagination
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResultJson
.
failure
(
ResultCode
.
RESPONSE_ERROR
);
}
}
@GetMapping
(
"/myPageList/{userid}"
)
public
ResultJson
myPageList
(
NoticeManageActivitiDTO
noticeManageActivitiDTO
,
int
pageIndex
,
int
pageSize
,
@PathVariable
String
userid
,
HttpServletRequest
request
){
String
url
=
SpringUtil
.
getBean
(
PlatformUrlManager
.
class
).
getPlatformURI
(
PlatformUrlManager
.
API_ACTIVITI_ME_URL
);
String
result
=
null
;
String
token
=
request
.
getHeader
(
"Auth3"
);
int
p
=
Integer
.
parseInt
(
noticeManageActivitiDTO
.
getPageIndex
());
int
b
=
Integer
.
parseInt
(
noticeManageActivitiDTO
.
getPageSize
());
noticeManageActivitiDTO
.
setPageSize
(
String
.
valueOf
(
b
));
noticeManageActivitiDTO
.
setPageIndex
(
String
.
valueOf
((
p
-
1
)*
b
));
// connection.setRequestProperty("token", userid);
try
{
result
=
this
.
doPost
(
url
,
noticeManageActivitiDTO
,
token
);
JSONObject
json
=
JSONUtil
.
getJSONFromString
(
result
);
int
resultCode
=
json
.
getIntValue
(
"resultCode"
);
String
resultMsg
=
json
.
getString
(
"resultMs"
);
int
dataCount
=
json
.
getIntValue
(
"dataCount"
);
List
<
FileDownDTO
>
list
=
new
ArrayList
<
FileDownDTO
>();
if
(
resultCode
==
1
){
JSONArray
jsonArray
=
json
.
getJSONArray
(
"obj"
);
if
(
jsonArray
!=
null
&&
jsonArray
.
size
()>
0
){
jsonArray
.
stream
().
forEach
(
jsons
->{
List
<
FileDownFileDTO
>
filelist
=
new
ArrayList
<
FileDownFileDTO
>();
JSONObject
jsonObject
=
(
JSONObject
)
jsons
;
FileDownDTO
fileDownDTO
=
new
FileDownDTO
();
fileDownDTO
.
setId
(
jsonObject
.
getString
(
"proceIntanId"
));
fileDownDTO
.
setAuthor
(
jsonObject
.
getString
(
"author"
));
fileDownDTO
.
setCanUpdatePublishTime
(
jsonObject
.
getString
(
"canUpdatePublishTime"
));
fileDownDTO
.
setCreateTime
(
jsonObject
.
getString
(
"createTime"
));
fileDownDTO
.
setColumnId
(
jsonObject
.
getString
(
"columnId"
));
fileDownDTO
.
setColumnInfo
(
jsonObject
.
getString
(
"columnInfo"
));
fileDownDTO
.
setCommentNum
(
jsonObject
.
getString
(
"commentNum"
));
fileDownDTO
.
setCreateByCom
(
jsonObject
.
getString
(
"createByCom"
));
JSONArray
coverFilejsonArray
=
json
.
getJSONArray
(
"coverFile"
);
JSONObject
coverFilejson
=(
JSONObject
)(
jsonObject
.
get
(
"coverFile"
))
;
if
(
coverFilejson
!=
null
){
String
filepath
=
coverFilejson
.
getString
(
"filePath"
);
if
(
filepath
==
null
)
{
fileDownDTO
.
setFilepath
(
""
);
}
else
if
(
filepath
.
contains
(
"http"
))
{
fileDownDTO
.
setFilepath
(
coverFilejson
.
getString
(
"filePath"
));
}
else
{
fileDownDTO
.
setFilepath
(
PlatformUrlManager
.
API_IMGURL
+
filepath
);
}
}
else
{
fileDownDTO
.
setFilepath
(
""
);
}
fileDownDTO
.
setFilelist
(
filelist
);
fileDownDTO
.
setImgpath
(
jsonObject
.
getString
(
"imgpath"
));
fileDownDTO
.
setListNoticeScope
(
jsonObject
.
getString
(
"listNoticeScope"
));
fileDownDTO
.
setMemo
(
jsonObject
.
getString
(
"memo"
));
fileDownDTO
.
setPublishTime
(
jsonObject
.
getString
(
"publishTime"
));
fileDownDTO
.
setReaderNum
(
jsonObject
.
getString
(
"readerNum"
));
fileDownDTO
.
setRed
(
jsonObject
.
getString
(
"red"
));
fileDownDTO
.
setThumbsNum
(
jsonObject
.
getString
(
"thumbsNum"
));
fileDownDTO
.
setTitle
(
jsonObject
.
getString
(
"title"
));
fileDownDTO
.
setContent
(
jsonObject
.
getString
(
"content"
));
fileDownDTO
.
setVideo
(
jsonObject
.
getString
(
"video"
));
list
.
add
(
fileDownDTO
);
});
}
}
Pagination
pagination
=
new
Pagination
(
list
,
new
Long
(
dataCount
),
pageSize
,
pageIndex
);
return
ResultJson
.
ok
(
pagination
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResultJson
.
failure
(
ResultCode
.
RESPONSE_ERROR
);
}
}
@GetMapping
(
"/myCollectList/{userid}"
)
public
ResultJson
myCollectList
(
NoticeManageActivitiDTO
noticeManageActivitiDTO
,
int
pageIndex
,
int
pageSize
,
@PathVariable
String
userid
,
HttpServletRequest
request
){
String
url
=
SpringUtil
.
getBean
(
PlatformUrlManager
.
class
).
getPlatformURI
(
PlatformUrlManager
.
API_COLLECT_ACTIVITI_ME_URL
);
String
result
=
null
;
String
token
=
request
.
getHeader
(
"Auth3"
);
int
p
=
Integer
.
parseInt
(
noticeManageActivitiDTO
.
getPageIndex
());
int
b
=
Integer
.
parseInt
(
noticeManageActivitiDTO
.
getPageSize
());
noticeManageActivitiDTO
.
setPageSize
(
String
.
valueOf
(
b
));
noticeManageActivitiDTO
.
setPageIndex
(
String
.
valueOf
((
p
-
1
)*
b
));
// connection.setRequestProperty("token", userid);
try
{
result
=
this
.
doPost
(
url
,
noticeManageActivitiDTO
,
token
);
JSONObject
json
=
JSONUtil
.
getJSONFromString
(
result
);
int
resultCode
=
json
.
getIntValue
(
"resultCode"
);
String
resultMsg
=
json
.
getString
(
"resultMs"
);
int
dataCount
=
json
.
getIntValue
(
"dataCount"
);
List
<
FileDownDTO
>
list
=
new
ArrayList
<
FileDownDTO
>();
if
(
resultCode
==
1
){
JSONArray
jsonArray
=
json
.
getJSONArray
(
"obj"
);
if
(
jsonArray
!=
null
&&
jsonArray
.
size
()>
0
){
jsonArray
.
stream
().
forEach
(
jsons
->{
List
<
FileDownFileDTO
>
filelist
=
new
ArrayList
<
FileDownFileDTO
>();
JSONObject
jsonObject
=
(
JSONObject
)
jsons
;
FileDownDTO
fileDownDTO
=
new
FileDownDTO
();
fileDownDTO
.
setId
(
jsonObject
.
getString
(
"proceIntanId"
));
fileDownDTO
.
setAuthor
(
jsonObject
.
getString
(
"author"
));
fileDownDTO
.
setCanUpdatePublishTime
(
jsonObject
.
getString
(
"canUpdatePublishTime"
));
fileDownDTO
.
setCreateTime
(
jsonObject
.
getString
(
"createTime"
));
fileDownDTO
.
setColumnId
(
jsonObject
.
getString
(
"columnId"
));
fileDownDTO
.
setColumnInfo
(
jsonObject
.
getString
(
"columnInfo"
));
fileDownDTO
.
setCommentNum
(
jsonObject
.
getString
(
"commentNum"
));
fileDownDTO
.
setCreateByCom
(
jsonObject
.
getString
(
"createByCom"
));
JSONArray
coverFilejsonArray
=
json
.
getJSONArray
(
"coverFile"
);
JSONObject
coverFilejson
=(
JSONObject
)(
jsonObject
.
get
(
"coverFile"
))
;
if
(
coverFilejson
!=
null
){
String
filepath
=
coverFilejson
.
getString
(
"filePath"
);
if
(
filepath
==
null
)
{
fileDownDTO
.
setFilepath
(
""
);
}
else
if
(
filepath
.
contains
(
"http"
))
{
fileDownDTO
.
setFilepath
(
coverFilejson
.
getString
(
"filePath"
));
}
else
{
fileDownDTO
.
setFilepath
(
PlatformUrlManager
.
API_IMGURL
+
filepath
);
}
}
else
{
fileDownDTO
.
setFilepath
(
""
);
}
fileDownDTO
.
setFilelist
(
filelist
);
fileDownDTO
.
setImgpath
(
jsonObject
.
getString
(
"imgpath"
));
fileDownDTO
.
setListNoticeScope
(
jsonObject
.
getString
(
"listNoticeScope"
));
fileDownDTO
.
setMemo
(
jsonObject
.
getString
(
"memo"
));
fileDownDTO
.
setPublishTime
(
jsonObject
.
getString
(
"publishTime"
));
fileDownDTO
.
setReaderNum
(
jsonObject
.
getString
(
"readerNum"
));
fileDownDTO
.
setRed
(
jsonObject
.
getString
(
"red"
));
fileDownDTO
.
setThumbsNum
(
jsonObject
.
getString
(
"thumbsNum"
));
fileDownDTO
.
setTitle
(
jsonObject
.
getString
(
"title"
));
fileDownDTO
.
setContent
(
jsonObject
.
getString
(
"content"
));
fileDownDTO
.
setCollectNum
(
jsonObject
.
getString
(
"collectNum"
));
fileDownDTO
.
setVideo
(
jsonObject
.
getString
(
"video"
));
list
.
add
(
fileDownDTO
);
});
}
}
Pagination
pagination
=
new
Pagination
(
list
,
new
Long
(
dataCount
),
pageSize
,
pageIndex
);
return
ResultJson
.
ok
(
pagination
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResultJson
.
failure
(
ResultCode
.
RESPONSE_ERROR
);
}
}
@GetMapping
(
"/myCommentList/{userid}"
)
public
ResultJson
myCommentList
(
NoticeManageActivitiDTO
noticeManageActivitiDTO
,
int
pageIndex
,
int
pageSize
,
@PathVariable
String
userid
,
HttpServletRequest
request
){
String
url
=
SpringUtil
.
getBean
(
PlatformUrlManager
.
class
).
getPlatformURI
(
PlatformUrlManager
.
API_COMMENT_ACTIVITI_ME_URL
);
String
result
=
null
;
String
token
=
request
.
getHeader
(
"Auth3"
);
int
p
=
Integer
.
parseInt
(
noticeManageActivitiDTO
.
getPageIndex
());
int
b
=
Integer
.
parseInt
(
noticeManageActivitiDTO
.
getPageSize
());
noticeManageActivitiDTO
.
setPageSize
(
String
.
valueOf
(
b
));
noticeManageActivitiDTO
.
setPageIndex
(
String
.
valueOf
((
p
-
1
)*
b
));
try
{
result
=
this
.
doPost
(
url
,
noticeManageActivitiDTO
,
token
);
JSONObject
json
=
JSONUtil
.
getJSONFromString
(
result
);
int
resultCode
=
json
.
getIntValue
(
"resultCode"
);
String
resultMsg
=
json
.
getString
(
"resultMs"
);
int
dataCount
=
json
.
getIntValue
(
"dataCount"
);
List
<
FileDownDTO
>
list
=
new
ArrayList
<
FileDownDTO
>();
if
(
resultCode
==
1
){
JSONArray
jsonArray
=
json
.
getJSONArray
(
"obj"
);
if
(
jsonArray
!=
null
&&
jsonArray
.
size
()>
0
){
jsonArray
.
stream
().
forEach
(
jsons
->{
List
<
FileDownFileDTO
>
filelist
=
new
ArrayList
<
FileDownFileDTO
>();
JSONObject
jsonObject
=
(
JSONObject
)
jsons
;
FileDownDTO
fileDownDTO
=
new
FileDownDTO
();
fileDownDTO
.
setId
(
jsonObject
.
getString
(
"proceIntanId"
));
fileDownDTO
.
setAuthor
(
jsonObject
.
getString
(
"username"
));
fileDownDTO
.
setCanUpdatePublishTime
(
jsonObject
.
getString
(
"canUpdatePublishTime"
));
fileDownDTO
.
setCreateTime
(
jsonObject
.
getString
(
"createTime"
));
fileDownDTO
.
setCreateByCom
(
jsonObject
.
getString
(
"createByCom"
));
JSONArray
coverFilejsonArray
=
json
.
getJSONArray
(
"coverFile"
);
JSONObject
coverFilejson
=(
JSONObject
)(
jsonObject
.
get
(
"coverFile"
))
;
if
(
coverFilejson
!=
null
){
String
filepath
=
coverFilejson
.
getString
(
"filePath"
);
if
(
filepath
==
null
)
{
fileDownDTO
.
setFilepath
(
""
);
}
else
if
(
filepath
.
contains
(
"http"
))
{
fileDownDTO
.
setFilepath
(
coverFilejson
.
getString
(
"filePath"
));
}
else
{
fileDownDTO
.
setFilepath
(
PlatformUrlManager
.
API_IMGURL
+
filepath
);
}
}
else
{
fileDownDTO
.
setFilepath
(
""
);
}
fileDownDTO
.
setFilelist
(
filelist
);
fileDownDTO
.
setImgpath
(
jsonObject
.
getString
(
"imgpath"
));
fileDownDTO
.
setListNoticeScope
(
jsonObject
.
getString
(
"listNoticeScope"
));
fileDownDTO
.
setMemo
(
jsonObject
.
getString
(
"memo"
));
fileDownDTO
.
setPublishTime
(
jsonObject
.
getString
(
"createtime"
));
fileDownDTO
.
setTitle
(
jsonObject
.
getString
(
"title"
));
fileDownDTO
.
setContent
(
jsonObject
.
getString
(
"conten"
));
list
.
add
(
fileDownDTO
);
});
}
}
Pagination
pagination
=
new
Pagination
(
list
,
new
Long
(
dataCount
),
pageSize
,
pageIndex
);
return
ResultJson
.
ok
(
pagination
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResultJson
.
failure
(
ResultCode
.
RESPONSE_ERROR
);
}
}
@GetMapping
(
"/myThumbsList/{userid}"
)
public
ResultJson
myThumbsList
(
NoticeManageActivitiDTO
noticeManageActivitiDTO
,
int
pageIndex
,
int
pageSize
,
@PathVariable
String
userid
,
HttpServletRequest
request
){
String
url
=
SpringUtil
.
getBean
(
PlatformUrlManager
.
class
).
getPlatformURI
(
PlatformUrlManager
.
API_THUMBS_ACTIVITI_ME_URL
);
String
result
=
null
;
String
token
=
request
.
getHeader
(
"Auth3"
);
int
p
=
Integer
.
parseInt
(
noticeManageActivitiDTO
.
getPageIndex
());
int
b
=
Integer
.
parseInt
(
noticeManageActivitiDTO
.
getPageSize
());
noticeManageActivitiDTO
.
setPageSize
(
String
.
valueOf
(
b
));
noticeManageActivitiDTO
.
setPageIndex
(
String
.
valueOf
((
p
-
1
)*
b
));
// connection.setRequestProperty("token", userid);
try
{
result
=
this
.
doPost
(
url
,
noticeManageActivitiDTO
,
token
);
JSONObject
json
=
JSONUtil
.
getJSONFromString
(
result
);
int
resultCode
=
json
.
getIntValue
(
"resultCode"
);
String
resultMsg
=
json
.
getString
(
"resultMs"
);
int
dataCount
=
json
.
getIntValue
(
"dataCount"
);
List
<
FileDownDTO
>
list
=
new
ArrayList
<
FileDownDTO
>();
if
(
resultCode
==
1
){
JSONArray
jsonArray
=
json
.
getJSONArray
(
"obj"
);
if
(
jsonArray
!=
null
&&
jsonArray
.
size
()>
0
){
jsonArray
.
stream
().
forEach
(
jsons
->{
List
<
FileDownFileDTO
>
filelist
=
new
ArrayList
<
FileDownFileDTO
>();
JSONObject
jsonObject
=
(
JSONObject
)
jsons
;
FileDownDTO
fileDownDTO
=
new
FileDownDTO
();
fileDownDTO
.
setId
(
jsonObject
.
getString
(
"proceIntanId"
));
fileDownDTO
.
setAuthor
(
jsonObject
.
getString
(
"author"
));
fileDownDTO
.
setCanUpdatePublishTime
(
jsonObject
.
getString
(
"canUpdatePublishTime"
));
fileDownDTO
.
setCreateTime
(
jsonObject
.
getString
(
"createTime"
));
fileDownDTO
.
setColumnId
(
jsonObject
.
getString
(
"columnId"
));
fileDownDTO
.
setColumnInfo
(
jsonObject
.
getString
(
"columnInfo"
));
fileDownDTO
.
setCommentNum
(
jsonObject
.
getString
(
"commentNum"
));
fileDownDTO
.
setCreateByCom
(
jsonObject
.
getString
(
"createByCom"
));
JSONArray
coverFilejsonArray
=
json
.
getJSONArray
(
"coverFile"
);
JSONObject
coverFilejson
=(
JSONObject
)(
jsonObject
.
get
(
"coverFile"
))
;
if
(
coverFilejson
!=
null
){
String
filepath
=
coverFilejson
.
getString
(
"filePath"
);
if
(
filepath
==
null
)
{
fileDownDTO
.
setFilepath
(
""
);
}
else
if
(
filepath
.
contains
(
"http"
))
{
fileDownDTO
.
setFilepath
(
coverFilejson
.
getString
(
"filePath"
));
}
else
{
fileDownDTO
.
setFilepath
(
PlatformUrlManager
.
API_IMGURL
+
filepath
);
}
}
else
{
fileDownDTO
.
setFilepath
(
""
);
}
fileDownDTO
.
setFilelist
(
filelist
);
fileDownDTO
.
setImgpath
(
jsonObject
.
getString
(
"imgpath"
));
fileDownDTO
.
setListNoticeScope
(
jsonObject
.
getString
(
"listNoticeScope"
));
fileDownDTO
.
setMemo
(
jsonObject
.
getString
(
"memo"
));
fileDownDTO
.
setPublishTime
(
jsonObject
.
getString
(
"publishTime"
));
fileDownDTO
.
setReaderNum
(
jsonObject
.
getString
(
"readerNum"
));
fileDownDTO
.
setRed
(
jsonObject
.
getString
(
"red"
));
fileDownDTO
.
setThumbsNum
(
jsonObject
.
getString
(
"thumbsNum"
));
fileDownDTO
.
setTitle
(
jsonObject
.
getString
(
"title"
));
fileDownDTO
.
setContent
(
jsonObject
.
getString
(
"content"
));
fileDownDTO
.
setCollectNum
(
jsonObject
.
getString
(
"collectNum"
));
list
.
add
(
fileDownDTO
);
});
}
...
...
@@ -376,7 +680,94 @@ public class ExternalController {
}
}
@GetMapping
(
"/mySubscriberList/{userid}"
)
public
ResultJson
mySubscriberList
(
NoticeManageActivitiDTO
noticeManageActivitiDTO
,
int
pageIndex
,
int
pageSize
,
@PathVariable
String
userid
,
HttpServletRequest
request
){
String
url
=
SpringUtil
.
getBean
(
PlatformUrlManager
.
class
).
getPlatformURI
(
PlatformUrlManager
.
API_SUBSCRIBER_ME_URL
);
String
result
=
null
;
String
token
=
request
.
getHeader
(
"Auth3"
);
int
p
=
Integer
.
parseInt
(
noticeManageActivitiDTO
.
getPageIndex
());
int
b
=
Integer
.
parseInt
(
noticeManageActivitiDTO
.
getPageSize
());
noticeManageActivitiDTO
.
setPageSize
(
String
.
valueOf
(
b
));
noticeManageActivitiDTO
.
setPageIndex
(
String
.
valueOf
((
p
-
1
)*
b
));
try
{
result
=
this
.
doPost
(
url
,
noticeManageActivitiDTO
,
token
);
JSONObject
json
=
JSONUtil
.
getJSONFromString
(
result
);
int
resultCode
=
json
.
getIntValue
(
"resultCode"
);
String
resultMsg
=
json
.
getString
(
"resultMs"
);
int
dataCount
=
json
.
getIntValue
(
"dataCount"
);
List
<
FileDownDTO
>
list
=
new
ArrayList
<
FileDownDTO
>();
if
(
resultCode
==
1
){
JSONArray
jsonArray
=
json
.
getJSONArray
(
"obj"
);
if
(
jsonArray
!=
null
&&
jsonArray
.
size
()>
0
){
jsonArray
.
stream
().
forEach
(
jsons
->{
List
<
FileDownFileDTO
>
filelist
=
new
ArrayList
<
FileDownFileDTO
>();
JSONObject
jsonObject
=
(
JSONObject
)
jsons
;
FileDownDTO
fileDownDTO
=
new
FileDownDTO
();
fileDownDTO
.
setId
(
jsonObject
.
getString
(
"id"
));
fileDownDTO
.
setAuthor
(
jsonObject
.
getString
(
"accountName"
));
fileDownDTO
.
setCanUpdatePublishTime
(
jsonObject
.
getString
(
"canUpdatePublishTime"
));
fileDownDTO
.
setCreateTime
(
jsonObject
.
getString
(
"createTime"
));
fileDownDTO
.
setCreateByCom
(
jsonObject
.
getString
(
"createByCom"
));
JSONArray
coverFilejsonArray
=
json
.
getJSONArray
(
"coverFile"
);
JSONObject
coverFilejson
=(
JSONObject
)(
jsonObject
.
get
(
"coverFile"
))
;
if
(
coverFilejson
!=
null
){
String
filepath
=
coverFilejson
.
getString
(
"filePath"
);
if
(
filepath
==
null
)
{
fileDownDTO
.
setFilepath
(
""
);
}
else
if
(
filepath
.
contains
(
"http"
))
{
fileDownDTO
.
setFilepath
(
coverFilejson
.
getString
(
"filePath"
));
}
else
{
fileDownDTO
.
setFilepath
(
PlatformUrlManager
.
API_IMGURL
+
filepath
);
}
}
else
{
fileDownDTO
.
setFilepath
(
""
);
}
fileDownDTO
.
setFilelist
(
filelist
);
fileDownDTO
.
setImgpath
(
jsonObject
.
getString
(
"avatar"
));
fileDownDTO
.
setListNoticeScope
(
jsonObject
.
getString
(
"listNoticeScope"
));
fileDownDTO
.
setMemo
(
jsonObject
.
getString
(
"memo"
));
fileDownDTO
.
setPublishTime
(
jsonObject
.
getString
(
"createtime"
));
fileDownDTO
.
setTitle
(
jsonObject
.
getString
(
"title"
));
fileDownDTO
.
setContent
(
jsonObject
.
getString
(
"conten"
));
list
.
add
(
fileDownDTO
);
});
}
}
Pagination
pagination
=
new
Pagination
(
list
,
new
Long
(
dataCount
),
pageSize
,
pageIndex
);
return
ResultJson
.
ok
(
pagination
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResultJson
.
failure
(
ResultCode
.
RESPONSE_ERROR
);
}
}
public
String
getToken
(
String
userId
){
// 1. 拼接字符串
long
timestamp
=
System
.
currentTimeMillis
();
String
originalString
=
"99999@"
+
timestamp
;
// 2. URL编码(相当于encodeURIComponent)
String
urlEncoded
=
null
;
try
{
urlEncoded
=
URLEncoder
.
encode
(
originalString
,
StandardCharsets
.
UTF_8
.
toString
());
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
// 3. Base64编码(相当于btoa)
String
base64Encoded
=
Base64
.
getEncoder
().
encodeToString
(
urlEncoded
.
getBytes
(
StandardCharsets
.
UTF_8
));
System
.
out
.
println
(
"原始字符串: "
+
originalString
);
System
.
out
.
println
(
"URL编码后: "
+
urlEncoded
);
System
.
out
.
println
(
"Base64编码后: "
+
base64Encoded
);
return
base64Encoded
;
}
/**
* 添加评论
* @param noticeManageActivitiDTO
...
...
@@ -502,6 +893,41 @@ public class ExternalController {
return
ResultJson
.
ok
(
JSONObject
.
parseObject
(
result
));
}
/**
* 收藏
* @param noticeId
* @param userid
* @return
*/
@GetMapping
(
"/noticemanage/api/collect/add/{userid}"
)
public
ResultJson
addCollect
(
NoticeManageActivitiDTO
noticeManageActivitiDTO
,
@PathVariable
String
userid
,
HttpServletRequest
request
){
String
token
=
request
.
getHeader
(
"Auth3"
);
String
url
=
SpringUtil
.
getBean
(
PlatformUrlManager
.
class
).
getPlatformURI
(
PlatformUrlManager
.
API_COLLECT_ADD_URL
);
String
result
=
null
;
try
{
// result = httpAPIService.doGetHeader(url+"/"+noticeId, token);
// noticeManageActivitiDTO.setRealNoticeId(noticeId);
result
=
this
.
doPost
(
url
,
noticeManageActivitiDTO
,
token
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ResultJson
.
ok
(
JSONObject
.
parseObject
(
result
));
}
@GetMapping
(
"/noticemanage/api/collect/info/{noticeId}/{userid}"
)
public
ResultJson
infoCollect
(
@PathVariable
String
noticeId
,
@PathVariable
String
userid
,
HttpServletRequest
request
){
String
token
=
request
.
getHeader
(
"Auth3"
);
String
url
=
SpringUtil
.
getBean
(
PlatformUrlManager
.
class
).
getPlatformURI
(
PlatformUrlManager
.
API_COLLECT_INFO_URL
);
String
result
=
null
;
try
{
result
=
httpAPIService
.
doGetHeader
(
url
+
"/"
+
noticeId
,
token
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
ResultJson
.
ok
(
JSONObject
.
parseObject
(
result
));
}
@GetMapping
(
"/noticemanage/api/fileinfo/file/{fileId}/{userid}"
)
public
ResultJson
getfileinfo
(
@PathVariable
String
fileId
,
@PathVariable
String
userid
,
HttpServletRequest
request
){
String
token
=
request
.
getHeader
(
"Auth3"
);
...
...
@@ -663,7 +1089,10 @@ public class ExternalController {
parm
.
put
(
"startTime"
,
""
);
parm
.
put
(
"textclass"
,
""
);
parm
.
put
(
"texttype"
,
""
);
parm
.
put
(
"realNoticeId"
,
noticeManageActivitiDTO
.
getRealNoticeId
());
parm
.
put
(
"isCollect"
,
noticeManageActivitiDTO
.
getIsCollect
());
parm
.
put
(
"isSubscriber"
,
noticeManageActivitiDTO
.
getIsSubscriber
());
parm
.
put
(
"accountId"
,
noticeManageActivitiDTO
.
getAccountId
());
writer
.
write
(
parm
.
toString
());
writer
.
flush
();
InputStream
is
=
connection
.
getInputStream
();
...
...
src/main/java/com/metro/auth/platform/outlineapi/PlatformUrlManager.java
View file @
158c5404
...
...
@@ -69,7 +69,19 @@ public class PlatformUrlManager {
* 获得栏目集合接口地址
*/
public
static
String
API_COLUMN_URL
;
public
static
String
API_FIXED_COLUMN_URL
;
/**
* 获得我收藏公告
*/
public
static
String
API_COLLECT_ACTIVITI_ME_URL
;
/**
* 获得我评论公告
*/
public
static
String
API_COMMENT_ACTIVITI_ME_URL
;
public
static
String
API_THUMBS_ACTIVITI_ME_URL
;
public
static
String
API_SUBSCRIBER_ME_URL
;
/**
* 获得公告接口地址
*/
...
...
@@ -79,10 +91,15 @@ public class PlatformUrlManager {
* 获得公告详情接口地址
*/
public
static
String
API_ACTIVITI_DETAIL_URL
;
public
static
String
API_COLLECT_INFO_URL
;
/**
* 获得公告列表
*/
public
static
String
API_COLUMN_List_URL
;
/**
* 我发布公告列表
*/
public
static
String
API_ACTIVITI_ME_URL
;
public
static
String
API_IMGURL
;
/**
* 获得法律列表
...
...
@@ -124,6 +141,8 @@ public class PlatformUrlManager {
*/
public
static
String
API_HUMBS_ADD_URL
;
public
static
String
API_COLLECT_ADD_URL
;
/**
* 获得取消点赞接口地址
*/
...
...
@@ -217,6 +236,12 @@ public class PlatformUrlManager {
@Value
(
"${notice-manage.api_column_list_url}"
)
public
void
setApiColumnListUrl
(
String
apiColumnListUrl
)
{
API_COLUMN_List_URL
=
apiColumnListUrl
;
}
@Value
(
"${notice-manage.api_activiti_me_url}"
)
public
void
setApiActivitiMeUrl
(
String
apiActivitiMeUrl
)
{
API_ACTIVITI_ME_URL
=
apiActivitiMeUrl
;
}
@Value
(
"${notice-manage.api_imgurl}"
)
public
void
setApiImgUrl
(
String
apiImgUrl
)
{
API_IMGURL
=
apiImgUrl
;
}
...
...
@@ -234,6 +259,28 @@ public class PlatformUrlManager {
public
void
setApiColumnUrl
(
String
apiColumnUrl
)
{
API_COLUMN_URL
=
apiColumnUrl
;
}
@Value
(
"${notice-manage.api_fixed_column_url}"
)
public
void
setApiFixedColumnUrl
(
String
apiFixedColumnUrl
)
{
API_FIXED_COLUMN_URL
=
apiFixedColumnUrl
;
}
@Value
(
"${notice-manage.api_collect_activiti_me_url}"
)
public
void
setApiCollectActivitiMeUrl
(
String
apiCollectActivitiMeUrl
)
{
API_COLLECT_ACTIVITI_ME_URL
=
apiCollectActivitiMeUrl
;
}
@Value
(
"${notice-manage.api_comment_activiti_me_url}"
)
public
void
setApiCommentActivitiMeUrl
(
String
apiCommentActivitiMeUrl
)
{
API_COMMENT_ACTIVITI_ME_URL
=
apiCommentActivitiMeUrl
;
}
@Value
(
"${notice-manage.api_thumbs_activiti_me_url}"
)
public
void
setApiThumbsActivitiMeUrl
(
String
apiThumbsActivitiMeUrl
)
{
API_THUMBS_ACTIVITI_ME_URL
=
apiThumbsActivitiMeUrl
;
}
@Value
(
"${notice-manage.api_subscriber_me_url}"
)
public
void
setApiSubscriberMeUrl
(
String
apiSubscriberMeUrl
)
{
API_SUBSCRIBER_ME_URL
=
apiSubscriberMeUrl
;
}
@Value
(
"${notice-manage.api_activiti_url}"
)
public
void
setApiActivitiUrl
(
String
apiActivitiUrl
)
{
...
...
@@ -243,6 +290,10 @@ public class PlatformUrlManager {
public
void
setApiActivitiDetailUrl
(
String
apiActivitidetailUrl
)
{
API_ACTIVITI_DETAIL_URL
=
apiActivitidetailUrl
;
}
@Value
(
"${notice-manage.api_collect_info_url}"
)
public
void
setApiCollectInfoUrl
(
String
apiCollectInfoUrl
)
{
API_COLLECT_INFO_URL
=
apiCollectInfoUrl
;
}
@Value
(
"${notice-manage.api_comments_add_url}"
)
public
void
setApiCommentsAddUrl
(
String
apiCommentsAddUrl
)
{
...
...
@@ -273,6 +324,11 @@ public class PlatformUrlManager {
API_HUMBS_ADD_URL
=
apiHumbsAddUrl
;
}
@Value
(
"${notice-manage.api_collect_add_url}"
)
public
void
setApiCollectAddUrl
(
String
apiCollectAddUrl
)
{
API_COLLECT_ADD_URL
=
apiCollectAddUrl
;
}
@Value
(
"${notice-manage.api_thumbs_del_url}"
)
public
void
setApiHumbsDelUrl
(
String
apiHumbsDelUrl
)
{
API_HUMBS_DEL_URL
=
apiHumbsDelUrl
;
...
...
src/main/resources/application-test153.yml
View file @
158c5404
...
...
@@ -116,10 +116,24 @@ metro-daily:
notice-manage
:
#栏目
api_column_url
:
http://10.12.111.48:5101/NoticeManage/api/column/list
#固定栏目列表
api_fixed_column_url
:
http://10.12.111.48:5101/NoticeManage/api/column/tabColumnListPortal
#栏目列表
api_column_list_url
:
http://10.12.111.48:5101/NoticeManage/api/activiti/scopeAndColumn
#公告
api_activiti_url
:
http://10.12.111.48:5101/NoticeManage/api/activiti/scopeforportallist
# 我发布公告
api_activiti_me_url
:
http://10.12.111.48:5101/NoticeManage/api/noticeInfoController/noticeBymePortal
# 我收藏公告
api_collect_activiti_me_url
:
http://10.12.111.48:5101/NoticeManage/api/collect/collectListPortal
# 我评论公告
api_comment_activiti_me_url
:
http://10.12.111.48:5101/NoticeManage/api/comments/infoWithCommentProtal
# 我点赞公告
api_thumbs_activiti_me_url
:
http://10.12.111.48:5101/NoticeManage/api/subscriber/thumbsinfoListProtal
# 我订阅账户
api_subscriber_me_url
:
http://10.12.111.48:5101/NoticeManage/api/subscriber/getSubscriberByUserIdProtal
#点赞信息
api_collect_info_url
:
http://10.12.111.48:5101/NoticeManage/api/collect/info
#公告详情
api_activiti_detail_url
:
http://10.12.111.48:5101/NoticeManage/api/activiti/noticeInfo/
#添加评论
...
...
@@ -142,6 +156,8 @@ notice-manage:
api_thumbs_add_url
:
http://10.12.111.48:5101/NoticeManage/api/thumbs/add
#取消点赞
api_thumbs_del_url
:
http://10.12.111.48:5101/NoticeManage/api/thumbs/del
#收藏
api_collect_add_url
:
http://10.12.111.48:5101/NoticeManage/api/activiti/toOperateNoticePortal
#文件下载
api_fileinfo_file_url
:
http://10.12.111.48:5101/NoticeManage/api/fileinfo/file
#图片访问地址前缀
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论