Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-radaraccess-server
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 06344763
authored
Jan 29, 2024
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加警情雷达保存接口
1 parent
e13c3e49
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
9 deletions
platform-radaraccess/src/main/java/cn/com/glsx/radaraccess/modules/controller/RadarController.java
platform-radaraccess/src/main/java/cn/com/glsx/radaraccess/modules/model/RadarBO.java
platform-radaraccess/src/main/java/cn/com/glsx/radaraccess/modules/service/RadarService.java
platform-radaraccess/src/main/java/cn/com/glsx/radaraccess/modules/service/UserDemoService.java
platform-radaraccess/src/main/java/cn/com/glsx/radaraccess/modules/controller/RadarController.java
0 → 100644
View file @
0634476
package
cn
.
com
.
glsx
.
radaraccess
.
modules
.
controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.glsx.plat.core.annotation.ResponseResultBody
;
import
cn.com.glsx.radaraccess.modules.BaseController
;
import
cn.com.glsx.radaraccess.modules.model.RadarBO
;
import
cn.com.glsx.radaraccess.modules.service.RadarService
;
import
cn.hutool.json.JSONUtil
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.extern.slf4j.Slf4j
;
/**
* 单体应用Controller处理统一返回体
*
* @author payu
*/
@Slf4j
@Tag
(
name
=
"雷达处理接口"
)
@RestController
@RequestMapping
(
value
=
"/radar"
)
@ResponseResultBody
public
class
RadarController
extends
BaseController
{
@Autowired
private
RadarService
radarService
;
@Operation
(
summary
=
"保存雷达探测系列数据"
,
description
=
"保存雷达探测系列数据"
)
@PostMapping
(
"/saveRadar"
)
public
Integer
saveRadar
(
RadarBO
radarBO
)
{
log
.
info
(
"radarBO==="
+
JSONUtil
.
toJsonStr
(
radarBO
));
Integer
num
=
radarService
.
saveRadar
(
radarBO
);
return
num
;
}
}
platform-radaraccess/src/main/java/cn/com/glsx/radaraccess/modules/model/RadarBO.java
0 → 100644
View file @
0634476
package
cn
.
com
.
glsx
.
radaraccess
.
modules
.
model
;
import
lombok.Data
;
/**
* 雷达接收参数
*/
@Data
public
class
RadarBO
{
/**
* 静止驻留状态 0无静止驻留 1有静止驻留
*/
private
Integer
jzzlsta
;
/**
* 静止驻留时长
*/
private
Integer
zltime
;
/**
* 人体存在状态 1 驻留 0无驻留
*/
private
Integer
zlsta
;
}
\ No newline at end of file
platform-radaraccess/src/main/java/cn/com/glsx/radaraccess/modules/service/RadarService.java
0 → 100644
View file @
0634476
package
cn
.
com
.
glsx
.
radaraccess
.
modules
.
service
;
import
org.springframework.stereotype.Service
;
import
cn.com.glsx.radaraccess.modules.model.RadarBO
;
/**
* 雷达接入 service
*/
@Service
public
class
RadarService
{
public
Integer
saveRadar
(
RadarBO
radarBO
)
{
return
0
;
}
}
\ No newline at end of file
platform-radaraccess/src/main/java/cn/com/glsx/radaraccess/modules/service/UserDemoService.java
View file @
0634476
...
...
@@ -70,13 +70,14 @@ public class UserDemoService {
// uuid获取随机字符串,作为盐值。
String
salt
=
StringUtils
.
generateRandomCode
(
false
,
4
);
//add Salt to password
//user.getCredentialsSalt
//SimpleHash hash = new SimpleHash(hcm.getHashAlgorithmName(), password, salt, hcm.getHashIterations());
//重新赋值
// add Salt to password
// user.getCredentialsSalt
// SimpleHash hash = new SimpleHash(hcm.getHashAlgorithmName(), password, salt,
// hcm.getHashIterations());
// 重新赋值
user
.
setSalt
(
salt
);
user
.
setPassword
(
password
);
//user.setEnableStatus(SysConstants.EnableStatus.enable.getCode());
//
user.setEnableStatus(SysConstants.EnableStatus.enable.getCode());
user
.
setCreatedDate
(
new
Date
());
userMapper
.
insertUseGeneratedKeys
(
user
);
...
...
@@ -86,14 +87,14 @@ public class UserDemoService {
public
int
editUser
(
User
user
)
{
String
password
=
user
.
getPassword
();
//todo 更新入库
//
todo 更新入库
return
0
;
}
public
String
createToken
(
User
user
)
{
Assert
.
notNull
(
user
,
"获取当前用户信息失败"
);
String
uuid
=
cn
.
hutool
.
core
.
lang
.
UUID
.
randomUUID
().
toString
(
true
);
//JWT 随机ID,做为验证的key
String
uuid
=
cn
.
hutool
.
core
.
lang
.
UUID
.
randomUUID
().
toString
(
true
);
//
JWT 随机ID,做为验证的key
String
jwtId
=
jwtUtils
.
getApplication
()
+
":"
+
jwtUtils
.
JWT_SESSION_PREFIX
+
uuid
+
"_"
+
user
.
getAccount
();
ComJwtUser
jwtUser
=
new
ComJwtUser
();
...
...
@@ -116,7 +117,7 @@ public class UserDemoService {
throw
ResultException
.
create
(
SystemMessage
.
ILLEGAL_ACCESS
.
getCode
(),
"登录已失效"
);
}
//解析token,反转成JwtUser对象
//
解析token,反转成JwtUser对象
Map
<
String
,
Object
>
userMap
=
jwtUtils
.
parseClaim
(
token
);
ComJwtUser
jwtUser
=
null
;
try
{
...
...
@@ -129,5 +130,4 @@ public class UserDemoService {
user
.
setPhone
(
jwtUser
.
getAccount
());
return
user
;
}
}
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