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
28757503
Commit
28757503
authored
Oct 08, 2023
by
周亚武
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序新闻列表接口
parent
aa6f6fb5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
5 deletions
+31
-5
enterprise-manager/pom.xml
enterprise-manager/pom.xml
+5
-0
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/NewsReq.java
.../main/java/com/mortals/xhx/busiz/applets/req/NewsReq.java
+1
-1
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/NewsApiController.java
.../com/mortals/xhx/busiz/applets/web/NewsApiController.java
+25
-4
No files found.
enterprise-manager/pom.xml
View file @
28757503
...
@@ -28,6 +28,11 @@
...
@@ -28,6 +28,11 @@
<profiles.nacos.server-addr>
127.0.0.1:8848
</profiles.nacos.server-addr>
<profiles.nacos.server-addr>
127.0.0.1:8848
</profiles.nacos.server-addr>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.rabbitmq.host>
192.168.0.251
</profiles.rabbitmq.host>
<profiles.rabbitmq.port>
5672
</profiles.rabbitmq.port>
<profiles.rabbitmq.username>
root_mq
</profiles.rabbitmq.username>
<profiles.rabbitmq.password>
xhx@2022
</profiles.rabbitmq.password>
<profiles.rabbitmq.virtualhost>
/
</profiles.rabbitmq.virtualhost>
<profiles.log.path>
/home/mortals/app/logs
</profiles.log.path>
<profiles.log.path>
/home/mortals/app/logs
</profiles.log.path>
<profiles.log.level>
info
</profiles.log.level>
<profiles.log.level>
info
</profiles.log.level>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
<profiles.publish.path>
/home/publish
</profiles.publish.path>
...
...
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/req/NewsReq.java
View file @
28757503
...
@@ -18,6 +18,6 @@ public class NewsReq extends BaseReq {
...
@@ -18,6 +18,6 @@ public class NewsReq extends BaseReq {
/**
/**
* 分类id
* 分类id
*/
*/
private
Long
c
ategoryId
;
private
Long
newsC
ategoryId
;
}
}
enterprise-manager/src/main/java/com/mortals/xhx/busiz/applets/web/NewsApiController.java
View file @
28757503
...
@@ -13,6 +13,8 @@ import com.mortals.xhx.base.system.user.service.UserService;
...
@@ -13,6 +13,8 @@ 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.utils.BeanUtil
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.module.category.model.CategoryQuery
;
import
com.mortals.xhx.module.category.service.CategoryService
;
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
;
import
com.mortals.xhx.module.news.model.NewsCategoryQuery
;
import
com.mortals.xhx.module.news.model.NewsCategoryQuery
;
...
@@ -21,6 +23,7 @@ import com.mortals.xhx.module.news.model.NewsQuery;
...
@@ -21,6 +23,7 @@ import com.mortals.xhx.module.news.model.NewsQuery;
import
com.mortals.xhx.module.news.service.NewsCategoryService
;
import
com.mortals.xhx.module.news.service.NewsCategoryService
;
import
com.mortals.xhx.module.news.service.NewsService
;
import
com.mortals.xhx.module.news.service.NewsService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -60,6 +63,7 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
...
@@ -60,6 +63,7 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
@Autowired
@Autowired
private
UserService
userService
;
private
UserService
userService
;
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"top"
,
paramService
.
getParamBySecondOrganize
(
"News"
,
"top"
));
this
.
addDict
(
model
,
"top"
,
paramService
.
getParamBySecondOrganize
(
"News"
,
"top"
));
this
.
addDict
(
model
,
"viewNums"
,
paramService
.
getParamBySecondOrganize
(
"News"
,
"viewNums"
));
this
.
addDict
(
model
,
"viewNums"
,
paramService
.
getParamBySecondOrganize
(
"News"
,
"viewNums"
));
...
@@ -69,10 +73,27 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
...
@@ -69,10 +73,27 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
}
}
/**
* 新闻频道分类
*/
@PostMapping
(
value
=
"categoryList"
)
public
Rest
<
Object
>
categoryList
(){
String
busiDesc
=
"新闻频道"
;
Rest
<
Object
>
rest
=
Rest
.
ok
();
try
{
rest
.
setData
(
newsCategoryService
.
find
(
new
NewsCategoryQuery
()));
}
catch
(
Exception
e
)
{
log
.
error
(
busiDesc
,
e
);
rest
=
Rest
.
fail
(
super
.
convertException
(
e
));
}
return
rest
;
}
/**
/**
* 新闻列表
* 新闻列表
*/
*/
@PostMapping
(
value
=
"
l
ist"
)
@PostMapping
(
value
=
"
newsL
ist"
)
public
Rest
<
Object
>
newsList
(
@RequestBody
NewsReq
newsReq
)
{
public
Rest
<
Object
>
newsList
(
@RequestBody
NewsReq
newsReq
)
{
String
busiDesc
=
"新闻列表"
;
String
busiDesc
=
"新闻列表"
;
log
.
info
(
"【{}】【请求体】--> {}"
,
busiDesc
,
JSONObject
.
toJSONString
(
newsReq
));
log
.
info
(
"【{}】【请求体】--> {}"
,
busiDesc
,
JSONObject
.
toJSONString
(
newsReq
));
...
@@ -86,8 +107,8 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
...
@@ -86,8 +107,8 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
PageInfo
pageInfo
=
buildPageInfo
(
newsReq
);
PageInfo
pageInfo
=
buildPageInfo
(
newsReq
);
NewsQuery
query
=
new
NewsQuery
();
NewsQuery
query
=
new
NewsQuery
();
if
(!
ObjectUtils
.
isEmpty
(
newsReq
.
getCategoryId
())){
if
(!
ObjectUtils
.
isEmpty
(
newsReq
.
get
News
CategoryId
())){
query
.
setCategoryId
(
newsReq
.
getCategoryId
());
query
.
setCategoryId
(
newsReq
.
get
News
CategoryId
());
}
}
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"createTime"
,
OrderCol
.
DESCENDING
)));
query
.
setOrderColList
(
Arrays
.
asList
(
new
OrderCol
(
"createTime"
,
OrderCol
.
DESCENDING
)));
...
@@ -113,7 +134,7 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
...
@@ -113,7 +134,7 @@ public class NewsApiController extends AbstractBaseController<NewsReq> {
/**
/**
* 新闻详细
* 新闻详细
*/
*/
@PostMapping
(
value
=
"
i
nfo"
)
@PostMapping
(
value
=
"
newsI
nfo"
)
public
Rest
<
NewsEntity
>
appealInfo
(
@RequestBody
NewsReq
newsReq
)
{
public
Rest
<
NewsEntity
>
appealInfo
(
@RequestBody
NewsReq
newsReq
)
{
String
busiDesc
=
"新闻详细"
;
String
busiDesc
=
"新闻详细"
;
log
.
info
(
"【{}】【请求体】--> {}"
,
busiDesc
,
JSONObject
.
toJSONString
(
newsReq
));
log
.
info
(
"【{}】【请求体】--> {}"
,
busiDesc
,
JSONObject
.
toJSONString
(
newsReq
));
...
...
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