Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3b7a3ea3
authored
Sep 14, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat,设备日志
parent
7e7df2c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletions
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
server-common/src/main/java/com/makeit/module/iot/vo/analysis/SleepTimeAnalysisVO.java
server-common/src/main/java/com/makeit/module/iot/service/IotProductDeviceService.java
View file @
3b7a3ea3
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.makeit.module.iot.dto.IotQueryParam
;
import
com.makeit.module.iot.dto.IotQueryParam
;
import
com.makeit.module.iot.dto.IotSort
;
import
com.makeit.module.iot.dto.Term
;
import
com.makeit.module.iot.dto.Term
;
import
com.makeit.module.iot.util.HttpRequest
;
import
com.makeit.module.iot.util.HttpRequest
;
import
com.makeit.module.iot.vo.DeviceInstanceEntity
;
import
com.makeit.module.iot.vo.DeviceInstanceEntity
;
...
@@ -193,7 +194,15 @@ public class IotProductDeviceService extends IotCommonService {
...
@@ -193,7 +194,15 @@ public class IotProductDeviceService extends IotCommonService {
return
getDeviceLog
(
deviceId
,
10
,
typeValue
);
return
getDeviceLog
(
deviceId
,
10
,
typeValue
);
}
}
/**
*
* @param deviceId
* @param typeValue
* @param pageSize
* @param startTime
* @param endTime
* @return
*/
public
List
<
DeviceOperationLogEntity
>
getDeviceLogByTimeRange
(
String
deviceId
,
String
typeValue
,
int
pageSize
,
String
startTime
,
String
endTime
)
{
public
List
<
DeviceOperationLogEntity
>
getDeviceLogByTimeRange
(
String
deviceId
,
String
typeValue
,
int
pageSize
,
String
startTime
,
String
endTime
)
{
IotQueryParam
iotQueryParam
=
buildQueryParam
(
pageSize
);
IotQueryParam
iotQueryParam
=
buildQueryParam
(
pageSize
);
List
<
Term
>
terms
=
Lists
.
newArrayList
();
List
<
Term
>
terms
=
Lists
.
newArrayList
();
...
@@ -226,6 +235,14 @@ public class IotProductDeviceService extends IotCommonService {
...
@@ -226,6 +235,14 @@ public class IotProductDeviceService extends IotCommonService {
terms
.
add
(
term1
);
terms
.
add
(
term1
);
terms
.
add
(
term2
);
terms
.
add
(
term2
);
iotQueryParam
.
setTerms
(
terms
);
iotQueryParam
.
setTerms
(
terms
);
List
<
IotSort
>
iotSortList
=
Lists
.
newArrayList
();
IotSort
iotSort
=
new
IotSort
();
iotSort
.
setOrder
(
"asc"
);
iotSort
.
setName
(
"timestamp"
);
iotSortList
.
add
(
iotSort
);
iotQueryParam
.
setSorts
(
iotSortList
);
String
body
=
JsonUtil
.
toJson
(
iotQueryParam
);
String
body
=
JsonUtil
.
toJson
(
iotQueryParam
);
String
url
=
iotUrl
+
DEVICE_PREFIX_URL
+
deviceId
+
"/logs"
;
String
url
=
iotUrl
+
DEVICE_PREFIX_URL
+
deviceId
+
"/logs"
;
HttpRequest
request
=
buildRequest
(
url
,
body
);
HttpRequest
request
=
buildRequest
(
url
,
body
);
...
...
server-common/src/main/java/com/makeit/module/iot/vo/analysis/SleepTimeAnalysisVO.java
0 → 100644
View file @
3b7a3ea3
package
com
.
makeit
.
module
.
iot
.
vo
.
analysis
;
import
lombok.Data
;
@Data
public
class
SleepTimeAnalysisVO
{
private
String
startSleepTime
;
// 入睡时间开始
private
String
endSleepTime
;
// 入睡时间结束
}
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