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
9bbdf799
Commit
9bbdf799
authored
Jun 10, 2022
by
zengtianlai3
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'm33' into 'master'
增加运维相关的内容 See merge request
!14
parents
18c1d996
7aedf8ab
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
313 additions
and
38 deletions
+313
-38
LicenseApplication.java
...src/main/java/iot/sixiang/license/LicenseApplication.java
+2
-0
AlarmController.java
.../java/iot/sixiang/license/controller/AlarmController.java
+21
-0
AlarmReadController.java
...a/iot/sixiang/license/controller/AlarmReadController.java
+21
-0
AlarmTypeController.java
...a/iot/sixiang/license/controller/AlarmTypeController.java
+21
-0
OperateController.java
...ava/iot/sixiang/license/controller/OperateController.java
+3
-4
AlarmRead.java
...e/src/main/java/iot/sixiang/license/entity/AlarmRead.java
+55
-0
AlarmType.java
...e/src/main/java/iot/sixiang/license/entity/AlarmType.java
+42
-0
JwtFilter.java
license/src/main/java/iot/sixiang/license/jwt/JwtFilter.java
+1
-2
AlarmMapper.java
...src/main/java/iot/sixiang/license/mapper/AlarmMapper.java
+1
-12
AlarmReadMapper.java
...main/java/iot/sixiang/license/mapper/AlarmReadMapper.java
+16
-0
AlarmTypeMapper.java
...main/java/iot/sixiang/license/mapper/AlarmTypeMapper.java
+16
-0
OperateClientHandler.java
...ava/iot/sixiang/license/operate/OperateClientHandler.java
+0
-1
OperateManager.java
...main/java/iot/sixiang/license/operate/OperateManager.java
+1
-2
AlarmReadService.java
...in/java/iot/sixiang/license/service/AlarmReadService.java
+16
-0
AlarmService.java
...c/main/java/iot/sixiang/license/service/AlarmService.java
+1
-12
AlarmTypeService.java
...in/java/iot/sixiang/license/service/AlarmTypeService.java
+16
-0
AlarmReadServiceImpl.java
...ot/sixiang/license/service/impl/AlarmReadServiceImpl.java
+20
-0
AlarmServiceImpl.java
...va/iot/sixiang/license/service/impl/AlarmServiceImpl.java
+2
-3
AlarmTypeServiceImpl.java
...ot/sixiang/license/service/impl/AlarmTypeServiceImpl.java
+20
-0
CodeGenerator.java
...src/main/java/iot/sixiang/license/util/CodeGenerator.java
+1
-1
OperateSchedu.java
...src/main/java/iot/sixiang/license/util/OperateSchedu.java
+21
-0
AlarmMapper.xml
license/src/main/resources/mapper/AlarmMapper.xml
+2
-1
AlarmReadMapper.xml
license/src/main/resources/mapper/AlarmReadMapper.xml
+9
-0
AlarmTypeMapper.xml
license/src/main/resources/mapper/AlarmTypeMapper.xml
+5
-0
No files found.
license/src/main/java/iot/sixiang/license/LicenseApplication.java
View file @
9bbdf799
...
...
@@ -4,10 +4,12 @@ import org.mybatis.spring.annotation.MapperScan;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.web.servlet.ServletComponentScan
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
@ServletComponentScan
(
basePackages
=
"iot.sixiang.license"
)
@SpringBootApplication
@EnableScheduling
@MapperScan
(
basePackages
=
"iot.sixiang.license.mapper"
)
public
class
LicenseApplication
{
...
...
license/src/main/java/iot/sixiang/license/controller/AlarmController.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 前端控制器
* </p>
*
* @author m33
* @since 2022-06-10
*/
@RestController
@RequestMapping
(
"/license/alarm"
)
public
class
AlarmController
{
}
license/src/main/java/iot/sixiang/license/controller/AlarmReadController.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 前端控制器
* </p>
*
* @author m33
* @since 2022-06-10
*/
@RestController
@RequestMapping
(
"/license/alarm_read"
)
public
class
AlarmReadController
{
}
license/src/main/java/iot/sixiang/license/controller/AlarmTypeController.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 前端控制器
* </p>
*
* @author m33
* @since 2022-06-10
*/
@RestController
@RequestMapping
(
"/license/alarm_type"
)
public
class
AlarmTypeController
{
}
license/src/main/java/iot/sixiang/license/controller/OperateController.java
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
iot.sixiang.license.model.ResResult
;
import
iot.sixiang.license.model.SamMonitor
;
import
iot.sixiang.license.operate.OperateManager
;
...
...
@@ -8,10 +7,10 @@ import iot.sixiang.license.service.AlarmService;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.List
;
@Slf4j
...
...
@@ -45,8 +44,8 @@ public class OperateController {
}
@
Ge
tMapping
(
"alarm/add"
)
@
Pos
tMapping
(
"alarm/add"
)
public
void
addlog
(){
alarmService
.
addAlarm
(
"test
"
);
alarmService
.
addAlarm
(
1
,
"test"
,
"ssssssss
"
);
}
}
license/src/main/java/iot/sixiang/license/entity/AlarmRead.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
entity
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <p>
*
* </p>
*
* @author m33
* @since 2022-06-10
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
AlarmRead
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 告警唯一id
*/
private
Integer
id
;
/**
* 告警类型id
*/
private
Integer
typeId
;
/**
* 告警标题
*/
private
String
title
;
/**
* 告警内容
*/
private
String
content
;
/**
* 创建时间
*/
private
LocalDateTime
createTime
;
/**
* 阅读用户id
*/
private
Integer
userId
;
}
license/src/main/java/iot/sixiang/license/entity/AlarmType.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <p>
*
* </p>
*
* @author m33
* @since 2022-06-10
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
AlarmType
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 告警类型id
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
/**
* 等级
*/
private
Integer
level
;
/**
* 等级描述
*/
private
String
levleDescribe
;
}
license/src/main/java/iot/sixiang/license/jwt/JwtFilter.java
View file @
9bbdf799
...
...
@@ -7,14 +7,13 @@ import iot.sixiang.license.model.ResResult;
import
lombok.extern.slf4j.Slf4j
;
import
javax.servlet.*
;
import
javax.servlet.annotation.WebFilter
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.Map
;
@Slf4j
@WebFilter
(
filterName
=
"jwtFilter"
,
urlPatterns
=
"/iot_license/*"
)
//
@WebFilter(filterName = "jwtFilter", urlPatterns = "/iot_license/*")
public
class
JwtFilter
implements
Filter
{
...
...
license/src/main/java/iot/sixiang/license/mapper/AlarmMapper.java
View file @
9bbdf799
...
...
@@ -2,22 +2,11 @@ package iot.sixiang.license.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
iot.sixiang.license.entity.Alarm
;
import
iot.sixiang.license.entity.Apply
;
import
iot.sixiang.license.model.vo.AppVo
;
import
java.util.List
;
/**
* Title: AlarmMapper
* Description: TODO
*
* @author m33
* @version V1.0
* @date 2022-06-09
*/
public
interface
AlarmMapper
extends
BaseMapper
<
Alarm
>
{
boolean
addAlarm
(
String
content
);
boolean
addAlarm
(
int
typeId
,
String
title
,
String
content
);
// List<Alarm> getAlarmList(String id);
//
...
...
license/src/main/java/iot/sixiang/license/mapper/AlarmReadMapper.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
mapper
;
import
iot.sixiang.license.entity.AlarmRead
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author m33
* @since 2022-06-10
*/
public
interface
AlarmReadMapper
extends
BaseMapper
<
AlarmRead
>
{
}
license/src/main/java/iot/sixiang/license/mapper/AlarmTypeMapper.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
mapper
;
import
iot.sixiang.license.entity.AlarmType
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author m33
* @since 2022-06-10
*/
public
interface
AlarmTypeMapper
extends
BaseMapper
<
AlarmType
>
{
}
license/src/main/java/iot/sixiang/license/operate/OperateClientHandler.java
View file @
9bbdf799
...
...
@@ -31,7 +31,6 @@ public class OperateClientHandler extends SimpleChannelInboundHandler<Object> {
@Override
protected
void
channelRead0
(
ChannelHandlerContext
ctx
,
Object
msg
)
throws
Exception
{
SocketChannel
channel
=
(
SocketChannel
)
ctx
.
channel
();
InetSocketAddress
socketAddr
=
(
InetSocketAddress
)
ctx
.
channel
().
remoteAddress
();
String
remoteIp
=
socketAddr
.
getHostString
();
...
...
license/src/main/java/iot/sixiang/license/operate/OperateManager.java
View file @
9bbdf799
...
...
@@ -2,7 +2,6 @@ package iot.sixiang.license.operate;
import
iot.sixiang.license.entity.Server
;
import
iot.sixiang.license.model.SamMonitor
;
import
iot.sixiang.license.model.vo.DeviceVo
;
import
iot.sixiang.license.service.ServerService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -51,7 +50,7 @@ public class OperateManager {
}
p
rivate
void
createProxyClient
()
{
p
ublic
void
createProxyClient
()
{
Iterator
<
Map
.
Entry
<
String
,
Server
>>
iterator
=
allServers
.
entrySet
().
iterator
();
while
(
iterator
.
hasNext
())
{
Map
.
Entry
<
String
,
Server
>
next
=
iterator
.
next
();
...
...
license/src/main/java/iot/sixiang/license/service/AlarmReadService.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
service
;
import
iot.sixiang.license.entity.AlarmRead
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 服务类
* </p>
*
* @author m33
* @since 2022-06-10
*/
public
interface
AlarmReadService
extends
IService
<
AlarmRead
>
{
}
license/src/main/java/iot/sixiang/license/service/AlarmService.java
View file @
9bbdf799
...
...
@@ -2,21 +2,10 @@ package iot.sixiang.license.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
iot.sixiang.license.entity.Alarm
;
import
iot.sixiang.license.entity.Apply
;
import
iot.sixiang.license.model.PageInfoModel
;
import
iot.sixiang.license.model.vo.AppVo
;
/**
* Title: AlarmService
* Description: TODO
*
* @author m33
* @version V1.0
* @date 2022-06-09
*/
public
interface
AlarmService
extends
IService
<
Alarm
>
{
boolean
addAlarm
(
String
content
);
boolean
addAlarm
(
int
typeId
,
String
title
,
String
content
);
// PageInfoModel<AppVo> getAppList(int pageNo, int pageSize, String appName);
}
license/src/main/java/iot/sixiang/license/service/AlarmTypeService.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
service
;
import
iot.sixiang.license.entity.AlarmType
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 服务类
* </p>
*
* @author m33
* @since 2022-06-10
*/
public
interface
AlarmTypeService
extends
IService
<
AlarmType
>
{
}
license/src/main/java/iot/sixiang/license/service/impl/AlarmReadServiceImpl.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
service
.
impl
;
import
iot.sixiang.license.entity.AlarmRead
;
import
iot.sixiang.license.mapper.AlarmReadMapper
;
import
iot.sixiang.license.service.AlarmReadService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 服务实现类
* </p>
*
* @author m33
* @since 2022-06-10
*/
@Service
public
class
AlarmReadServiceImpl
extends
ServiceImpl
<
AlarmReadMapper
,
AlarmRead
>
implements
AlarmReadService
{
}
license/src/main/java/iot/sixiang/license/service/impl/AlarmServiceImpl.java
View file @
9bbdf799
...
...
@@ -18,8 +18,7 @@ public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, Alarm> implements
AlarmMapper
alarmMapper
;
@Override
public
boolean
addAlarm
(
String
content
)
{
return
alarmMapper
.
addAlarm
(
content
);
public
boolean
addAlarm
(
int
typeId
,
String
title
,
String
content
)
{
return
alarmMapper
.
addAlarm
(
typeId
,
title
,
content
);
}
}
license/src/main/java/iot/sixiang/license/service/impl/AlarmTypeServiceImpl.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
service
.
impl
;
import
iot.sixiang.license.entity.AlarmType
;
import
iot.sixiang.license.mapper.AlarmTypeMapper
;
import
iot.sixiang.license.service.AlarmTypeService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 服务实现类
* </p>
*
* @author m33
* @since 2022-06-10
*/
@Service
public
class
AlarmTypeServiceImpl
extends
ServiceImpl
<
AlarmTypeMapper
,
AlarmType
>
implements
AlarmTypeService
{
}
license/src/main/java/iot/sixiang/license/util/CodeGenerator.java
View file @
9bbdf799
...
...
@@ -47,7 +47,7 @@ public class CodeGenerator {
// 5、策略配置
StrategyConfig
strategy
=
new
StrategyConfig
();
strategy
.
setInclude
(
"a
pply
"
);
strategy
.
setInclude
(
"a
larm_type
"
);
strategy
.
setNaming
(
NamingStrategy
.
underline_to_camel
);
//数据库表映射到实体的命名策略
strategy
.
setTablePrefix
(
pc
.
getModuleName
()
+
"_"
);
//生成实体时去掉表前缀
...
...
license/src/main/java/iot/sixiang/license/util/OperateSchedu.java
0 → 100644
View file @
9bbdf799
package
iot
.
sixiang
.
license
.
util
;
import
iot.sixiang.license.operate.OperateManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
/**
* Created by m33 on 2022/6/10 10:30
*/
@Component
public
class
OperateSchedu
{
@Autowired
private
OperateManager
operateManager
;
@Scheduled
(
cron
=
"0 0 0/1 * * ?"
)
public
void
scheduled
(){
operateManager
.
createProxyClient
();
}
}
license/src/main/resources/mapper/AlarmMapper.xml
View file @
9bbdf799
...
...
@@ -3,7 +3,8 @@
<mapper
namespace=
"iot.sixiang.license.mapper.AlarmMapper"
>
<insert
id=
"addAlarm"
parameterType=
"iot.sixiang.license.entity.Alarm"
>
insert into alarm
(content) values (#{content})
insert into alarm
(type_id, title, content, create_time) values (#{typeId},#{title},#{content},now());
</insert>
</mapper>
license/src/main/resources/mapper/AlarmReadMapper.xml
0 → 100644
View file @
9bbdf799
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"iot.sixiang.license.mapper.AlarmReadMapper"
>
<insert
id=
"addAlarmRead"
parameterType=
"iot.sixiang.license.entity.AlarmRead"
>
insert into alarm (type_id, title, content, create_time) values (#{typeId},#{title},#{content},now());
</insert>
</mapper>
license/src/main/resources/mapper/AlarmTypeMapper.xml
0 → 100644
View file @
9bbdf799
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"iot.sixiang.license.mapper.AlarmTypeMapper"
>
</mapper>
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