haungxing
5 months ago
18 changed files with 214 additions and 84 deletions
@ -1,39 +1,31 @@ |
|||||||
package com.hnac.hzims.bigmodel; |
package com.hnac.hzims.bigmodel; |
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j; |
|
||||||
import org.mybatis.spring.annotation.MapperScan; |
import org.mybatis.spring.annotation.MapperScan; |
||||||
import org.springblade.core.cloud.feign.EnableBladeFeign; |
import org.springblade.core.cloud.feign.EnableBladeFeign; |
||||||
import org.springblade.core.jwt.JwtUtil; |
|
||||||
import org.springblade.core.launch.BladeApplication; |
import org.springblade.core.launch.BladeApplication; |
||||||
|
import org.springframework.boot.SpringApplication; |
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||||
import org.springframework.boot.builder.SpringApplicationBuilder; |
import org.springframework.boot.builder.SpringApplicationBuilder; |
||||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
||||||
import org.springframework.cloud.client.SpringCloudApplication; |
import org.springframework.cloud.client.SpringCloudApplication; |
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients; |
||||||
import org.springframework.context.annotation.ComponentScan; |
import org.springframework.context.annotation.ComponentScan; |
||||||
import org.springframework.data.redis.core.RedisTemplate; |
import org.springframework.scheduling.annotation.EnableScheduling; |
||||||
|
|
||||||
import javax.annotation.Resource; |
import javax.annotation.Resource; |
||||||
|
|
||||||
import static com.hnac.hzims.bigmodel.schedule.XxlJobHandlerConstant.HZIMS_BIGMODEL_ASK_KEY; |
@SpringBootApplication(scanBasePackages = {"org.springblade", "com.hnac.*"}) |
||||||
|
@MapperScan(basePackages = {"com.hnac.hzinfo.**.mapper","com.hnac.hzims.**.mapper"}) |
||||||
@EnableBladeFeign(basePackages = {"org.springblade","com.hnac"}) |
@EnableFeignClients(basePackages = {"org.springblade", "com.hnac"}) |
||||||
@SpringCloudApplication |
public class HzimsBigModelApplication { |
||||||
@MapperScan("com.hnac.hzims.**.mapper.**") |
|
||||||
@Resource |
|
||||||
@ComponentScan(basePackages = {"com.hnac.hzims.**"}) |
|
||||||
@Slf4j |
|
||||||
public class HzimsBigModelApplication extends SpringBootServletInitializer { |
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) { |
public static void main(String[] args) { |
||||||
BladeApplication.run(BigModelConstants.APP_NAME, HzimsBigModelApplication.class, args); |
BladeApplication.run(BigModelConstants.APP_NAME, HzimsBigModelApplication.class, args); |
||||||
RedisTemplate<String, Object> redisTemplate = JwtUtil.getRedisTemplate(); |
|
||||||
redisTemplate.delete(HZIMS_BIGMODEL_ASK_KEY); |
|
||||||
log.info("服务重启删除问题reids缓存:{}",HZIMS_BIGMODEL_ASK_KEY); |
|
||||||
} |
} |
||||||
|
|
||||||
@Override |
// @Override
|
||||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { |
// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||||
return BladeApplication.createSpringApplicationBuilder(builder, BigModelConstants.APP_NAME, HzimsBigModelApplication.class); |
// return BladeApplication.createSpringApplicationBuilder(builder, BigModelConstants.APP_NAME, HzimsBigModelApplication.class);
|
||||||
} |
// }
|
||||||
|
|
||||||
} |
} |
||||||
|
@ -0,0 +1,27 @@ |
|||||||
|
package com.hnac.hzims.bigmodel.configuration; |
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.boot.CommandLineRunner; |
||||||
|
import org.springframework.data.redis.core.RedisTemplate; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
import static com.hnac.hzims.bigmodel.schedule.XxlJobHandlerConstant.HZIMS_BIGMODEL_ASK_KEY; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author: huangxing |
||||||
|
* @Date: 2024/07/12 09:23 |
||||||
|
*/ |
||||||
|
@Component |
||||||
|
@Slf4j |
||||||
|
public class RedisKeyDeleter implements CommandLineRunner { |
||||||
|
@Autowired |
||||||
|
private RedisTemplate<String, Object> redisTemplate; |
||||||
|
|
||||||
|
@Override |
||||||
|
public void run(String... args) throws Exception { |
||||||
|
// 删除指定的Redis key
|
||||||
|
redisTemplate.delete(HZIMS_BIGMODEL_ASK_KEY); |
||||||
|
log.info("服务重启删除问题reids缓存:{}",HZIMS_BIGMODEL_ASK_KEY); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,75 @@ |
|||||||
|
#服务器端口 |
||||||
|
server: |
||||||
|
port: 8135 |
||||||
|
|
||||||
|
#oss配置 |
||||||
|
oss: |
||||||
|
endpoint: "${hzinfo.oss.endpoint}" |
||||||
|
access-key: "${hzinfo.oss.access-key}" |
||||||
|
secret-key: "${hzinfo.oss.secret-key}" |
||||||
|
|
||||||
|
#数据源配置 |
||||||
|
spring: |
||||||
|
#排除DruidDataSourceAutoConfigure |
||||||
|
autoconfigure: |
||||||
|
exclude: com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
||||||
|
datasource: |
||||||
|
url: jdbc:mysql://${hzinfo.db.busines.ip}:${hzinfo.db.busines.port}/prod_hzims_big_model?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true |
||||||
|
username: ${hzinfo.db.busines.username} |
||||||
|
password: ${hzinfo.db.busines.password} |
||||||
|
redis: |
||||||
|
# redis数据库索引(默认为0),我们使用索引为0的数据库,避免和其他数据库冲突 |
||||||
|
database: 2 |
||||||
|
# redis服务器地址(默认为localhost) |
||||||
|
host: 192.168.60.29 |
||||||
|
# redis端口(默认为6379) |
||||||
|
port: 3577 |
||||||
|
# redis访问密码(默认为空) |
||||||
|
password: 1qaz2WSX@redis |
||||||
|
|
||||||
|
|
||||||
|
fdp: |
||||||
|
host: http://192.168.60.16:9997 |
||||||
|
url: |
||||||
|
assistantAsk: /qa/assistant_ask |
||||||
|
assistantStatus: /qa/assistant_status |
||||||
|
askAbort: /qa/ask_abort |
||||||
|
updateVideo: /kn/update_video |
||||||
|
updateCanvas: /kn/update_canvas |
||||||
|
updateFault: /kn/update_fault |
||||||
|
assistantSpecialAsk: /qa/assistant_special_ask |
||||||
|
assistantKnowledgeAsk: /qa/assistant_knowledge_ask |
||||||
|
hotQuestion: /qa/question_recommand |
||||||
|
xxl: |
||||||
|
job: |
||||||
|
accessToken: '' |
||||||
|
admin: |
||||||
|
addresses: http://192.168.60.104:7009/xxl-job-admin |
||||||
|
executor: |
||||||
|
appname: hzims-big-model |
||||||
|
ip: 172.31.0.174 |
||||||
|
logpath: /data/applogs/xxl-job/jobhandler |
||||||
|
logretentiondays: 7 |
||||||
|
port: 28135 |
||||||
|
|
||||||
|
blade: |
||||||
|
data: |
||||||
|
sdk: |
||||||
|
enabled: true |
||||||
|
url: http://192.168.60.29/api/hzinfo-data-config |
||||||
|
ctrlUrl: http://192.168.60.29/api/hzinfo-data-handler |
||||||
|
scadaUrl: http://192.168.60.29/api/hzinfo-data-scada |
||||||
|
appId: '1635888805125099521' |
||||||
|
appSecret: f4b6a4dc696b36445d2e5d38bbab2417 |
||||||
|
redisIp: 192.168.60.34 |
||||||
|
redisPort: 3577 |
||||||
|
password: L_MM&h=+Nm&p)U9sk.uH |
||||||
|
maxKeys: 1000 |
||||||
|
data-scope: |
||||||
|
enabled: false |
||||||
|
lock: |
||||||
|
enabled: true |
||||||
|
address: redis://192.168.60.29:3577 |
||||||
|
password: 1qaz2WSX@redis |
||||||
|
database: 0 |
||||||
|
ssl: false |
Loading…
Reference in new issue