Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 06672728
authored
May 21, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
引入redis配置
1 parent
c09d3979
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
8 deletions
src/main/java/cn/com/glsx/admin/modules/component/RedisService.java
src/main/java/cn/com/glsx/admin/modules/controller/VehicleMonitorController.java
src/main/java/cn/com/glsx/admin/modules/component/RedisService.java
0 → 100644
View file @
0667272
package
cn
.
com
.
glsx
.
admin
.
modules
.
component
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.data.redis.core.HashOperations
;
import
org.springframework.data.redis.core.ListOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.SetOperations
;
import
org.springframework.data.redis.core.ValueOperations
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.concurrent.TimeUnit
;
/**
*
* redis 操作工具类
*/
@Component
public
class
RedisService
{
@Resource
(
name
=
"redisTemplate"
)
protected
RedisTemplate
<
Object
,
Object
>
redisTemplate
;
protected
Log
logger
=
LogFactory
.
getLog
(
getClass
());
public
void
set
(
String
key
,
Object
value
)
{
ValueOperations
valueOperations
=
redisTemplate
.
opsForValue
();
valueOperations
.
set
(
key
,
value
);
}
public
Object
get
(
String
key
)
{
return
redisTemplate
.
opsForValue
().
get
(
key
);
}
public
void
setList
(
String
key
,
List
<?>
value
)
{
ListOperations
listOperations
=
redisTemplate
.
opsForList
();
listOperations
.
leftPush
(
key
,
value
);
}
public
void
setOutTime
(
String
key
,
Object
value
,
long
timeout
,
TimeUnit
unit
)
{
ValueOperations
valueOperations
=
redisTemplate
.
opsForValue
();
valueOperations
.
set
(
key
,
value
,
timeout
,
unit
);
}
public
Object
getList
(
String
key
)
{
return
redisTemplate
.
opsForList
().
leftPop
(
key
);
}
public
void
setSet
(
String
key
,
Set
<?>
value
)
{
SetOperations
setOperations
=
redisTemplate
.
opsForSet
();
setOperations
.
add
(
key
,
value
);
}
public
Object
getSet
(
String
key
)
{
return
redisTemplate
.
opsForSet
().
members
(
key
);
}
public
void
setHash
(
String
key
,
Map
<
String
,
?>
value
)
{
HashOperations
hashOperations
=
redisTemplate
.
opsForHash
();
hashOperations
.
putAll
(
key
,
value
);
}
public
Object
getHash
(
String
key
)
{
return
redisTemplate
.
opsForHash
().
entries
(
key
);
}
public
void
delete
(
String
key
)
{
redisTemplate
.
delete
(
key
);
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/admin/modules/controller/VehicleMonitorController.java
View file @
0667272
...
@@ -65,14 +65,6 @@ public class VehicleMonitorController {
...
@@ -65,14 +65,6 @@ public class VehicleMonitorController {
return
R
.
ok
().
data
(
trackHistoryList
);
return
R
.
ok
().
data
(
trackHistoryList
);
}
}
@ApiOperation
(
value
=
"停留点查询"
)
@SysLog
(
"停留点查询"
)
@GetMapping
(
"/getstaypoint"
)
public
R
getstaypoint
(
MonitorQueryBo
monitorQueryVo
)
{
return
null
;
}
@ApiOperation
(
value
=
"车辆轨迹导出"
)
@ApiOperation
(
value
=
"车辆轨迹导出"
)
@SysLog
(
"车辆轨迹导出"
)
@SysLog
(
"车辆轨迹导出"
)
@GetMapping
(
"/exportcsv"
)
@GetMapping
(
"/exportcsv"
)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment