Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sdk-gloden-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haidian
sdk-gloden-api
Commits
b7a585a0
Commit
b7a585a0
authored
Oct 10, 2024
by
李振振
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增shapshot接口
parent
3902aa05
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
12 deletions
+78
-12
src/main/java/com/beagle/base/bean/vo/SnapshotPutDoubleParam.java
.../java/com/beagle/base/bean/vo/SnapshotPutDoubleParam.java
+11
-0
src/main/java/com/beagle/base/bean/vo/SnapshotPutIntParam.java
...ain/java/com/beagle/base/bean/vo/SnapshotPutIntParam.java
+11
-0
src/main/java/com/beagle/base/common/util/SnapshotUtil.java
src/main/java/com/beagle/base/common/util/SnapshotUtil.java
+24
-4
src/main/java/com/beagle/base/controller/SnapshotController.java
...n/java/com/beagle/base/controller/SnapshotController.java
+14
-0
src/main/java/com/beagle/base/service/SnapshotService.java
src/main/java/com/beagle/base/service/SnapshotService.java
+6
-4
src/main/java/com/beagle/base/service/impl/SnapshotServiceImpl.java
...ava/com/beagle/base/service/impl/SnapshotServiceImpl.java
+12
-4
No files found.
src/main/java/com/beagle/base/bean/vo/SnapshotPutDoubleParam.java
0 → 100644
View file @
b7a585a0
package
com.beagle.base.bean.vo
;
import
com.rtdb.model.DoubleData
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
SnapshotPutDoubleParam
{
private
List
<
DoubleData
>
doubleDataList
;
}
src/main/java/com/beagle/base/bean/vo/SnapshotPutIntParam.java
0 → 100644
View file @
b7a585a0
package
com.beagle.base.bean.vo
;
import
com.rtdb.model.IntData
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
SnapshotPutIntParam
{
private
List
<
IntData
>
intDataList
;
}
src/main/java/com/beagle/base/common/util/SnapshotUtil.java
View file @
b7a585a0
...
@@ -2,11 +2,9 @@ package com.beagle.base.common.util;
...
@@ -2,11 +2,9 @@ package com.beagle.base.common.util;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSON
;
import
com.beagle.base.bean.vo.SnapshotBlobParam
;
import
com.beagle.base.bean.vo.*
;
import
com.beagle.base.bean.vo.SnapshotCoorParam
;
import
com.beagle.base.bean.vo.SnapshotDoubleParam
;
import
com.beagle.base.bean.vo.SnapshotIntParam
;
import
com.rtdb.model.*
;
import
com.rtdb.model.*
;
import
io.swagger.models.auth.In
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -69,4 +67,26 @@ public class SnapshotUtil {
...
@@ -69,4 +67,26 @@ public class SnapshotUtil {
return
res
;
return
res
;
}
}
}
}
public
static
Integer
putIntSnapshots
(
SnapshotPutIntParam
param
)
{
Integer
count
=
0
;
try
{
count
=
CommonUtil
.
getSnapshotImpl
().
putIntSnapshots
(
param
.
getIntDataList
());
return
count
;
}
catch
(
Exception
e
)
{
log
.
error
(
"base 获取putIntSnapshots接口异常,请求参数为:{}"
,
JSON
.
toJSONString
(
param
),
e
);
return
count
;
}
}
public
static
Integer
putDoubleSnapshots
(
SnapshotPutDoubleParam
param
)
{
Integer
count
=
0
;
try
{
count
=
CommonUtil
.
getSnapshotImpl
().
putDoubleSnapshots
(
param
.
getDoubleDataList
());
return
count
;
}
catch
(
Exception
e
)
{
log
.
error
(
"base 获取putDoubleSnapshots接口异常,请求参数为:{}"
,
JSON
.
toJSONString
(
param
),
e
);
return
count
;
}
}
}
}
src/main/java/com/beagle/base/controller/SnapshotController.java
View file @
b7a585a0
...
@@ -11,6 +11,7 @@ import com.rtdb.model.IntData;
...
@@ -11,6 +11,7 @@ import com.rtdb.model.IntData;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.models.auth.In
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -57,4 +58,17 @@ public class SnapshotController {
...
@@ -57,4 +58,17 @@ public class SnapshotController {
return
new
Response
<>(
snapshotService
.
getCoorSnapshots
(
param
));
return
new
Response
<>(
snapshotService
.
getCoorSnapshots
(
param
));
}
}
@ApiOperationSupport
(
order
=
5
)
@ApiOperation
(
value
=
"批量写入开关量、模拟量快照数值"
)
@PostMapping
(
"/putIntSnapshots"
)
public
Response
<
Integer
>
putIntSnapshots
(
@RequestBody
@ApiParam
(
value
=
"入参"
)
@Validated
SnapshotPutIntParam
param
)
{
return
new
Response
<>(
snapshotService
.
putIntSnapshots
(
param
));
}
@ApiOperationSupport
(
order
=
6
)
@ApiOperation
(
value
=
"批量插入标签点类型为双精度浮点型的快照值"
)
@PostMapping
(
"/putDoubleSnapshots"
)
public
Response
<
Integer
>
putDoubleSnapshots
(
@RequestBody
@ApiParam
(
value
=
"入参"
)
@Validated
SnapshotPutDoubleParam
param
)
{
return
new
Response
<>(
snapshotService
.
putDoubleSnapshots
(
param
));
}
}
}
src/main/java/com/beagle/base/service/SnapshotService.java
View file @
b7a585a0
package
com.beagle.base.service
;
package
com.beagle.base.service
;
import
com.beagle.base.bean.vo.SnapshotBlobParam
;
import
com.beagle.base.bean.vo.*
;
import
com.beagle.base.bean.vo.SnapshotCoorParam
;
import
com.beagle.base.bean.vo.SnapshotDoubleParam
;
import
com.beagle.base.bean.vo.SnapshotIntParam
;
import
com.rtdb.model.BlobData
;
import
com.rtdb.model.BlobData
;
import
com.rtdb.model.CoorData
;
import
com.rtdb.model.CoorData
;
import
com.rtdb.model.DoubleData
;
import
com.rtdb.model.DoubleData
;
...
@@ -23,4 +20,9 @@ public interface SnapshotService {
...
@@ -23,4 +20,9 @@ public interface SnapshotService {
List
<
BlobData
>
getBlobSnapshots
(
SnapshotBlobParam
param
);
List
<
BlobData
>
getBlobSnapshots
(
SnapshotBlobParam
param
);
List
<
CoorData
>
getCoorSnapshots
(
SnapshotCoorParam
param
);
List
<
CoorData
>
getCoorSnapshots
(
SnapshotCoorParam
param
);
Integer
putIntSnapshots
(
SnapshotPutIntParam
param
);
Integer
putDoubleSnapshots
(
SnapshotPutDoubleParam
param
);
}
}
src/main/java/com/beagle/base/service/impl/SnapshotServiceImpl.java
View file @
b7a585a0
package
com.beagle.base.service.impl
;
package
com.beagle.base.service.impl
;
import
com.beagle.base.bean.vo.SnapshotBlobParam
;
import
com.beagle.base.bean.vo.*
;
import
com.beagle.base.bean.vo.SnapshotCoorParam
;
import
com.beagle.base.bean.vo.SnapshotDoubleParam
;
import
com.beagle.base.bean.vo.SnapshotIntParam
;
import
com.beagle.base.common.util.SnapshotUtil
;
import
com.beagle.base.common.util.SnapshotUtil
;
import
com.beagle.base.service.SnapshotService
;
import
com.beagle.base.service.SnapshotService
;
import
com.rtdb.model.BlobData
;
import
com.rtdb.model.BlobData
;
...
@@ -41,6 +38,17 @@ public class SnapshotServiceImpl implements SnapshotService {
...
@@ -41,6 +38,17 @@ public class SnapshotServiceImpl implements SnapshotService {
@Override
@Override
public
List
<
CoorData
>
getCoorSnapshots
(
SnapshotCoorParam
param
)
{
public
List
<
CoorData
>
getCoorSnapshots
(
SnapshotCoorParam
param
)
{
return
SnapshotUtil
.
getCoorSnapshots
(
param
);
return
SnapshotUtil
.
getCoorSnapshots
(
param
);
}
@Override
public
Integer
putIntSnapshots
(
SnapshotPutIntParam
param
)
{
return
SnapshotUtil
.
putIntSnapshots
(
param
);
}
@Override
public
Integer
putDoubleSnapshots
(
SnapshotPutDoubleParam
param
)
{
return
SnapshotUtil
.
putDoubleSnapshots
(
param
);
}
}
}
}
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