Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
8timerv2
8timerapiv200
Commits
dd948a60
Commit
dd948a60
authored
Jun 11, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8小时后台--
应需求一定要展示前四张图片
parent
ef0568de
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
src/main/java/cn/timer/api/controller/qyxx/CmsController.java
+13
-7
No files found.
src/main/java/cn/timer/api/controller/qyxx/CmsController.java
View file @
dd948a60
package
cn
.
timer
.
api
.
controller
.
qyxx
;
package
cn
.
timer
.
api
.
controller
.
qyxx
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Timer
;
import
java.util.TimerTask
;
import
cn.timer.api.utils.redis.RedisUtil
;
import
cn.timer.api.utils.redis.RedisUtil
;
import
com.google.common.collect.Maps
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
...
@@ -88,13 +85,22 @@ public class CmsController {
...
@@ -88,13 +85,22 @@ public class CmsController {
*/
*/
@GetMapping
(
value
=
"/zxqyxx"
)
@GetMapping
(
value
=
"/zxqyxx"
)
@ApiOperation
(
value
=
"获取最新讯息的标题、发布时间"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
@ApiOperation
(
value
=
"获取最新讯息的标题、发布时间"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
List
<
CmsContent
>>
groupbyTime
(
@CurrentUser
UserBean
userBean
)
{
public
Result
<
Object
>
groupbyTime
(
@CurrentUser
UserBean
userBean
)
{
Map
map
=
Maps
.
newHashMap
();
Integer
orgCode
=
userBean
.
getOrgCode
();
Integer
orgCode
=
userBean
.
getOrgCode
();
QueryWrapper
<
CmsContent
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
CmsContent
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
"id"
,
"title"
,
"author"
,
"releasetime"
,
"fmtpath"
).
eq
(
"releasestate"
,
0
)
queryWrapper
.
select
(
"id"
,
"title"
,
"author"
,
"releasetime"
,
"fmtpath"
).
eq
(
"releasestate"
,
0
)
.
eq
(
"organization_id"
,
orgCode
).
orderByDesc
(
"releasetime"
).
last
(
"limit 6"
);
.
eq
(
"organization_id"
,
orgCode
).
orderByDesc
(
"releasetime"
).
last
(
"limit 6"
);
List
<
CmsContent
>
qynr
=
CmsContent
.
builder
().
build
().
selectList
(
queryWrapper
);
List
<
CmsContent
>
qynr
=
CmsContent
.
builder
().
build
().
selectList
(
queryWrapper
);
return
ResultUtil
.
data
(
qynr
,
"查询分类成功!"
);
/*应需求一定要展示前四张图片*/
QueryWrapper
<
CmsContent
>
qw
=
new
QueryWrapper
<>();
qw
.
select
(
"fmtpath"
).
eq
(
"releasestate"
,
0
).
isNotNull
(
"fmtpath"
).
ne
(
"fmtpath"
,
""
)
.
eq
(
"organization_id"
,
orgCode
).
orderByDesc
(
"releasetime"
).
last
(
"limit 4"
);
List
<
CmsContent
>
picList
=
CmsContent
.
builder
().
build
().
selectList
(
qw
);
map
.
put
(
"list"
,
qynr
);
map
.
put
(
"picList"
,
picList
);
return
ResultUtil
.
data
(
map
,
"查询分类成功!"
);
}
}
/**
/**
...
...
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