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
703116b2
Commit
703116b2
authored
Jul 14, 2022
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
83e9f4c9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
31 deletions
+31
-31
ApplyController.java
.../java/iot/sixiang/license/controller/ApplyController.java
+24
-16
OperateController.java
...ava/iot/sixiang/license/controller/OperateController.java
+7
-15
No files found.
license/src/main/java/iot/sixiang/license/controller/ApplyController.java
View file @
703116b2
...
...
@@ -17,6 +17,7 @@ import iot.sixiang.license.model.PageResult;
import
iot.sixiang.license.model.vo.AppVo
;
import
iot.sixiang.license.service.ApplyService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.WebDataBinder
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -37,18 +38,24 @@ public class ApplyController {
@Autowired
private
ApplyService
applyService
;
@InitBinder
public
void
initBinder
(
WebDataBinder
binder
)
{
binder
.
setDisallowedFields
(
new
String
[]{
"adminCome"
});
}
/**
* 添加apply
*
* @param jsonObject
* @return
*/
@ApiOperation
(
value
=
"应用添加接口"
,
notes
=
"用于添加应用"
)
@PostMapping
(
"add"
)
@MyLog
(
title
=
"添加应用"
,
optParam
=
"#{jsonObject}"
,
businessType
=
BusinessType
.
INSERT
)
@ApiOperationSupport
(
params
=
@DynamicParameters
(
name
=
"jsonObject"
,
properties
=
{
@DynamicParameter
(
name
=
"appName"
,
value
=
"应用名"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@DynamicParameter
(
name
=
"appKey"
,
value
=
"应用key"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@DynamicParameter
(
name
=
"userId"
,
value
=
"用户Id"
,
required
=
true
,
dataTypeClass
=
Integer
.
class
)
@ApiOperationSupport
(
params
=
@DynamicParameters
(
name
=
"jsonObject"
,
properties
=
{
@DynamicParameter
(
name
=
"appName"
,
value
=
"应用名"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@DynamicParameter
(
name
=
"appKey"
,
value
=
"应用key"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@DynamicParameter
(
name
=
"userId"
,
value
=
"用户Id"
,
required
=
true
,
dataTypeClass
=
Integer
.
class
)
}))
public
BaseResult
addApply
(
@RequestBody
JSONObject
jsonObject
)
{
String
appName
=
jsonObject
.
getString
(
"appName"
);
...
...
@@ -64,6 +71,7 @@ public class ApplyController {
/**
* 分页查询所有的apply
*
* @param pageNo
* @param pageSize
* @return
...
...
@@ -72,21 +80,21 @@ public class ApplyController {
@GetMapping
(
"list"
)
@MyLog
(
title
=
"获取应用列表"
,
optParam
=
"#{pageNo},#{pageSize},#{appName}"
,
businessType
=
BusinessType
.
SELECT
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"appName"
,
value
=
"应用名"
)
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"appName"
,
value
=
"应用名"
)
})
public
PageResult
<
AppVo
>
getAppList
(
@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
);
@RequestParam
(
value
=
"appName"
,
required
=
false
)
String
appName
)
{
PageInfoModel
<
AppVo
>
records
=
applyService
.
getAppList
(
pageNo
,
pageSize
,
appName
);
int
total
=
records
.
getTotal
();
int
pages
=
total
/
pageSize
;
//pages为总页数
int
mod
=
total
%
pageSize
;
if
(
mod
!=
0
)
{
pages
=
pages
+
1
;
int
pages
=
total
/
pageSize
;
//pages为总页数
int
mod
=
total
%
pageSize
;
if
(
mod
!=
0
)
{
pages
=
pages
+
1
;
}
List
<
AppVo
>
result
=
records
.
getResult
();
return
new
PageResult
(
200
,
"查找成功"
,
pageNo
,
pages
,
total
,
result
);
return
new
PageResult
(
200
,
"查找成功"
,
pageNo
,
pages
,
total
,
result
);
}
}
\ No newline at end of file
license/src/main/java/iot/sixiang/license/controller/OperateController.java
View file @
703116b2
...
...
@@ -26,6 +26,7 @@ import iot.sixiang.license.service.AlarmService;
import
iot.sixiang.license.service.MonitorService
;
import
iot.sixiang.license.service.ServerService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.owasp.esapi.ESAPI
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -92,7 +93,8 @@ public class OperateController {
@MyLog
(
title
=
"获取告警列表"
,
businessType
=
BusinessType
.
SELECT
)
public
ResResult
<
List
<
AlarmVo
>>
getAlarmList
()
{
String
userId
=
UserUtils
.
getLoginUserId
();
int
Id
=
Integer
.
valueOf
(
userId
);
String
comeId
=
ESAPI
.
encoder
().
encodeForHTML
(
userId
);
int
Id
=
Integer
.
valueOf
(
comeId
);
List
<
AlarmVo
>
alarmList
=
alarmService
.
getAlarmList
(
Id
);
return
ResResult
.
success
().
goRecord
(
alarmList
);
}
...
...
@@ -138,10 +140,7 @@ public class OperateController {
@ApiOperation
(
value
=
"添加服务接口"
,
notes
=
"用于添加服务"
)
@PostMapping
(
"server/add"
)
@MyLog
(
title
=
"添加服务"
,
optParam
=
"#{jsonObject}"
,
businessType
=
BusinessType
.
INSERT
)
@ApiOperationSupport
(
params
=
@DynamicParameters
(
name
=
"jsonObject"
,
properties
=
{
@DynamicParameter
(
name
=
"serverIp"
,
value
=
"服务Ip"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@DynamicParameter
(
name
=
"port"
,
value
=
"端口"
,
required
=
true
,
dataTypeClass
=
Integer
.
class
)
}))
@ApiOperationSupport
(
params
=
@DynamicParameters
(
name
=
"jsonObject"
,
properties
=
{
@DynamicParameter
(
name
=
"serverIp"
,
value
=
"服务Ip"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@DynamicParameter
(
name
=
"port"
,
value
=
"端口"
,
required
=
true
,
dataTypeClass
=
Integer
.
class
)}))
public
BaseResult
addServer
(
@RequestBody
JSONObject
jsonObject
)
{
String
serverIp
=
jsonObject
.
getString
(
"serverIp"
);
int
port
=
jsonObject
.
getIntValue
(
"port"
);
...
...
@@ -180,10 +179,7 @@ public class OperateController {
@ApiOperation
(
value
=
"修改服务接口"
,
notes
=
"修改服务"
)
@PostMapping
(
"server/update"
)
@MyLog
(
title
=
"修改服务"
,
optParam
=
"#{serverIp},#{port}"
,
businessType
=
BusinessType
.
UPDATE
)
@ApiOperationSupport
(
params
=
@DynamicParameters
(
name
=
"jsonObject"
,
properties
=
{
@DynamicParameter
(
name
=
"serverIp"
,
value
=
"服务Ip"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@DynamicParameter
(
name
=
"port"
,
value
=
"端口"
,
required
=
true
,
dataTypeClass
=
Integer
.
class
)
}))
@ApiOperationSupport
(
params
=
@DynamicParameters
(
name
=
"jsonObject"
,
properties
=
{
@DynamicParameter
(
name
=
"serverIp"
,
value
=
"服务Ip"
,
required
=
true
,
dataTypeClass
=
String
.
class
),
@DynamicParameter
(
name
=
"port"
,
value
=
"端口"
,
required
=
true
,
dataTypeClass
=
Integer
.
class
)}))
public
BaseResult
updateServer
(
@RequestBody
JSONObject
jsonObject
)
{
String
serverIp
=
jsonObject
.
getString
(
"serverIp"
);
int
port
=
jsonObject
.
getInteger
(
"port"
);
...
...
@@ -206,12 +202,8 @@ public class OperateController {
@ApiOperation
(
value
=
"获取服务列表接口"
,
notes
=
"用于获取服务列表"
)
@GetMapping
(
"server/list"
)
@MyLog
(
title
=
"获取服务列表"
,
optParam
=
"#{pageNo},#{pageSize}"
,
businessType
=
BusinessType
.
SELECT
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少条"
,
required
=
true
,
dataType
=
"int"
)
})
public
ResResult
<
List
<
Server
>>
getServerList
(
@RequestParam
(
"pageNo"
)
int
pageNo
,
@RequestParam
(
"pageSize"
)
int
pageSize
)
{
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少条"
,
required
=
true
,
dataType
=
"int"
)})
public
ResResult
<
List
<
Server
>>
getServerList
(
@RequestParam
(
"pageNo"
)
int
pageNo
,
@RequestParam
(
"pageSize"
)
int
pageSize
)
{
List
<
Server
>
records
=
serverService
.
getServerList
(
pageNo
,
pageSize
);
return
ResResult
.
success
().
goRecord
(
records
);
}
...
...
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