Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
enterprise-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
enterprise-platform
Commits
aa6f6fb5
Commit
aa6f6fb5
authored
Oct 08, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加新闻列表与详细小程序接口
parent
cf76c708
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/NewsReq.java
.../main/java/com/mortals/xhx/busiz/applets/req/NewsReq.java
+5
-0
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/NewsApiController.java
.../com/mortals/xhx/busiz/applets/web/NewsApiController.java
+11
-6
No files found.
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/NewsReq.java
View file @
aa6f6fb5
...
@@ -15,4 +15,9 @@ public class NewsReq extends BaseReq {
...
@@ -15,4 +15,9 @@ public class NewsReq extends BaseReq {
private
Long
id
;
private
Long
id
;
/**
* 分类id
*/
private
Long
categoryId
;
}
}
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/NewsApiController.java
View file @
aa6f6fb5
package
com.mortals.xhx.busiz.applets.web
;
package
com.mortals.xhx.busiz.applets.web
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
...
@@ -13,7 +12,6 @@ import com.mortals.xhx.base.system.user.model.UserQuery;
...
@@ -13,7 +12,6 @@ import com.mortals.xhx.base.system.user.model.UserQuery;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.busiz.applets.req.NewsReq
;
import
com.mortals.xhx.busiz.applets.req.NewsReq
;
import
com.mortals.xhx.busiz.applets.rsp.NewsListInfo
;
import
com.mortals.xhx.busiz.applets.rsp.NewsListInfo
;
import
com.mortals.xhx.common.code.ProcessStatusEnum
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.module.dept.model.DeptQuery
;
import
com.mortals.xhx.module.dept.model.DeptQuery
;
import
com.mortals.xhx.module.dept.service.DeptService
;
import
com.mortals.xhx.module.dept.service.DeptService
;
...
@@ -31,11 +29,13 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -31,11 +29,13 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.math.BigDecimal
;
import
java.util.Arrays
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.
*
;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.
PAGEINFO_KEY
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
ErrorCode
.
ERROR_TOKEN_EXPIRED
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
ErrorCode
.
ERROR_TOKEN_EXPIRED
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
ErrorCode
.
ERROR_TOKEN_EXPIRED_CONTENT
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
ErrorCode
.
ERROR_TOKEN_EXPIRED_CONTENT
;
...
@@ -70,7 +70,7 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
...
@@ -70,7 +70,7 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
}
}
/**
/**
*
申诉
列表
*
新闻
列表
*/
*/
@PostMapping
(
value
=
"list"
)
@PostMapping
(
value
=
"list"
)
public
Rest
<
Object
>
newsList
(
@RequestBody
NewsReq
newsReq
)
{
public
Rest
<
Object
>
newsList
(
@RequestBody
NewsReq
newsReq
)
{
...
@@ -85,6 +85,11 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
...
@@ -85,6 +85,11 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
try
{
try
{
PageInfo
pageInfo
=
buildPageInfo
(
newsReq
);
PageInfo
pageInfo
=
buildPageInfo
(
newsReq
);
NewsQuery
query
=
new
NewsQuery
();
NewsQuery
query
=
new
NewsQuery
();
if
(!
ObjectUtils
.
isEmpty
(
newsReq
.
getCategoryId
())){
query
.
setCategoryId
(
newsReq
.
getCategoryId
());
}
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"createTime"
,
OrderCol
.
DESCENDING
)));
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"createTime"
,
OrderCol
.
DESCENDING
)));
Result
<
NewsEntity
>
result
=
newsService
.
find
(
query
,
pageInfo
,
context
);
Result
<
NewsEntity
>
result
=
newsService
.
find
(
query
,
pageInfo
,
context
);
List
<
NewsListInfo
>
collect
=
result
.
getList
().
stream
().
map
(
item
->
{
List
<
NewsListInfo
>
collect
=
result
.
getList
().
stream
().
map
(
item
->
{
...
...
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