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
ef35093a
Commit
ef35093a
authored
Jun 14, 2022
by
zengtianlai3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加Knif4j接口文档
parent
84d2b00d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
67 additions
and
11 deletions
+67
-11
ApplyController.java
.../java/iot/sixiang/license/controller/ApplyController.java
+5
-4
DeviceController.java
...java/iot/sixiang/license/controller/DeviceController.java
+8
-0
LoginController.java
.../java/iot/sixiang/license/controller/LoginController.java
+10
-0
OperateController.java
...ava/iot/sixiang/license/controller/OperateController.java
+2
-3
ResourceContrller.java
...ava/iot/sixiang/license/controller/ResourceContrller.java
+2
-0
ServerController.java
...java/iot/sixiang/license/controller/ServerController.java
+19
-1
UserController.java
...n/java/iot/sixiang/license/controller/UserController.java
+12
-0
application-dev.yml
license/src/main/resources/application-dev.yml
+3
-1
application-prod.yml
license/src/main/resources/application-prod.yml
+3
-1
application-test.yml
license/src/main/resources/application-test.yml
+3
-1
No files found.
license/src/main/java/iot/sixiang/license/controller/ApplyController.java
View file @
ef35093a
...
...
@@ -68,11 +68,12 @@ public class ApplyController {
@ApiOperation
(
value
=
"获取应用列表接口"
,
notes
=
"用于获取应用列表"
)
@GetMapping
(
"list"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"
当前页"
,
value
=
"当前在第几页"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"
每页数量"
,
value
=
"每页显示多少页"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"
应用名"
,
value
=
"应用名"
,
required
=
false
)
@ApiImplicitParam
(
name
=
"
pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"
pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"
appName"
,
value
=
"应用名"
)
})
public
PageResult
getUserList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
public
PageResult
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
);
int
total
=
records
.
getTotal
();
...
...
license/src/main/java/iot/sixiang/license/controller/DeviceController.java
View file @
ef35093a
...
...
@@ -6,6 +6,8 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import
com.github.xiaoymin.knife4j.annotations.DynamicParameter
;
import
com.github.xiaoymin.knife4j.annotations.DynamicParameters
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
iot.sixiang.license.model.BaseResult
;
import
iot.sixiang.license.model.PageInfoModel
;
...
...
@@ -65,6 +67,12 @@ public class DeviceController {
*/
@ApiOperation
(
value
=
"获取设备列表接口"
,
notes
=
"用于获取设备列表"
)
@GetMapping
(
"list"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"appName"
,
value
=
"应用名"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
)
})
public
PageResult
getDeviceList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
@RequestParam
(
value
=
"appName"
,
required
=
false
)
String
appName
,
...
...
license/src/main/java/iot/sixiang/license/controller/LoginController.java
View file @
ef35093a
package
iot
.
sixiang
.
license
.
controller
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
iot.sixiang.license.jwt.JwtUtil
;
import
iot.sixiang.license.jwt.LoginUser
;
...
...
@@ -36,6 +38,10 @@ public class LoginController {
*/
@ApiOperation
(
value
=
"登录接口"
,
notes
=
"登录接口"
)
@GetMapping
(
"login"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"password"
,
value
=
"密码"
,
required
=
true
)
})
public
ResResult
login
(
@RequestParam
(
"userName"
)
String
userName
,
@RequestParam
(
"password"
)
String
password
)
{
...
...
@@ -54,6 +60,10 @@ public class LoginController {
@ApiOperation
(
value
=
"注销接口"
,
notes
=
"注销接口"
)
@GetMapping
(
"logout"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"password"
,
value
=
"密码"
,
required
=
true
)
})
public
ResResult
logout
(
@RequestParam
(
"userName"
)
String
userName
,
@RequestParam
(
"password"
)
String
password
)
{
// @RequestBody JSONObject jsonObject
LoginUser
user
=
new
LoginUser
();
...
...
license/src/main/java/iot/sixiang/license/controller/OperateController.java
View file @
ef35093a
package
iot
.
sixiang
.
license
.
controller
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
iot.sixiang.license.model.ResResult
;
import
iot.sixiang.license.model.SamMonitor
;
...
...
@@ -27,7 +28,6 @@ public class OperateController {
@ApiOperation
(
value
=
"服务接口"
,
notes
=
"用于获取服务列表"
)
@GetMapping
(
"monitor/server"
)
public
ResResult
getDeviceTypes
()
{
List
<
SamMonitor
>
records
=
operateManager
.
getSamMonitorList
();
return
ResResult
.
success
().
record
(
records
);
...
...
@@ -41,9 +41,8 @@ public class OperateController {
@ApiOperation
(
value
=
"获取并发量接口"
,
notes
=
"用于获取并发量"
)
@GetMapping
(
"monitor/qps"
)
@ApiImplicitParam
(
name
=
"type"
,
value
=
"类型:0:今天 1:昨天 2:七天前 3:三十天前"
,
required
=
true
,
dataType
=
"int"
)
public
ResResult
getQps
(
@RequestParam
(
"type"
)
int
type
)
{
HashMap
<
String
,
List
<
Integer
>>
monitorList
=
monitorService
.
getMonitorList
(
type
);
return
ResResult
.
success
().
record
(
monitorList
);
}
...
...
license/src/main/java/iot/sixiang/license/controller/ResourceContrller.java
View file @
ef35093a
package
iot
.
sixiang
.
license
.
controller
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
iot.sixiang.license.resource.ResourceManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -23,6 +24,7 @@ public class ResourceContrller {
@ApiOperation
(
value
=
"资源下载接口"
,
notes
=
"用于下载资源"
)
@GetMapping
(
"/download"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户Id"
,
required
=
true
,
dataType
=
"int"
)
public
void
downloadWorkHourRecordTemplate
(
HttpServletResponse
response
,
@RequestParam
(
value
=
"userId"
)
int
userId
)
{
try
{
...
...
license/src/main/java/iot/sixiang/license/controller/ServerController.java
View file @
ef35093a
...
...
@@ -2,7 +2,12 @@ package iot.sixiang.license.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.DynamicParameter
;
import
com.github.xiaoymin.knife4j.annotations.DynamicParameters
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
iot.sixiang.license.entity.Server
;
import
iot.sixiang.license.model.BaseResult
;
...
...
@@ -36,6 +41,10 @@ public class ServerController {
*/
@ApiOperation
(
value
=
"添加服务接口"
,
notes
=
"用于添加服务"
)
@PostMapping
(
"add"
)
@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"
);
...
...
@@ -70,6 +79,10 @@ public class ServerController {
*/
@ApiOperation
(
value
=
"修改服务接口"
,
notes
=
"修改服务"
)
@PostMapping
(
"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
)
}))
public
BaseResult
updateServer
(
@RequestBody
JSONObject
jsonObject
)
{
String
serverIp
=
jsonObject
.
getString
(
"serverIp"
);
int
port
=
jsonObject
.
getInteger
(
"port"
);
...
...
@@ -90,7 +103,12 @@ public class ServerController {
*/
@ApiOperation
(
value
=
"获取服务列表接口"
,
notes
=
"用于获取服务列表"
)
@GetMapping
(
"list"
)
public
ResResult
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
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/UserController.java
View file @
ef35093a
...
...
@@ -6,6 +6,8 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import
com.github.xiaoymin.knife4j.annotations.DynamicParameter
;
import
com.github.xiaoymin.knife4j.annotations.DynamicParameters
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
iot.sixiang.license.model.BaseResult
;
import
iot.sixiang.license.model.PageInfoModel
;
...
...
@@ -80,6 +82,10 @@ public class UserController {
*/
@ApiOperation
(
value
=
"用户修改接口"
,
notes
=
"修改用户"
)
@PostMapping
(
"update"
)
@ApiOperationSupport
(
params
=
@DynamicParameters
(
name
=
"jsonObject"
,
properties
=
{
@DynamicParameter
(
name
=
"userId"
,
value
=
"用户Id"
,
required
=
true
,
dataTypeClass
=
Integer
.
class
),
@DynamicParameter
(
name
=
"password"
,
value
=
"密码"
,
required
=
true
,
dataTypeClass
=
String
.
class
)
}))
public
BaseResult
updateUser
(
@RequestBody
JSONObject
jsonObject
)
{
int
userId
=
jsonObject
.
getInteger
(
"userId"
);
String
password
=
jsonObject
.
getString
(
"password"
);
...
...
@@ -100,6 +106,12 @@ public class UserController {
*/
@ApiOperation
(
value
=
"获取用户列表接口"
,
notes
=
"用于获取用户列表"
)
@GetMapping
(
"list"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
),
@ApiImplicitParam
(
name
=
"company"
,
value
=
"公司名"
)
})
public
PageResult
getUserList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
@RequestParam
(
value
=
"userName"
,
required
=
false
)
String
userName
,
...
...
license/src/main/resources/application-dev.yml
View file @
ef35093a
...
...
@@ -11,4 +11,6 @@ spring:
password
:
123456
mybatis-plus
:
mapper-locations
:
classpath:/mapper/**.xml
type-aliases-package
:
iot.sixiang.license.entity
\ No newline at end of file
type-aliases-package
:
iot.sixiang.license.entity
knife4j
:
enable
:
true
\ No newline at end of file
license/src/main/resources/application-prod.yml
View file @
ef35093a
...
...
@@ -8,4 +8,6 @@ spring:
password
:
Acc2019123
mybatis-plus
:
mapper-locations
:
classpath:/mapper/**.xml
type-aliases-package
:
iot.sixiang.license.entity
\ No newline at end of file
type-aliases-package
:
iot.sixiang.license.entity
knife4j
:
enable
:
true
\ No newline at end of file
license/src/main/resources/application-test.yml
View file @
ef35093a
...
...
@@ -8,4 +8,6 @@ spring:
password
:
Acc2019123
mybatis-plus
:
mapper-locations
:
classpath:/mapper/**.xml
type-aliases-package
:
iot.sixiang.license.entity
\ No newline at end of file
type-aliases-package
:
iot.sixiang.license.entity
knife4j
:
enable
:
true
\ No newline at end of file
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