Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
extend
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
park
extend
Commits
20a0ec64
Commit
20a0ec64
authored
Jun 23, 2020
by
xieshixiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改时间类型
parent
7bbab3c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
+1
-1
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/BindCache.java
+14
-11
No files found.
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
View file @
20a0ec64
...
...
@@ -112,7 +112,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
info
.
setUnqId
(
unqIdUtil
.
getUnqId
());
info
.
setGmtBindTime
(
DateTime
.
now
().
toString
());
info
.
setGmtBindTime
(
new
Date
().
toString
());
mapper
.
insert
(
info
);
return
ResponseGenerator
.
success
(
new
BindInfoRes
(
info
.
getUnqId
()));
}
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/BindCache.java
View file @
20a0ec64
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
data
.
cache
;
import
cn.hutool.core.date.DateTime
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.mapper.BindInfoMapper
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo
;
...
...
@@ -11,6 +10,7 @@ import org.springframework.cache.annotation.Caching;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -26,11 +26,12 @@ public class BindCache {
/**
* 获取绑定信息
*
* @param unqId
* @return
*/
@Cacheable
(
value
=
"bindinfo"
,
key
=
"'id:'+#unqId"
,
unless
=
"#result==null"
)
public
ParkBindInfo
getById
(
String
unqId
)
{
@Cacheable
(
value
=
"bindinfo"
,
key
=
"'id:'+#unqId"
,
unless
=
"#result==null"
)
public
ParkBindInfo
getById
(
String
unqId
)
{
LambdaQueryWrapper
<
ParkBindInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
ParkBindInfo:
:
getUnqId
,
unqId
);
queryWrapper
.
eq
(
ParkBindInfo:
:
getStatus
,
1
);
...
...
@@ -39,30 +40,32 @@ public class BindCache {
/**
* 查询用户绑定信息
* @param userId 第三方用户ID
*
* @param userId 第三方用户ID
* @return
*/
@Cacheable
(
value
=
"bindinfo"
,
key
=
"'userId:'+#userId"
,
unless
=
"#result==null or #result.size()==0"
)
@Cacheable
(
value
=
"bindinfo"
,
key
=
"'userId:'+#userId"
,
unless
=
"#result==null or #result.size()==0"
)
public
List
<
BindInfoQueryRes
>
selectByQuery
(
String
userId
)
{
return
mapper
.
selectByQuery
(
userId
);
}
/**
* 解绑
* @param unqId 绑定唯一标识
*
* @param unqId 绑定唯一标识
* @param userId 第三方用户ID
* @return
*/
@Caching
(
evict
=
{
@CacheEvict
(
value
=
"bindinfo"
,
key
=
"'id:'+#unqId"
,
condition
=
"#unqId!=null"
),
@CacheEvict
(
value
=
"bindinfo"
,
key
=
"'userId:'+#userId"
,
condition
=
"#userId!=null"
)
@CacheEvict
(
value
=
"bindinfo"
,
key
=
"'id:'+#unqId"
,
condition
=
"#unqId!=null"
),
@CacheEvict
(
value
=
"bindinfo"
,
key
=
"'userId:'+#userId"
,
condition
=
"#userId!=null"
)
})
public
boolean
unBind
(
String
unqId
,
String
userId
){
public
boolean
unBind
(
String
unqId
,
String
userId
)
{
ParkBindInfo
bindInfo
=
new
ParkBindInfo
();
bindInfo
.
setUnqId
(
unqId
);
bindInfo
.
setStatus
(
"0"
);
bindInfo
.
setUnbindTime
(
DateTime
.
now
().
toString
());
return
mapper
.
unbind
(
bindInfo
)
>
0
;
bindInfo
.
setUnbindTime
(
new
Date
().
toString
());
return
mapper
.
unbind
(
bindInfo
)
>
0
;
}
}
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