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
85ca9ccc
Commit
85ca9ccc
authored
Jun 22, 2020
by
xieshixiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回参数校对
parent
0ae1e2ec
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
60 additions
and
34 deletions
+60
-34
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
+6
-5
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/ToolController.java
+2
-2
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/IBindService.java
+2
-1
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
+2
-1
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/BindCache.java
+2
-1
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/mapper/BindInfoMapper.java
+3
-2
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/request/UnBindReq.java
+1
-1
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/BaseEncryptRes.java
+3
-1
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/BindInfoQueryRes.java
+35
-0
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/ResultList.java
+2
-1
infra/src/main/resources/mapper/BindInfoMapper.xml
+2
-19
No files found.
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
View file @
85ca9ccc
...
...
@@ -10,6 +10,8 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoQueryReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.UnBindReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoQueryRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.ResultList
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -34,7 +36,7 @@ public class BindInfoControlller extends BaseController {
@Autowired
IBindService
service
;
@Autowired
DefaultConverter
defaultConverter
;
DefaultConverter
defaultConverter
;
/**
...
...
@@ -48,8 +50,7 @@ public class BindInfoControlller extends BaseController {
@PostMapping
(
"bind"
)
@BodyDecryptAnnotation
@ResponseEncryptAnnotation
public
Response
<
String
>
bindInfo
(
@RequestBody
@Validated
BindInfoReq
req
)
{
public
Response
<
BindInfoRes
>
bindInfo
(
@RequestBody
@Validated
BindInfoReq
req
)
{
ParkBindInfo
bindInfo
=
new
ParkBindInfo
();
defaultConverter
.
getMapperFacade
().
map
(
req
,
bindInfo
);
return
service
.
bind
(
bindInfo
);
...
...
@@ -81,8 +82,8 @@ public class BindInfoControlller extends BaseController {
@PostMapping
(
"query"
)
@BodyDecryptAnnotation
@ResponseEncryptAnnotation
public
Response
<
ResultList
<
ParkBindInfo
>>
bindInfoQery
(
@RequestBody
@Validated
BindInfoQueryReq
query
)
{
return
ResponseGenerator
.
success
(
new
ResultList
<
ParkBindInfo
>(
service
.
selectByQuery
(
query
)));
public
Response
<
ResultList
<
BindInfoQueryRes
>>
bindInfoQery
(
@RequestBody
@Validated
BindInfoQueryReq
query
)
{
return
ResponseGenerator
.
success
(
new
ResultList
<
BindInfoQueryRes
>(
service
.
selectByQuery
(
query
)));
}
}
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/ToolController.java
View file @
85ca9ccc
...
...
@@ -30,7 +30,7 @@ public class ToolController {
* @return
*/
@GetMapping
(
value
=
"encrypt"
)
public
String
encrypt
(
String
plain
)
{
public
String
encrypt
(
String
plain
)
{
return
EncryptStringAes
.
encryptAes
(
plain
,
signKeyConfigBean
.
getKey
());
}
...
...
@@ -41,7 +41,7 @@ public class ToolController {
* @return
*/
@GetMapping
(
value
=
"decrypt"
)
public
String
decrypt
(
String
cipher
)
{
public
String
decrypt
(
String
cipher
)
{
return
EncryptStringAes
.
decryptAes
(
cipher
,
signKeyConfigBean
.
getKey
());
}
...
...
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/IBindService.java
View file @
85ca9ccc
...
...
@@ -6,6 +6,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoQueryReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.H5BindInfoQuery
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.UnBindReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoQueryRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.DrivingLicenseInfoRes
;
import
java.util.List
;
...
...
@@ -41,7 +42,7 @@ public interface IBindService extends IService<ParkBindInfo> {
* @param query
* @return
*/
List
<
ParkBindInfo
>
selectByQuery
(
BindInfoQueryReq
query
);
List
<
BindInfoQueryRes
>
selectByQuery
(
BindInfoQueryReq
query
);
/**
* 年检信息查询接口
...
...
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/BindServiceImpl.java
View file @
85ca9ccc
...
...
@@ -28,6 +28,7 @@ import com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkVerifyInfo;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.BindInfoQueryReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.H5BindInfoQuery
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.UnBindReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoQueryRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.DrivingLicenseInfoRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.InsuranceInfoRes
;
...
...
@@ -148,7 +149,7 @@ public class BindServiceImpl extends ServiceImpl<BindInfoMapper, ParkBindInfo> i
* @return
*/
@Override
public
List
<
ParkBindInfo
>
selectByQuery
(
BindInfoQueryReq
query
)
{
public
List
<
BindInfoQueryRes
>
selectByQuery
(
BindInfoQueryReq
query
)
{
return
bindCache
.
selectByQuery
(
query
.
getUserId
());
}
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/cache/BindCache.java
View file @
85ca9ccc
...
...
@@ -4,6 +4,7 @@ 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
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoQueryRes
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.cache.annotation.Caching
;
...
...
@@ -42,7 +43,7 @@ public class BindCache {
* @return
*/
@Cacheable
(
value
=
"bindinfo"
,
key
=
"'userId:'+#userId"
,
unless
=
"#result==null or #result.size()==0"
)
public
List
<
ParkBindInfo
>
selectByQuery
(
String
userId
)
{
public
List
<
BindInfoQueryRes
>
selectByQuery
(
String
userId
)
{
return
mapper
.
selectByQuery
(
userId
);
}
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/data/mapper/BindInfoMapper.java
View file @
85ca9ccc
...
...
@@ -2,6 +2,7 @@ package com.hikcreate.edl.pub.web.mobile.infra.data.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoQueryRes
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
...
...
@@ -15,10 +16,10 @@ import java.util.List;
**/
public
interface
BindInfoMapper
extends
BaseMapper
<
ParkBindInfo
>
{
List
<
ParkBindInfo
>
selectByQuery
(
String
userId
);
List
<
BindInfoQueryRes
>
selectByQuery
(
String
userId
);
Integer
bindInfoInsert
(
ParkBindInfo
info
);
Integer
unbind
(
ParkBindInfo
info
);
Integer
unbind
(
ParkBindInfo
info
);
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/request/UnBindReq.java
View file @
85ca9ccc
...
...
@@ -27,5 +27,5 @@ public class UnBindReq {
* 时间戳
*/
@NotNull
(
message
=
"时间戳不能为空"
)
private
long
timestamp
;
private
long
timestamp
;
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/BaseEncryptRes.java
View file @
85ca9ccc
...
...
@@ -2,6 +2,8 @@ package com.hikcreate.edl.pub.web.mobile.infra.model.param.response;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 公共加密返回消息类
* @author lixian
...
...
@@ -9,7 +11,7 @@ import lombok.Data;
* @date 2020/6/19 10:44
**/
@Data
public
class
BaseEncryptRes
{
public
class
BaseEncryptRes
implements
Serializable
{
/**
* 加密字段
*/
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/BindInfoQueryRes.java
0 → 100644
View file @
85ca9ccc
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
model
.
param
.
response
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 绑定信息查询接口返回结果封装
*
* @author: xieshixiang
* @time:2020/6/22 19:52
**/
@Data
public
class
BindInfoQueryRes
implements
Serializable
{
/**
* 绑定信息唯一标识,使用UUID
*/
private
String
unqId
;
/**
* 车牌颜色:A:白,B:灰,C:黄,D:粉,E:红,
* F:紫,G:绿,H:蓝,I:棕,J:黑',
*/
private
String
plateColor
;
/**
* 车牌号
*/
private
String
plateNum
;
/**
* 绑定时间
*/
private
String
gmtBindTime
;
}
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/model/param/response/ResultList.java
View file @
85ca9ccc
...
...
@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.util.List
;
/**
...
...
@@ -15,7 +16,7 @@ import java.util.List;
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
ResultList
<
T
>
{
public
class
ResultList
<
T
>
implements
Serializable
{
List
<
T
>
list
;
...
...
infra/src/main/resources/mapper/BindInfoMapper.xml
View file @
85ca9ccc
...
...
@@ -9,25 +9,8 @@
<select
id=
"selectByQuery"
parameterType=
"java.lang.String"
resultType=
"com.hikcreate.edl.pub.web.mobile.infra.model.entity.ParkBindInfo"
>
select b.unq_id, b.user_id, b.phone,
case plate_color
when 'A' then '白'
when 'B' then '灰'
when 'C' then '黄'
when 'D' then '粉'
when 'E' then '红'
when 'F' then '紫'
when 'G' then '绿'
when 'H' then '蓝'
when 'I' then '棕'
when 'J' then '黑'
end plateColor,
case status
when '0' then '未绑定'
when '1' then '已绑定'
end status,
b.plate_num,b.plate_type,b.gmt_bind_time
resultType=
"com.hikcreate.edl.pub.web.mobile.infra.model.param.response.BindInfoQueryRes"
>
select b.unq_id,b.plate_color,b.plate_num,b.gmt_bind_time
from park_bind_info as b
where b.status='1'
<if
test=
"userId!=null and userId!=''"
>
...
...
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