Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beijing-vehicleflow
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangzhenbang
beijing-vehicleflow
Commits
6735a928
Commit
6735a928
authored
Feb 24, 2020
by
zhangzhenbang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
试探性写了一两个接口
parent
0057d3d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
FloatingPopulationController.java
...gvehicleflow/controller/FloatingPopulationController.java
+27
-1
No files found.
src/main/java/com/yingxin/beijingvehicleflow/controller/FloatingPopulationController.java
View file @
6735a928
package
com
.
yingxin
.
beijingvehicleflow
.
controller
;
package
com
.
yingxin
.
beijingvehicleflow
.
controller
;
import
com.yingxin.beijingvehicleflow.constant.Const
;
import
com.yingxin.beijingvehicleflow.entity.FloatingPopulation
;
import
com.yingxin.beijingvehicleflow.entity.FloatingPopulation
;
import
com.yingxin.beijingvehicleflow.entity.IdentityInformation
;
import
com.yingxin.beijingvehicleflow.response.Response
;
import
com.yingxin.beijingvehicleflow.response.Response
;
import
com.yingxin.beijingvehicleflow.service.FloatingPopulationServcie
;
import
com.yingxin.beijingvehicleflow.service.FloatingPopulationServcie
;
import
com.yingxin.beijingvehicleflow.util.DesUtil
;
import
net.sf.json.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -22,11 +28,31 @@ import java.util.Date;
...
@@ -22,11 +28,31 @@ import java.util.Date;
@RequestMapping
(
"/api/v1"
)
@RequestMapping
(
"/api/v1"
)
public
class
FloatingPopulationController
{
public
class
FloatingPopulationController
{
private
static
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
FloatingPopulationController
.
class
);
@Autowired
@Autowired
private
FloatingPopulationServcie
populationServcie
;
private
FloatingPopulationServcie
populationServcie
;
@PostMapping
(
"/float-population"
)
@PostMapping
(
"/float-population"
)
public
Response
checkFloatingPopulation
(
@RequestBody
FloatingPopulation
floatingPopulation
)
{
public
Response
checkFloatingPopulation
(
@RequestBody
String
json
)
{
IdentityInformation
info
;
JSONObject
datafterDecryptJson
;
try
{
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
json
);
String
encodedData
=
jsonObject
.
getString
(
"encodedData"
);
String
datafterDecryptStr
=
DesUtil
.
decrypt
(
Const
.
KEY
,
encodedData
);
datafterDecryptJson
=
JSONObject
.
fromObject
(
datafterDecryptStr
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"json解析异常"
,
e
);
return
Response
.
fail
();
}
FloatingPopulation
floatingPopulation
=
new
FloatingPopulation
();
floatingPopulation
.
setAuthTime
(
datafterDecryptJson
.
getString
(
"authTime"
));
floatingPopulation
.
setAuthCoordinate
(
datafterDecryptJson
.
getString
(
"authCoordinate"
));
floatingPopulation
.
setReservationId
(
datafterDecryptJson
.
getInt
(
"id"
));
if
(!
populationServcie
.
isIdentityInfoValid
(
floatingPopulation
))
{
if
(!
populationServcie
.
isIdentityInfoValid
(
floatingPopulation
))
{
return
Response
.
fail
(
"INVALID-CODE"
,
"二维码已过期,请重新生成二维码。"
);
return
Response
.
fail
(
"INVALID-CODE"
,
"二维码已过期,请重新生成二维码。"
);
...
...
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