Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
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
zengtianlai3
ioc_sixiang_license
Commits
3268b285
Commit
3268b285
authored
Jun 14, 2022
by
zengtianlai3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善响应接口
parent
3e628fa5
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
124 additions
and
36 deletions
+124
-36
ApplyController.java
.../java/iot/sixiang/license/controller/ApplyController.java
+1
-1
DeviceController.java
...java/iot/sixiang/license/controller/DeviceController.java
+2
-2
LoginController.java
.../java/iot/sixiang/license/controller/LoginController.java
+5
-5
OperateController.java
...ava/iot/sixiang/license/controller/OperateController.java
+12
-9
SysOperLogController.java
.../iot/sixiang/license/controller/SysOperLogController.java
+1
-1
UserController.java
...n/java/iot/sixiang/license/controller/UserController.java
+5
-5
PageResult.java
...e/src/main/java/iot/sixiang/license/model/PageResult.java
+3
-3
ResResult.java
...se/src/main/java/iot/sixiang/license/model/ResResult.java
+3
-3
AlarmVo.java
...e/src/main/java/iot/sixiang/license/model/vo/AlarmVo.java
+4
-0
AppVo.java
...nse/src/main/java/iot/sixiang/license/model/vo/AppVo.java
+6
-0
DeviceDetailVo.java
...ain/java/iot/sixiang/license/model/vo/DeviceDetailVo.java
+10
-5
DeviceVo.java
.../src/main/java/iot/sixiang/license/model/vo/DeviceVo.java
+5
-0
LoginVo.java
...e/src/main/java/iot/sixiang/license/model/vo/LoginVo.java
+14
-0
QpsVo.java
...nse/src/main/java/iot/sixiang/license/model/vo/QpsVo.java
+19
-0
ResourceVo.java
...rc/main/java/iot/sixiang/license/model/vo/ResourceVo.java
+7
-0
SamVo.java
...nse/src/main/java/iot/sixiang/license/model/vo/SamVo.java
+17
-0
ServerStatusVo.java
...ain/java/iot/sixiang/license/model/vo/ServerStatusVo.java
+7
-2
UserVo.java
...se/src/main/java/iot/sixiang/license/model/vo/UserVo.java
+3
-0
No files found.
license/src/main/java/iot/sixiang/license/controller/ApplyController.java
View file @
3268b285
...
...
@@ -76,7 +76,7 @@ public class ApplyController {
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"appName"
,
value
=
"应用名"
)
})
public
PageResult
getUserList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
public
PageResult
<
AppVo
>
getUserList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
@RequestParam
(
value
=
"appName"
,
required
=
false
)
String
appName
)
{
PageInfoModel
<
AppVo
>
records
=
applyService
.
getAppList
(
pageNo
,
pageSize
,
appName
);
...
...
license/src/main/java/iot/sixiang/license/controller/DeviceController.java
View file @
3268b285
...
...
@@ -78,7 +78,7 @@ public class DeviceController {
@ApiImplicitParam
(
name
=
"appName"
,
value
=
"应用名"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
)
})
public
PageResult
getDeviceList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
public
PageResult
<
DeviceVo
>
getDeviceList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
@RequestParam
(
value
=
"appName"
,
required
=
false
)
String
appName
,
@RequestParam
(
value
=
"userName"
,
required
=
false
)
String
userName
)
{
...
...
@@ -102,7 +102,7 @@ public class DeviceController {
@ApiImplicitParam
(
name
=
"appName"
,
value
=
"应用名"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
)
})
public
PageResult
getDeviceDetailList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
public
PageResult
<
DeviceDetailVo
>
getDeviceDetailList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
@RequestParam
(
value
=
"appName"
,
required
=
false
)
String
appName
,
@RequestParam
(
value
=
"userName"
,
required
=
false
)
String
userName
)
{
...
...
license/src/main/java/iot/sixiang/license/controller/LoginController.java
View file @
3268b285
...
...
@@ -10,6 +10,7 @@ import iot.sixiang.license.log.BusinessType;
import
iot.sixiang.license.log.MyLog
;
import
iot.sixiang.license.model.BaseResult
;
import
iot.sixiang.license.model.ResResult
;
import
iot.sixiang.license.model.vo.LoginVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -46,16 +47,15 @@ public class LoginController {
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"password"
,
value
=
"密码"
,
required
=
true
)
})
public
ResResult
login
(
@RequestParam
(
"userName"
)
String
userName
,
@RequestParam
(
"password"
)
String
password
)
{
public
ResResult
<
LoginVo
>
login
(
@RequestParam
(
"userName"
)
String
userName
,
@RequestParam
(
"password"
)
String
password
)
{
for
(
LoginUser
dbUser
:
userMap
.
values
())
{
if
(
dbUser
.
getUserName
().
equals
(
userName
)
&&
dbUser
.
getPassword
().
equals
(
password
))
{
log
.
info
(
"登录成功!生成token!"
);
String
token
=
JwtUtil
.
createToken
(
dbUser
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"authorization"
,
token
);
return
ResResult
.
success
().
record
(
map
);
LoginVo
loginVo
=
new
LoginVo
();
loginVo
.
setAuthorization
(
token
);
return
ResResult
.
success
().
record
(
loginVo
);
}
}
return
ResResult
.
fail
().
msg
(
"用户名或密码错误"
);
...
...
license/src/main/java/iot/sixiang/license/controller/OperateController.java
View file @
3268b285
...
...
@@ -17,6 +17,8 @@ import iot.sixiang.license.model.BaseResult;
import
iot.sixiang.license.model.ResResult
;
import
iot.sixiang.license.model.SamMonitor
;
import
iot.sixiang.license.model.vo.AlarmVo
;
import
iot.sixiang.license.model.vo.QpsVo
;
import
iot.sixiang.license.model.vo.SamVo
;
import
iot.sixiang.license.model.vo.ServerStatusVo
;
import
iot.sixiang.license.operate.OperateManager
;
import
iot.sixiang.license.service.AlarmReadService
;
...
...
@@ -53,7 +55,7 @@ public class OperateController {
@ApiOperation
(
value
=
"服务接口"
,
notes
=
"用于获取服务列表"
)
@GetMapping
(
"monitor/server"
)
@MyLog
(
title
=
"获取服务列表"
,
businessType
=
BusinessType
.
SELECT
)
public
ResResult
getDeviceTypes
()
{
public
ResResult
<
SamMonitor
>
getDeviceTypes
()
{
List
<
SamMonitor
>
records
=
operateManager
.
getSamMonitorList
();
return
ResResult
.
success
().
record
(
records
);
...
...
@@ -70,7 +72,7 @@ public class OperateController {
@GetMapping
(
"monitor/qps"
)
@MyLog
(
title
=
"获取并发量"
,
optParam
=
"#{type}"
,
businessType
=
BusinessType
.
SELECT
)
@ApiImplicitParam
(
name
=
"type"
,
value
=
"类型:0:今天 1:昨天 2:七天前 3:三十天前"
,
required
=
true
,
dataType
=
"int"
)
public
ResResult
getQps
(
@RequestParam
(
"type"
)
int
type
)
{
public
ResResult
<
QpsVo
>
getQps
(
@RequestParam
(
"type"
)
int
type
)
{
HashMap
<
String
,
List
<
Integer
>>
monitorList
=
monitorService
.
getMonitorList
(
type
);
return
ResResult
.
success
().
record
(
monitorList
);
}
...
...
@@ -79,7 +81,7 @@ public class OperateController {
@GetMapping
(
"diagnosis/server"
)
@MyLog
(
title
=
"获取服务诊断信息"
,
businessType
=
BusinessType
.
SELECT
)
@ApiImplicitParam
()
public
ResResult
getDiagnosisInfo
()
{
public
ResResult
<
ServerStatusVo
>
getDiagnosisInfo
()
{
ServerStatusVo
serverStatus
=
forwardManager
.
getServerStatus
();
return
ResResult
.
success
().
record
(
serverStatus
);
}
...
...
@@ -88,7 +90,7 @@ public class OperateController {
@ApiOperation
(
value
=
"获取告警列表接口"
,
notes
=
"用于获取告警列表"
)
@GetMapping
(
"alarm/list"
)
@MyLog
(
title
=
"获取告警列表"
,
businessType
=
BusinessType
.
SELECT
)
public
ResResult
getAlarmList
()
{
public
ResResult
<
List
<
AlarmVo
>>
getAlarmList
()
{
String
userId
=
UserUtils
.
getLoginUserId
();
int
Id
=
Integer
.
valueOf
(
userId
);
List
<
AlarmVo
>
alarmList
=
alarmService
.
getAlarmList
(
Id
);
...
...
@@ -112,7 +114,7 @@ public class OperateController {
@ApiOperation
(
value
=
"统计sam总数接口"
,
notes
=
"用于统计sam的总数和总在线数量"
)
@GetMapping
(
"sam/count"
)
@MyLog
(
title
=
"统计sam总数"
,
businessType
=
BusinessType
.
SELECT
)
public
ResResult
getSamTotalCount
()
{
public
ResResult
<
SamVo
>
getSamTotalCount
()
{
Map
<
String
,
SamMonitor
>
samMonitorMap
=
operateManager
.
getSamMonitorMap
();
Map
<
String
,
Integer
>
map
=
new
HashMap
<>();
int
totalSamCount
=
0
;
...
...
@@ -121,9 +123,10 @@ public class OperateController {
totalSamCount
+=
samMonitor
.
getSamCount
();
totalOnlineCount
+=
samMonitor
.
getOnlineCount
();
}
map
.
put
(
"totalSamCount"
,
totalSamCount
);
map
.
put
(
"totalOnlineCount"
,
totalOnlineCount
);
return
ResResult
.
success
().
record
(
map
);
SamVo
samVo
=
new
SamVo
();
samVo
.
setTotalOnlineCount
(
totalOnlineCount
);
samVo
.
setTotalSamCount
(
totalSamCount
);
return
ResResult
.
success
().
record
(
samVo
);
}
/**
...
...
@@ -203,7 +206,7 @@ public class OperateController {
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
)
})
public
ResResult
getServerList
(
@RequestParam
(
"pageNo"
)
int
pageNo
,
public
ResResult
<
List
<
Server
>>
getServerList
(
@RequestParam
(
"pageNo"
)
int
pageNo
,
@RequestParam
(
"pageSize"
)
int
pageSize
)
{
List
<
Server
>
records
=
serverService
.
getServerList
(
pageNo
,
pageSize
);
return
ResResult
.
success
().
record
(
records
);
...
...
license/src/main/java/iot/sixiang/license/controller/SysOperLogController.java
View file @
3268b285
...
...
@@ -42,7 +42,7 @@ public class SysOperLogController {
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
)
})
public
PageResult
getOperLogList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
public
PageResult
<
SysOperLog
>
getOperLogList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
)
{
PageInfoModel
<
SysOperLog
>
records
=
sysOperLogService
.
getOperLogList
(
pageNo
,
pageSize
);
int
total
=
records
.
getTotal
();
...
...
license/src/main/java/iot/sixiang/license/controller/UserController.java
View file @
3268b285
...
...
@@ -118,7 +118,7 @@ public class UserController {
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
),
@ApiImplicitParam
(
name
=
"company"
,
value
=
"公司名"
)
})
public
PageResult
getUserList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
public
PageResult
<
UserVo
>
getUserList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
@RequestParam
(
value
=
"userName"
,
required
=
false
)
String
userName
,
@RequestParam
(
value
=
"company"
,
required
=
false
)
String
company
)
{
...
...
@@ -127,7 +127,7 @@ public class UserController {
int
pages
=
total
/
pageSize
;
//pages为总页数
int
mod
=
total
%
pageSize
;
if
(
mod
!=
0
){
pages
=
pages
+
1
;
pages
=
pages
+
1
;
}
List
<
UserVo
>
result
=
records
.
getResult
();
return
new
PageResult
(
200
,
"查找成功"
,
pageNo
,
pages
,
total
,
result
);
...
...
license/src/main/java/iot/sixiang/license/model/PageResult.java
View file @
3268b285
...
...
@@ -4,17 +4,17 @@ package iot.sixiang.license.model;
import
lombok.Data
;
@Data
public
class
PageResult
{
public
class
PageResult
<
T
>
{
private
int
code
;
private
String
msg
;
private
int
pageNo
;
private
int
pages
;
private
int
total
;
private
Object
record
;
private
T
record
;
public
PageResult
(
int
code
,
String
msg
,
int
pageNo
,
int
pages
,
int
total
,
Object
record
)
{
public
PageResult
(
int
code
,
String
msg
,
int
pageNo
,
int
pages
,
int
total
,
T
record
)
{
super
();
this
.
code
=
code
;
this
.
msg
=
msg
;
...
...
license/src/main/java/iot/sixiang/license/model/ResResult.java
View file @
3268b285
...
...
@@ -11,10 +11,10 @@ import lombok.Data;
* @date 2022-06-08
*/
@Data
public
class
ResResult
{
public
class
ResResult
<
T
>
{
private
int
code
;
private
String
msg
;
private
Object
record
;
private
T
record
;
public
static
ResResult
success
()
{
ResResult
respResult
=
new
ResResult
();
...
...
@@ -40,7 +40,7 @@ public class ResResult {
return
this
;
}
public
ResResult
record
(
Object
data
){
public
ResResult
record
(
T
data
){
this
.
record
=
data
;
return
this
;
}
...
...
license/src/main/java/iot/sixiang/license/model/vo/AlarmVo.java
View file @
3268b285
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
iot.sixiang.license.entity.Alarm
;
import
lombok.Data
;
...
...
@@ -10,10 +11,13 @@ import lombok.Data;
@Data
public
class
AlarmVo
extends
Alarm
{
@ApiModelProperty
(
"警告等级"
)
private
int
level
;
@ApiModelProperty
(
"警告描述"
)
private
String
levelDescribe
;
@ApiModelProperty
(
"已读标记"
)
private
int
readFlag
;
}
license/src/main/java/iot/sixiang/license/model/vo/AppVo.java
View file @
3268b285
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
iot.sixiang.license.entity.Apply
;
import
lombok.Data
;
...
...
@@ -10,13 +11,18 @@ import lombok.Data;
@Data
public
class
AppVo
extends
Apply
{
@ApiModelProperty
(
"设备数量"
)
public
int
deviceCount
;
@ApiModelProperty
(
"用户名"
)
public
String
userName
;
@ApiModelProperty
(
"公司名"
)
public
String
company
;
@ApiModelProperty
(
"设备编号"
)
public
String
sn
;
@ApiModelProperty
(
"设备Id"
)
public
int
deviceId
;
}
license/src/main/java/iot/sixiang/license/model/vo/DeviceDetailVo.java
View file @
3268b285
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
DeviceDetailVo
extends
DeviceVo
{
private
int
status
;
//当前状态,0 offline,1 online
private
String
online
;
//上线时间
private
String
offline
;
//下线时间
@ApiModelProperty
(
"当前状态,0 offline,1 online"
)
private
int
status
;
@ApiModelProperty
(
"上线时间"
)
private
String
online
;
@ApiModelProperty
(
"下线时间"
)
private
String
offline
;
}
license/src/main/java/iot/sixiang/license/model/vo/DeviceVo.java
View file @
3268b285
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -12,12 +13,16 @@ public class DeviceVo implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"设备Id"
)
private
int
deviceId
;
@ApiModelProperty
(
"应用名"
)
private
String
appName
;
@ApiModelProperty
(
"用户名"
)
private
String
userName
;
@ApiModelProperty
(
"设备编号"
)
private
String
sn
;
}
license/src/main/java/iot/sixiang/license/model/vo/LoginVo.java
0 → 100644
View file @
3268b285
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* Created by m33 on 2022/6/14 18:51
*/
@Data
public
class
LoginVo
{
@ApiModelProperty
(
"token"
)
private
String
authorization
;
}
license/src/main/java/iot/sixiang/license/model/vo/QpsVo.java
0 → 100644
View file @
3268b285
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* Created by m33 on 2022/6/14 19:02
*/
@Data
public
class
QpsVo
{
@ApiModelProperty
(
"x轴"
)
private
List
<
Integer
>
x
;
@ApiModelProperty
(
"y轴"
)
private
List
<
Integer
>
y
;
}
license/src/main/java/iot/sixiang/license/model/vo/ResourceVo.java
View file @
3268b285
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
...
...
@@ -9,15 +10,21 @@ import lombok.Data;
@Data
public
class
ResourceVo
{
@ApiModelProperty
(
"用户名"
)
private
String
userName
;
@ApiModelProperty
(
"密码"
)
private
String
password
;
@ApiModelProperty
(
"公司名"
)
private
String
company
;
@ApiModelProperty
(
"应用名"
)
private
String
appName
;
@ApiModelProperty
(
"应用key"
)
private
String
appKey
;
@ApiModelProperty
(
"设备编号"
)
private
String
sn
;
}
\ No newline at end of file
license/src/main/java/iot/sixiang/license/model/vo/SamVo.java
0 → 100644
View file @
3268b285
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* Created by m33 on 2022/6/14 18:56
*/
@Data
public
class
SamVo
{
@ApiModelProperty
(
"总Sam数量"
)
private
int
totalSamCount
;
@ApiModelProperty
(
"总在线数量"
)
private
int
totalOnlineCount
;
}
license/src/main/java/iot/sixiang/license/model/vo/ServerStatusVo.java
View file @
3268b285
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
ServerStatusVo
{
private
int
count
;
//服务实时工作通道数量
private
int
status
;
//诊断状态,通道数量小于100流畅,100-500正常,500以上拥挤
@ApiModelProperty
(
"服务实时工作通道数量"
)
private
int
count
;
@ApiModelProperty
(
"诊断状态,通道数量小于100流畅,100-500正常,500以上拥挤"
)
private
int
status
;
}
license/src/main/java/iot/sixiang/license/model/vo/UserVo.java
View file @
3268b285
package
iot
.
sixiang
.
license
.
model
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
iot.sixiang.license.entity.User
;
import
lombok.Data
;
...
...
@@ -8,5 +9,7 @@ import lombok.Data;
*/
@Data
public
class
UserVo
extends
User
{
@ApiModelProperty
(
"应用数量"
)
public
int
appCount
;
}
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