Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
lic
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
inroi
lic
Commits
5a9b9281
提交
5a9b9281
authored
4月 12, 2023
作者:
李炎
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微调
上级
e9f8fd94
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
31 行增加
和
22 行删除
+31
-22
db_lic.sql
lic-system/db/db_lic.sql
+0
-0
LicInfoMapper.xml
...tem/src/main/java/com/system/dao/mapper/LicInfoMapper.xml
+3
-2
DockerServiceDtoTypeHandler.java
.../java/com/system/handler/DockerServiceDtoTypeHandler.java
+3
-2
JacksonTypeHandler.java
.../src/main/java/com/system/handler/JacksonTypeHandler.java
+24
-17
LicInfoUpdateInVo.java
.../main/java/com/system/transfer/lic/LicInfoUpdateInVo.java
+1
-1
没有找到文件。
lic-system/db/db_lic.sql
0 → 100644
浏览文件 @
5a9b9281
This source diff could not be displayed because it is too large. You can
view the blob
instead.
lic-system/src/main/java/com/system/dao/mapper/LicInfoMapper.xml
浏览文件 @
5a9b9281
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
<mapper
namespace=
"com.system.dao.LicInfoMapper"
>
<mapper
namespace=
"com.system.dao.LicInfoMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.system.transfer.lic.LicInfoListOutVoRecords"
>
<resultMap
id=
"BaseResultMap"
type=
"com.system.transfer.lic.LicInfoListOutVoRecords"
>
<
!--<result column="module_verification" property="moduleVerification" jdbcType="VARCHAR"-->
<
result
column=
"module_verification"
property=
"moduleVerification"
jdbcType=
"VARCHAR"
<!--typeHandler="com.system.handler.JacksonTypeHandler"/>--
>
typeHandler=
"com.system.handler.JacksonTypeHandler"
/
>
<result
column=
"docker_services"
property=
"dockerServices"
jdbcType=
"LONGVARCHAR"
<result
column=
"docker_services"
property=
"dockerServices"
jdbcType=
"LONGVARCHAR"
typeHandler=
"com.system.handler.DockerServiceDtoTypeHandler"
/>
typeHandler=
"com.system.handler.DockerServiceDtoTypeHandler"
/>
</resultMap>
</resultMap>
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
SELECT
SELECT
id, lq_lic_name, mac_address, effective_time, file_effective_time, verification_interval, module_verification,
id, lq_lic_name, mac_address, effective_time, file_effective_time, verification_interval, module_verification,
docker_services,
remark, create_time
remark, create_time
FROM tb_lic_info
FROM tb_lic_info
<where>
<where>
...
...
lic-system/src/main/java/com/system/handler/DockerServiceDtoTypeHandler.java
浏览文件 @
5a9b9281
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.system.dto.DockerServiceDto
;
import
com.system.dto.DockerServiceDto
;
import
lombok.SneakyThrows
;
import
lombok.SneakyThrows
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.type.BaseTypeHandler
;
import
org.apache.ibatis.type.BaseTypeHandler
;
import
org.apache.ibatis.type.JdbcType
;
import
org.apache.ibatis.type.JdbcType
;
import
org.apache.ibatis.type.MappedJdbcTypes
;
import
org.apache.ibatis.type.MappedJdbcTypes
;
...
@@ -27,7 +28,7 @@ import java.util.List;
...
@@ -27,7 +28,7 @@ import java.util.List;
*/
*/
//@MappedTypes({JSONArray.class}) // 因为BaseTypeHandler<JSONArray> 泛型中指定了JSONArray 的话,这个注解也可以省略
//@MappedTypes({JSONArray.class}) // 因为BaseTypeHandler<JSONArray> 泛型中指定了JSONArray 的话,这个注解也可以省略
@MappedJdbcTypes
(
value
=
JdbcType
.
LONGVARCHAR
,
includeNullJdbcType
=
true
)
@MappedJdbcTypes
(
value
=
JdbcType
.
LONGVARCHAR
,
includeNullJdbcType
=
true
)
//
@Component
@Component
public
class
DockerServiceDtoTypeHandler
extends
BaseTypeHandler
<
List
<
DockerServiceDto
>>
implements
InitializingBean
{
public
class
DockerServiceDtoTypeHandler
extends
BaseTypeHandler
<
List
<
DockerServiceDto
>>
implements
InitializingBean
{
static
DockerServiceDtoTypeHandler
j
;
static
DockerServiceDtoTypeHandler
j
;
@Autowired
@Autowired
...
@@ -70,6 +71,6 @@ public class DockerServiceDtoTypeHandler extends BaseTypeHandler<List<DockerServ
...
@@ -70,6 +71,6 @@ public class DockerServiceDtoTypeHandler extends BaseTypeHandler<List<DockerServ
@SneakyThrows
@SneakyThrows
private
List
<
DockerServiceDto
>
read
(
String
json
)
{
private
List
<
DockerServiceDto
>
read
(
String
json
)
{
return
json
!=
null
?
Arrays
.
asList
(
j
.
objectMapper
.
readValue
(
json
,
DockerServiceDto
[].
class
))
:
new
ArrayList
<>();
return
!
StringUtils
.
isEmpty
(
json
)
?
Arrays
.
asList
(
j
.
objectMapper
.
readValue
(
json
,
DockerServiceDto
[].
class
))
:
new
ArrayList
<>();
}
}
}
}
lic-system/src/main/java/com/system/handler/JacksonTypeHandler.java
浏览文件 @
5a9b9281
package
com
.
system
.
handler
;
package
com
.
system
.
handler
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.sql.CallableStatement
;
import
java.sql.CallableStatement
;
import
java.sql.PreparedStatement
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
lombok.extern.slf4j.Slf4j
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
org.apache.ibatis.exceptions.PersistenceException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
org.apache.ibatis.type.BaseTypeHandler
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.ibatis.type.JdbcType
;
import
org.apache.ibatis.exceptions.PersistenceException
;
import
org.apache.ibatis.type.MappedJdbcTypes
;
import
org.apache.ibatis.type.BaseTypeHandler
;
import
org.apache.ibatis.type.JdbcType
;
import
org.apache.ibatis.type.MappedJdbcTypes
;
/**
/**
JSON 字段类型处理器
*
JSON 字段类型处理器
**/
**/
@Slf4j
@Slf4j
@MappedJdbcTypes
(
JdbcType
.
VARCHAR
)
@MappedJdbcTypes
(
JdbcType
.
VARCHAR
)
...
@@ -74,8 +76,13 @@ public class JacksonTypeHandler<T extends Object> extends BaseTypeHandler<T> {
...
@@ -74,8 +76,13 @@ public class JacksonTypeHandler<T extends Object> extends BaseTypeHandler<T> {
}
}
@Override
@Override
// public void setNonNullParameter(PreparedStatement ps, int columnIndex, T parameter, JdbcType jdbcType)
// throws SQLException {
// ps.setString(columnIndex, toJsonString(parameter));
// }
public
void
setNonNullParameter
(
PreparedStatement
ps
,
int
columnIndex
,
T
parameter
,
JdbcType
jdbcType
)
public
void
setNonNullParameter
(
PreparedStatement
ps
,
int
columnIndex
,
T
parameter
,
JdbcType
jdbcType
)
throws
SQLException
{
throws
SQLException
{
ps
.
setString
(
columnIndex
,
toJsonString
(
parameter
)
);
ps
.
setString
(
columnIndex
,
parameter
!=
null
?
JSON
.
toJSONString
(
parameter
,
SerializerFeature
.
WriteMapNullValue
)
:
"[]"
);
}
}
}
}
lic-system/src/main/java/com/system/transfer/lic/LicInfoUpdateInVo.java
浏览文件 @
5a9b9281
...
@@ -48,7 +48,7 @@ public class LicInfoUpdateInVo {
...
@@ -48,7 +48,7 @@ public class LicInfoUpdateInVo {
/**
/**
* 模块验证
* 模块验证
*/
*/
private
String
moduleVerification
;
private
List
<
String
>
moduleVerification
;
/**
/**
* 服务
* 服务
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论