提交 3534142d authored 作者: inroi's avatar inroi

微调

上级 8b7a27df
package com.system.dao;
import org.apache.ibatis.annotations.Param;
/**
* @author Inori
*/
......@@ -15,9 +17,10 @@ public interface LicMapper {
/**
* Lic信息创建
*
* @param id ID
* @param licCipherText Lic信息
*/
void licCipherTextCreate(String licCipherText);
void licCipherTextCreateOrUpdate(@Param("id") Integer id, @Param("licCipherText") String licCipherText);
}
......@@ -12,9 +12,9 @@
<insert id="licCipherTextCreate" parameterType="java.lang.String">
<insert id="licCipherTextCreateOrUpdate" parameterType="java.lang.String">
INSERT INTO tb_lic (lic_cipher_text) VALUES (#{licCipherText})
INSERT INTO tb_lic (id, lic_cipher_text) VALUES (#{id}, #{licCipherText}) ON DUPLICATE KEY UPDATE lic_cipher_text = #{licCipherText}
</insert>
......
......@@ -92,7 +92,7 @@ public class LicScheduler {
Map<String, Object> map = new HashMap<>(1);
map.put("data", RsaUtil.encryptByPublicKeyToLong(JsonUtil.toString(request), publicKey));
String result = HttpUtil.httpPost("http://192.168.0.37:8090/lic/api/lic/online/verification", JsonUtil.toString(map)).getBody();
String result = HttpUtil.httpPost("https://lic.lingqingkeji.com:86/lic/api/lic/online/verification", JsonUtil.toString(map)).getBody();
Map<String, Object> temp = JsonUtil.toMap(RsaUtil.decryptByPublicKeyToLong(result, publicKey), String.class, Object.class);
if (!CollectionUtils.isEmpty(temp)) {
......
......@@ -53,7 +53,7 @@ public class LicFileServiceImpl implements ILicFileService {
return RestResponse.fail("Lic文件导入时间已过期");
}
licMapper.licCipherTextCreate(data);
licMapper.licCipherTextCreateOrUpdate(1, data);
licScheduler.setLicScheduler(Integer.parseInt(map.get(Constants.VERIFICATION_INTERVAL)));
} catch (Exception e) {
e.printStackTrace();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论