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
5f7b7eda
Commit
5f7b7eda
authored
Jun 07, 2022
by
zengtianlai3
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'm33' into 'master'
修改格式 See merge request
!2
parents
8124cc8b
a0caf9d2
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
74 additions
and
41 deletions
+74
-41
Maven__com_alibaba_fastjson_1_2_28.xml
.idea/libraries/Maven__com_alibaba_fastjson_1_2_28.xml
+13
-0
pom.xml
license/pom.xml
+6
-0
LicenseController.java
...ava/iot/sixiang/license/controller/LicenseController.java
+10
-6
ServerController.java
...java/iot/sixiang/license/controller/ServerController.java
+9
-6
UserController.java
...n/java/iot/sixiang/license/controller/UserController.java
+9
-6
LicenseMapper.java
...c/main/java/iot/sixiang/license/mapper/LicenseMapper.java
+2
-2
ServerMapper.java
...rc/main/java/iot/sixiang/license/mapper/ServerMapper.java
+2
-2
UserMapper.java
.../src/main/java/iot/sixiang/license/mapper/UserMapper.java
+2
-1
LicenseService.java
...main/java/iot/sixiang/license/service/LicenseService.java
+2
-2
ServerService.java
.../main/java/iot/sixiang/license/service/ServerService.java
+2
-2
UserService.java
...rc/main/java/iot/sixiang/license/service/UserService.java
+2
-2
LicenseServiceImpl.java
.../iot/sixiang/license/service/impl/LicenseServiceImpl.java
+5
-4
ServerServiceImpl.java
...a/iot/sixiang/license/service/impl/ServerServiceImpl.java
+5
-4
UserServiceImpl.java
...ava/iot/sixiang/license/service/impl/UserServiceImpl.java
+5
-4
No files found.
.idea/libraries/Maven__com_alibaba_fastjson_1_2_28.xml
0 → 100644
View file @
5f7b7eda
<component
name=
"libraryTable"
>
<library
name=
"Maven: com.alibaba:fastjson:1.2.28"
>
<CLASSES>
<root
url=
"jar://C:/tools/Spring/mvn_repository/com/alibaba/fastjson/1.2.28/fastjson-1.2.28.jar!/"
/>
</CLASSES>
<JAVADOC>
<root
url=
"jar://C:/tools/Spring/mvn_repository/com/alibaba/fastjson/1.2.28/fastjson-1.2.28-javadoc.jar!/"
/>
</JAVADOC>
<SOURCES>
<root
url=
"jar://C:/tools/Spring/mvn_repository/com/alibaba/fastjson/1.2.28/fastjson-1.2.28-sources.jar!/"
/>
</SOURCES>
</library>
</component>
\ No newline at end of file
license/pom.xml
View file @
5f7b7eda
...
...
@@ -57,6 +57,12 @@
<artifactId>
velocity-engine-core
</artifactId>
<version>
2.0
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.28
</version>
</dependency>
</dependencies>
...
...
license/src/main/java/iot/sixiang/license/controller/LicenseController.java
View file @
5f7b7eda
package
iot
.
sixiang
.
license
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
iot.sixiang.license.entity.License
;
import
iot.sixiang.license.model.RespResult
;
import
iot.sixiang.license.service.LicenseService
;
...
...
@@ -18,7 +19,7 @@ import java.util.List;
* @since 2022-06-06
*/
@RestController
@RequestMapping
(
"/iot_
sixiang_
license/license"
)
@RequestMapping
(
"/iot_license/license"
)
public
class
LicenseController
{
@Autowired
...
...
@@ -26,12 +27,15 @@ public class LicenseController {
/**
* 添加license
* @param
license
* @param
jsonObject
* @return
*/
@PostMapping
(
"add"
)
public
RespResult
addLicense
(
@RequestBody
License
license
){
boolean
save
=
licenseService
.
addLicense
(
license
);
public
RespResult
addLicense
(
@RequestBody
JSONObject
jsonObject
){
String
appId
=
(
String
)
jsonObject
.
get
(
"app_id"
);
String
appKey
=
(
String
)
jsonObject
.
get
(
"app_key"
);
String
userId
=
(
String
)
jsonObject
.
get
(
"user_id"
);
boolean
save
=
licenseService
.
addLicense
(
appId
,
appKey
,
userId
);
if
(
save
)
{
return
RespResult
.
success
();
}
else
{
...
...
@@ -45,7 +49,7 @@ public class LicenseController {
* @return
*/
@PostMapping
(
"delete"
)
public
RespResult
deleteLicense
(
@RequestParam
(
"app
I
d"
)
String
appId
)
{
public
RespResult
deleteLicense
(
@RequestParam
(
"app
_i
d"
)
String
appId
)
{
boolean
flag
=
licenseService
.
deleteLicense
(
appId
);
if
(
flag
)
{
return
RespResult
.
success
();
...
...
@@ -61,7 +65,7 @@ public class LicenseController {
* @return
*/
@GetMapping
(
"get_license_list"
)
public
RespResult
getLicenseList
(
@RequestParam
(
"page
No"
)
int
pageNo
,
@RequestParam
(
"pageS
ize"
)
int
pageSize
)
{
public
RespResult
getLicenseList
(
@RequestParam
(
"page
_no"
)
int
pageNo
,
@RequestParam
(
"page_s
ize"
)
int
pageSize
)
{
List
<
License
>
records
=
licenseService
.
getLicenseList
(
pageNo
,
pageSize
);
return
RespResult
.
success
().
record
(
records
);
}
...
...
license/src/main/java/iot/sixiang/license/controller/ServerController.java
View file @
5f7b7eda
package
iot
.
sixiang
.
license
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
iot.sixiang.license.entity.Server
;
import
iot.sixiang.license.model.RespResult
;
import
iot.sixiang.license.service.ServerService
;
...
...
@@ -18,19 +19,21 @@ import java.util.List;
* @since 2022-06-06
*/
@RestController
@RequestMapping
(
"/iot_
sixiang_
license/server"
)
@RequestMapping
(
"/iot_license/server"
)
public
class
ServerController
{
@Autowired
private
ServerService
serverService
;
/**
* 添加server
* @param
server
* @param
jsonObject
* @return
*/
@PostMapping
(
"add"
)
public
RespResult
addServer
(
@RequestBody
Server
server
)
{
boolean
save
=
serverService
.
addServer
(
server
);
public
RespResult
addServer
(
@RequestBody
JSONObject
jsonObject
)
{
String
serverIp
=
(
String
)
jsonObject
.
get
(
"server_ip"
);
int
port
=
(
int
)
jsonObject
.
get
(
"port"
);
boolean
save
=
serverService
.
addServer
(
serverIp
,
port
);
if
(
save
)
{
return
RespResult
.
success
();
}
else
{
...
...
@@ -44,7 +47,7 @@ public class ServerController {
* @return
*/
@PostMapping
(
"delete"
)
public
RespResult
deleteServer
(
@RequestParam
(
"server
I
p"
)
String
serverIp
)
{
public
RespResult
deleteServer
(
@RequestParam
(
"server
_i
p"
)
String
serverIp
)
{
boolean
flag
=
serverService
.
deleteServer
(
serverIp
);
if
(
flag
)
{
return
RespResult
.
success
();
...
...
@@ -60,7 +63,7 @@ public class ServerController {
* @return
*/
@GetMapping
(
"get_server_list"
)
public
RespResult
getServerList
(
@RequestParam
(
"page
No"
)
int
pageNo
,
@RequestParam
(
"pageS
ize"
)
int
pageSize
)
{
public
RespResult
getServerList
(
@RequestParam
(
"page
_no"
)
int
pageNo
,
@RequestParam
(
"page_s
ize"
)
int
pageSize
)
{
List
<
Server
>
records
=
serverService
.
getServerList
(
pageNo
,
pageSize
);
return
RespResult
.
success
().
record
(
records
);
}
...
...
license/src/main/java/iot/sixiang/license/controller/UserController.java
View file @
5f7b7eda
...
...
@@ -2,6 +2,7 @@ package iot.sixiang.license.controller;
import
com.alibaba.fastjson.JSONObject
;
import
iot.sixiang.license.entity.User
;
import
iot.sixiang.license.model.RespResult
;
import
iot.sixiang.license.service.UserService
;
...
...
@@ -19,7 +20,7 @@ import java.util.List;
* @since 2022-06-06
*/
@RestController
@RequestMapping
(
"/iot_
sixiang_
license/user"
)
@RequestMapping
(
"/iot_license/user"
)
public
class
UserController
{
@Autowired
...
...
@@ -27,12 +28,14 @@ public class UserController {
/**
* 添加user
* @param
user
* @param
jsonObject
* @return
*/
@PostMapping
(
"add"
)
public
RespResult
addUser
(
@RequestBody
User
user
)
{
boolean
save
=
userService
.
addUser
(
user
);
public
RespResult
addUser
(
@RequestBody
JSONObject
jsonObject
)
{
String
userId
=
(
String
)
jsonObject
.
get
(
"user_id"
);
String
password
=
(
String
)
jsonObject
.
get
(
"password"
);
boolean
save
=
userService
.
addUser
(
userId
,
password
);
if
(
save
)
{
return
RespResult
.
success
();
}
else
{
...
...
@@ -46,7 +49,7 @@ public class UserController {
* @return
*/
@PostMapping
(
"delete"
)
public
RespResult
deleteUser
(
@RequestParam
(
"user
I
d"
)
String
userId
)
{
public
RespResult
deleteUser
(
@RequestParam
(
"user
_i
d"
)
String
userId
)
{
boolean
flag
=
userService
.
deleteUser
(
userId
);
if
(
flag
)
{
return
RespResult
.
success
();
...
...
@@ -62,7 +65,7 @@ public class UserController {
* @return
*/
@GetMapping
(
"get_user_list"
)
public
RespResult
getUserList
(
@RequestParam
(
"page
No"
)
int
pageNo
,
@RequestParam
(
"pageS
ize"
)
int
pageSize
)
{
public
RespResult
getUserList
(
@RequestParam
(
"page
_no"
)
int
pageNo
,
@RequestParam
(
"page_s
ize"
)
int
pageSize
)
{
List
<
User
>
records
=
userService
.
getUserList
(
pageNo
,
pageSize
);
return
RespResult
.
success
().
record
(
records
);
}
...
...
license/src/main/java/iot/sixiang/license/mapper/LicenseMapper.java
View file @
5f7b7eda
...
...
@@ -13,7 +13,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
LicenseMapper
extends
BaseMapper
<
License
>
{
boolean
addLicense
(
License
license
);
boolean
deleteLicense
(
String
appId
);
boolean
addLicense
(
String
appId
,
String
appKey
,
String
userId
);
}
license/src/main/java/iot/sixiang/license/mapper/ServerMapper.java
View file @
5f7b7eda
...
...
@@ -13,7 +13,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
ServerMapper
extends
BaseMapper
<
Server
>
{
boolean
addServer
(
Server
server
);
boolean
deleteServer
(
String
serverIp
);
boolean
addServer
(
String
serverIp
,
int
port
);
}
license/src/main/java/iot/sixiang/license/mapper/UserMapper.java
View file @
5f7b7eda
...
...
@@ -13,7 +13,8 @@ import iot.sixiang.license.entity.User;
*/
public
interface
UserMapper
extends
BaseMapper
<
User
>
{
boolean
addUser
(
User
user
);
boolean
deleteUser
(
String
user
);
boolean
addUser
(
String
userId
,
String
password
);
}
license/src/main/java/iot/sixiang/license/service/LicenseService.java
View file @
5f7b7eda
...
...
@@ -15,9 +15,9 @@ import java.util.List;
*/
public
interface
LicenseService
extends
IService
<
License
>
{
boolean
addLicense
(
License
license
);
List
<
License
>
getLicenseList
(
int
pageNo
,
int
pageSize
);
boolean
deleteLicense
(
String
appId
);
boolean
addLicense
(
String
appId
,
String
appKey
,
String
userId
);
}
license/src/main/java/iot/sixiang/license/service/ServerService.java
View file @
5f7b7eda
...
...
@@ -15,9 +15,9 @@ import java.util.List;
*/
public
interface
ServerService
extends
IService
<
Server
>
{
boolean
addServer
(
Server
server
);
List
<
Server
>
getServerList
(
int
pageNo
,
int
pageSize
);
boolean
deleteServer
(
String
serverIp
);
boolean
addServer
(
String
serverIp
,
int
port
);
}
license/src/main/java/iot/sixiang/license/service/UserService.java
View file @
5f7b7eda
...
...
@@ -15,9 +15,9 @@ import java.util.List;
*/
public
interface
UserService
extends
IService
<
User
>
{
boolean
addUser
(
User
user
);
List
<
User
>
getUserList
(
int
pageNo
,
int
pageSize
);
boolean
deleteUser
(
String
user
);
boolean
addUser
(
String
userId
,
String
password
);
}
license/src/main/java/iot/sixiang/license/service/impl/LicenseServiceImpl.java
View file @
5f7b7eda
...
...
@@ -23,10 +23,6 @@ public class LicenseServiceImpl extends ServiceImpl<LicenseMapper, License> impl
@Resource
LicenseMapper
licenseMapper
;
@Override
public
boolean
addLicense
(
License
license
)
{
return
licenseMapper
.
addLicense
(
license
);
}
@Override
public
List
<
License
>
getLicenseList
(
int
pageNo
,
int
pageSize
)
{
...
...
@@ -41,4 +37,9 @@ public class LicenseServiceImpl extends ServiceImpl<LicenseMapper, License> impl
return
licenseMapper
.
deleteLicense
(
appId
);
}
@Override
public
boolean
addLicense
(
String
appId
,
String
appKey
,
String
userId
)
{
return
licenseMapper
.
addLicense
(
appId
,
appKey
,
userId
);
}
}
license/src/main/java/iot/sixiang/license/service/impl/ServerServiceImpl.java
View file @
5f7b7eda
...
...
@@ -24,10 +24,6 @@ public class ServerServiceImpl extends ServiceImpl<ServerMapper, Server> impleme
@Resource
ServerMapper
serverMapper
;
@Override
public
boolean
addServer
(
Server
server
)
{
return
serverMapper
.
addServer
(
server
);
}
@Override
public
List
<
Server
>
getServerList
(
int
pageNo
,
int
pageSize
)
{
...
...
@@ -41,4 +37,9 @@ public class ServerServiceImpl extends ServiceImpl<ServerMapper, Server> impleme
public
boolean
deleteServer
(
String
serverIp
)
{
return
serverMapper
.
deleteServer
(
serverIp
);
}
@Override
public
boolean
addServer
(
String
serverIp
,
int
port
)
{
return
baseMapper
.
addServer
(
serverIp
,
port
);
}
}
license/src/main/java/iot/sixiang/license/service/impl/UserServiceImpl.java
View file @
5f7b7eda
...
...
@@ -24,10 +24,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
@Resource
UserMapper
userMapper
;
@Override
public
boolean
addUser
(
User
user
)
{
return
userMapper
.
addUser
(
user
);
}
@Override
public
List
<
User
>
getUserList
(
int
pageNo
,
int
pageSize
)
{
...
...
@@ -41,4 +37,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
public
boolean
deleteUser
(
String
user
)
{
return
userMapper
.
deleteUser
(
user
);
}
@Override
public
boolean
addUser
(
String
userId
,
String
password
)
{
return
userMapper
.
addUser
(
userId
,
password
);
}
}
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