Compare commits
No commits in common. "develop" and "main" have entirely different histories.
|
@ -33,10 +33,7 @@
|
|||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
|
@ -75,22 +72,6 @@
|
|||
<version>5.8.12</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>3.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter-test</artifactId>
|
||||
<version>3.0.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.foresee.KnowledgeBase;
|
|||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
@SpringBootApplication(scanBasePackages = {"com.foresee"})
|
||||
public class KnowledgeBaseApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
|
@ -2,9 +2,9 @@ package com.foresee.KnowledgeBase.SynchronizeData.zsdy;
|
|||
|
||||
public class Constant {
|
||||
|
||||
public static final String appId = "1400386304";
|
||||
public static final String appId = "gjdw";
|
||||
|
||||
public static final String appKey = "917cabe380e071627e3e6700df2b4ee042d46d944b06d26f949c0a9539524367";
|
||||
public static final String appKey = "gjdw";
|
||||
|
||||
public static final String appSecret = "f3dbbf4815734bc39e9ae4374df34813";
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ public class PullData {
|
|||
String ts = DateUtil.date().getTime() + "";
|
||||
String signStr = StringUtils.join("appId=", Constant.appId, "&appKey=", Constant.appKey, "&ts=", ts, "&appSecret=", Constant.appSecret);
|
||||
signStr = SmUtil.sm3(signStr);
|
||||
return "appId="+Constant.appId+"&appKey="+Constant.appKey+"&ts="+ts+"&sign="+signStr;
|
||||
return "appId="+Constant.appId+"&appKey="+Constant.appKey+"&appSecret="+Constant.appSecret+"&ts="+ts+"&sign="+signStr;
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
@ -28,11 +28,11 @@ public class PullData {
|
|||
String uri = Constant.host+Constant.idListUrl+"?"+uriParams;
|
||||
System.out.println("请求地址:"+uri);
|
||||
Map<String,Object> datasParams = new HashMap<String,Object>();
|
||||
datasParams.put("startUpdateTime", "2023-03-03 00:00:00");
|
||||
datasParams.put("startUpdateTime", "2024-03-03 00:00:00");
|
||||
datasParams.put("modelId", "fagui");
|
||||
Map<String,Object> params = new HashMap<String,Object>();
|
||||
params.put("params", datasParams);
|
||||
params.put("dataType", "CmsContent");
|
||||
params.put("dataType", "cmsContent");
|
||||
String jsonString = HttpCloseableClientUtil.post(uri, params);
|
||||
System.out.println(jsonString);
|
||||
}
|
||||
|
|
|
@ -1,21 +1,11 @@
|
|||
package com.foresee.KnowledgeBase.controller;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Controller;
|
||||
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 com.foresee.KnowledgeBase.mapper.CmsUserSearchHistoryMapper;
|
||||
import com.foresee.KnowledgeBase.pojo.CmsUserSearchHistory;
|
||||
import com.foresee.KnowledgeBase.service.IUserSearchHistory;
|
||||
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
|
@ -23,27 +13,9 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||
@RequestMapping(value="/test")
|
||||
public class TestController {
|
||||
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
|
||||
@Autowired
|
||||
private IUserSearchHistory userSearchHistoryService;
|
||||
|
||||
@GetMapping(value="/sayHello.do")
|
||||
public String sayHello(HttpServletRequest request, HttpServletResponse response) {
|
||||
/*String value = (String) redisTemplate.opsForValue().get("testRedis");
|
||||
if(value==null) {
|
||||
redisTemplate.opsForValue().set("testRedis", "success");
|
||||
}else {
|
||||
redisTemplate.opsForValue().set("testRedis", "clean");
|
||||
}*/
|
||||
CmsUserSearchHistory cmsUserSearchHistory = new CmsUserSearchHistory();
|
||||
cmsUserSearchHistory.setId(UUID.randomUUID().toString().replaceAll("-", ""));
|
||||
cmsUserSearchHistory.setSearchText("sayHello");
|
||||
cmsUserSearchHistory.setUserId("is me");
|
||||
cmsUserSearchHistory.setCreateDate(new Date());
|
||||
userSearchHistoryService.insert(cmsUserSearchHistory);
|
||||
return "hello ";
|
||||
return "hello";
|
||||
}
|
||||
|
||||
@PostMapping(value="/sayHello2.do")
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
package com.foresee.KnowledgeBase.mapper;
|
||||
|
||||
import com.foresee.KnowledgeBase.pojo.CmsUserSearchHistory;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CmsUserSearchHistoryMapper {
|
||||
int deleteByPrimaryKey(String id);
|
||||
|
||||
int insert(CmsUserSearchHistory record);
|
||||
|
||||
CmsUserSearchHistory selectByPrimaryKey(String id);
|
||||
|
||||
List<CmsUserSearchHistory> selectAll();
|
||||
|
||||
int updateByPrimaryKey(CmsUserSearchHistory record);
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.foresee.KnowledgeBase.mapper;
|
||||
|
||||
import com.foresee.KnowledgeBase.pojo.CmsWord;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CmsWordMapper {
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(CmsWord record);
|
||||
|
||||
CmsWord selectByPrimaryKey(Long id);
|
||||
|
||||
List<CmsWord> selectAll();
|
||||
|
||||
int updateByPrimaryKey(CmsWord record);
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
package com.foresee.KnowledgeBase.pojo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class CmsUserSearchHistory {
|
||||
private String id;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String searchText;
|
||||
|
||||
private Date createDate;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id == null ? null : id.trim();
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId == null ? null : userId.trim();
|
||||
}
|
||||
|
||||
public String getSearchText() {
|
||||
return searchText;
|
||||
}
|
||||
|
||||
public void setSearchText(String searchText) {
|
||||
this.searchText = searchText == null ? null : searchText.trim();
|
||||
}
|
||||
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
package com.foresee.KnowledgeBase.pojo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class CmsWord {
|
||||
private Long id;
|
||||
|
||||
private Integer siteId;
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer searchCount;
|
||||
|
||||
private Boolean hidden;
|
||||
|
||||
private String ip;
|
||||
|
||||
private Date createDate;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(Integer siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
public Integer getSearchCount() {
|
||||
return searchCount;
|
||||
}
|
||||
|
||||
public void setSearchCount(Integer searchCount) {
|
||||
this.searchCount = searchCount;
|
||||
}
|
||||
|
||||
public Boolean getHidden() {
|
||||
return hidden;
|
||||
}
|
||||
|
||||
public void setHidden(Boolean hidden) {
|
||||
this.hidden = hidden;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip == null ? null : ip.trim();
|
||||
}
|
||||
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package com.foresee.KnowledgeBase.service;
|
||||
|
||||
import com.foresee.KnowledgeBase.pojo.CmsUserSearchHistory;
|
||||
|
||||
public interface IUserSearchHistory {
|
||||
|
||||
void insert(CmsUserSearchHistory record);
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package com.foresee.KnowledgeBase.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.foresee.KnowledgeBase.mapper.CmsUserSearchHistoryMapper;
|
||||
import com.foresee.KnowledgeBase.pojo.CmsUserSearchHistory;
|
||||
import com.foresee.KnowledgeBase.service.IUserSearchHistory;
|
||||
|
||||
@Service
|
||||
public class UserSearchHistoryService implements IUserSearchHistory{
|
||||
|
||||
@Autowired
|
||||
CmsUserSearchHistoryMapper cmsUserSearchHistoryMapper;
|
||||
|
||||
@Override
|
||||
public void insert(CmsUserSearchHistory record) {
|
||||
// TODO Auto-generated method stub
|
||||
cmsUserSearchHistoryMapper.insert(record);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,36 +1,2 @@
|
|||
spring.application.name=KnowledgeBase
|
||||
server.port=${port:8081}
|
||||
|
||||
# Redis数据库索引(默认为0)
|
||||
spring.data.redis.database=0
|
||||
# Redis服务器地址
|
||||
spring.data.redis.host=127.0.0.1
|
||||
# Redis服务器连接端口
|
||||
spring.data.redis.port=6379
|
||||
# Redis服务器连接密码(默认为空)
|
||||
spring.data.redis.password=
|
||||
# 连接池最大连接数(使用负值表示没有限制)
|
||||
spring.data.redis.jedis.pool.max-active=8
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
spring.data.redis.jedis.pool.max-wait=-1ms
|
||||
# 连接池中的最大空闲连接
|
||||
spring.data.redis.jedis.pool.max-idle=8
|
||||
# 连接池中的最小空闲连接
|
||||
spring.data.redis.jedis.pool.min-idle=0
|
||||
# 连接超时时间(毫秒)
|
||||
spring.data.redis.timeout=5000ms
|
||||
|
||||
|
||||
#MySQL
|
||||
#spring.datasource.url=jdbc:mysql://10.10.152.6:3307/db_swglpt_test
|
||||
#spring.datasource.username=swglpt
|
||||
#spring.datasource.password=Sjc*(xn29
|
||||
|
||||
spring.datasource.url=jdbc:mysql://172.16.140.11:3306/zsktest
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=Nl^PWMe5n*34
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
|
||||
#MyBatis
|
||||
mybatis.mapper-locations=classpath:/mybatis/*.xml
|
||||
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
<?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="com.foresee.KnowledgeBase.mapper.CmsUserSearchHistoryMapper">
|
||||
<resultMap id="BaseResultMap" type="com.foresee.KnowledgeBase.pojo.CmsUserSearchHistory">
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="search_text" jdbcType="VARCHAR" property="searchText" />
|
||||
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
|
||||
</resultMap>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from cms_user_search_history
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.foresee.KnowledgeBase.pojo.CmsUserSearchHistory">
|
||||
insert into cms_user_search_history (id, user_id, search_text,
|
||||
create_date)
|
||||
values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{searchText,jdbcType=VARCHAR},
|
||||
#{createDate,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<update id="updateByPrimaryKey" parameterType="com.foresee.KnowledgeBase.pojo.CmsUserSearchHistory">
|
||||
update cms_user_search_history
|
||||
set user_id = #{userId,jdbcType=VARCHAR},
|
||||
search_text = #{searchText,jdbcType=VARCHAR},
|
||||
create_date = #{createDate,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select id, user_id, search_text, create_date
|
||||
from cms_user_search_history
|
||||
where id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select id, user_id, search_text, create_date
|
||||
from cms_user_search_history
|
||||
</select>
|
||||
</mapper>
|
|
@ -1,44 +0,0 @@
|
|||
<?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="com.foresee.KnowledgeBase.mapper.CmsWordMapper">
|
||||
<resultMap id="BaseResultMap" type="com.foresee.KnowledgeBase.pojo.CmsWord">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="site_id" jdbcType="INTEGER" property="siteId" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="search_count" jdbcType="INTEGER" property="searchCount" />
|
||||
<result column="hidden" jdbcType="BIT" property="hidden" />
|
||||
<result column="ip" jdbcType="VARCHAR" property="ip" />
|
||||
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
|
||||
</resultMap>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from cms_word
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.foresee.KnowledgeBase.pojo.CmsWord">
|
||||
insert into cms_word (id, site_id, name,
|
||||
search_count, hidden, ip,
|
||||
create_date)
|
||||
values (#{id,jdbcType=BIGINT}, #{siteId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
|
||||
#{searchCount,jdbcType=INTEGER}, #{hidden,jdbcType=BIT}, #{ip,jdbcType=VARCHAR},
|
||||
#{createDate,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<update id="updateByPrimaryKey" parameterType="com.foresee.KnowledgeBase.pojo.CmsWord">
|
||||
update cms_word
|
||||
set site_id = #{siteId,jdbcType=INTEGER},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
search_count = #{searchCount,jdbcType=INTEGER},
|
||||
hidden = #{hidden,jdbcType=BIT},
|
||||
ip = #{ip,jdbcType=VARCHAR},
|
||||
create_date = #{createDate,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select id, site_id, name, search_count, hidden, ip, create_date
|
||||
from cms_word
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
select id, site_id, name, search_count, hidden, ip, create_date
|
||||
from cms_word
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue