Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
deviceCheat
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
luozhenzhen
deviceCheat
Commits
edb6c827
Commit
edb6c827
authored
Sep 03, 2019
by
luozhenzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增数据业务上传接口
parent
a3f29f4f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
6 deletions
+26
-6
pom.xml
pom.xml
+1
-1
BusinData.java
src/main/java/com/demo/entity/po/BusinData.java
+10
-3
DevicecheatController.java
src/main/java/com/demo/mongodb/DevicecheatController.java
+13
-1
application-dev.properties
src/main/resources/application-dev.properties
+2
-1
keystore.p12
src/main/resources/keystore.p12
+0
-0
No files found.
pom.xml
View file @
edb6c827
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com
</groupId>
<artifactId>
mongodb
</artifactId>
<artifactId>
deviceCheat
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<parent>
...
...
src/main/java/com/demo/entity/po/BusinData.java
View file @
edb6c827
...
...
@@ -5,13 +5,20 @@ import org.springframework.data.mongodb.core.mapping.Document;
@Document
(
collection
=
"BusinData"
)
public
class
BusinData
{
private
String
S
tBusinData
;
private
String
s
tBusinData
;
public
String
getStBusinData
()
{
return
S
tBusinData
;
return
s
tBusinData
;
}
public
void
setStBusinData
(
String
stBusinData
)
{
StBusinData
=
stBusinData
;
stBusinData
=
stBusinData
;
}
@Override
public
String
toString
()
{
return
"BusinData{"
+
"stBusinData='"
+
stBusinData
+
'\''
+
'}'
;
}
}
src/main/java/com/demo/mongodb/DevicecheatController.java
View file @
edb6c827
package
com
.
demo
.
mongodb
;
import
com.alibaba.fastjson.JSONObject
;
import
com.demo.constant.ResultStatus
;
import
com.demo.entity.po.BusinData
;
import
com.demo.entity.po.ExceptionRecord
;
...
...
@@ -9,8 +10,11 @@ import com.demo.entity.vo.SensorVo;
import
com.demo.service.DeviceService
;
import
com.demo.util.FileEncryptor
;
import
com.demo.util.ResultObject
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -23,6 +27,8 @@ import java.util.Map;
@RequestMapping
(
"/"
)
public
class
DevicecheatController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
DevicecheatController
.
class
);
@Autowired
private
MongoTemplate
mongoTemplate
;
@Autowired
...
...
@@ -142,11 +148,17 @@ public class DevicecheatController {
*/
@RequestMapping
(
value
=
"/businData"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ResultObject
businData
(
BusinData
data
)
throws
Exception
{
public
ResultObject
businData
(
@RequestBody
BusinData
data
)
throws
Exception
{
logger
.
info
(
"/businData : {}"
,
data
.
toString
());
if
(
data
==
null
||
StringUtils
.
isEmpty
(
data
.
getStBusinData
())){
return
new
ResultObject
(
ResultStatus
.
FAIL
);
}
deviceService
.
insertBusinData
(
data
);
return
new
ResultObject
(
ResultStatus
.
SUCCESS
);
}
}
src/main/resources/application-dev.properties
View file @
edb6c827
...
...
@@ -2,7 +2,7 @@ server.port=8081
spring.data.mongodb.host
=
192.168.168.81
spring.data.mongodb.port
=
8763
spring.data.mongodb.database
=
device
server.ssl.key-store
=
classpath:keystore.p12
_win
server.ssl.key-store
=
classpath:keystore.p12
server.ssl.key-store-password
=
123456
server.ssl.key-store-type
=
PKCS12
server.ssl.key-alias
=
tomcat
\ No newline at end of file
src/main/resources/keystore.p12
View file @
edb6c827
No preview for this file type
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