Commit 0e27fb58 by guo_minglei@163.com

admin添加运行信息

parent 13143559
...@@ -53,6 +53,10 @@ ...@@ -53,6 +53,10 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.byit.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@Configuration
public class RedisConfig {
@Bean
StringRedisTemplate stringRedisTemplate(RedisConnectionFactory connectionFactory){
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(connectionFactory);
stringRedisTemplate.setDefaultSerializer(new StringRedisSerializer());
return stringRedisTemplate;
}
}
...@@ -2,12 +2,14 @@ package com.byit.service.impl; ...@@ -2,12 +2,14 @@ package com.byit.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.byit.dto.plugin.RunLog;
import com.byit.dto.plugin.RunNode; import com.byit.dto.plugin.RunNode;
import com.byit.enums.NodePropertyEnum; import com.byit.enums.NodePropertyEnum;
import com.byit.mapper.JobTaskScheduleMapper; import com.byit.mapper.JobTaskScheduleMapper;
import com.byit.model.JobTaskSchedule; import com.byit.model.JobTaskSchedule;
import com.byit.service.ApiNodeService; import com.byit.service.ApiNodeService;
import com.byit.utils.ValidationUtil; import com.byit.utils.ValidationUtil;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -23,6 +25,9 @@ public class ApiNodeServiceImpl implements ApiNodeService { ...@@ -23,6 +25,9 @@ public class ApiNodeServiceImpl implements ApiNodeService {
@Resource @Resource
private JobTaskScheduleMapper jobTaskScheduleMapper; private JobTaskScheduleMapper jobTaskScheduleMapper;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Override @Override
public String runNode(String param) { public String runNode(String param) {
...@@ -50,6 +55,9 @@ public class ApiNodeServiceImpl implements ApiNodeService { ...@@ -50,6 +55,9 @@ public class ApiNodeServiceImpl implements ApiNodeService {
jobTaskScheduleMapper.saveJobTaskSchedule(schedule); jobTaskScheduleMapper.saveJobTaskSchedule(schedule);
RunLog runLog = RunLog.builder().isEnd(false).runLog("等待服务器分配资源").build();
stringRedisTemplate.convertAndSend(runId, JSON.toJSONString(runLog));
return runId; return runId;
} }
} }
...@@ -14,6 +14,18 @@ spring: ...@@ -14,6 +14,18 @@ spring:
properties: properties:
from: huangfusuper@163.com from: huangfusuper@163.com
redis:
database: 0
host: 10.0.120.218
port: 6379
password:
pool:
max-active: 8
max-wait: 30
max-idle: 8
min-idle: 0
timeout: 60000
mybatis: mybatis:
mapper-locations: /mapper/*.xml mapper-locations: /mapper/*.xml
...@@ -38,4 +50,6 @@ file: ...@@ -38,4 +50,6 @@ file:
port: 88 port: 88
myth-job: myth-job:
filestystem: FASTDFS filestystem: FASTDFS
\ No newline at end of file
...@@ -14,6 +14,18 @@ spring: ...@@ -14,6 +14,18 @@ spring:
properties: properties:
from: huangfusuper@163.com from: huangfusuper@163.com
redis:
database: 0
host: 10.0.120.218
port: 6379
password:
pool:
max-active: 8
max-wait: 30
max-idle: 8
min-idle: 0
timeout: 60000
mybatis: mybatis:
mapper-locations: /mapper/*.xml mapper-locations: /mapper/*.xml
......
...@@ -14,6 +14,18 @@ spring: ...@@ -14,6 +14,18 @@ spring:
properties: properties:
from: huangfusuper@163.com from: huangfusuper@163.com
redis:
database: 0
host: ${Redis_IP}
port: ${Redis_port}
password:
pool:
max-active: 8
max-wait: 30
max-idle: 8
min-idle: 0
timeout: 60000
mybatis: mybatis:
mapper-locations: /mapper/*.xml mapper-locations: /mapper/*.xml
......
...@@ -14,6 +14,18 @@ spring: ...@@ -14,6 +14,18 @@ spring:
properties: properties:
from: huangfusuper@163.com from: huangfusuper@163.com
redis:
database: 0
host: ${Redis_IP}
port: ${Redis_port}
password:
pool:
max-active: 8
max-wait: 30
max-idle: 8
min-idle: 0
timeout: 60000
mybatis: mybatis:
mapper-locations: /mapper/*.xml mapper-locations: /mapper/*.xml
......
...@@ -11,9 +11,9 @@ public class RedisConfig { ...@@ -11,9 +11,9 @@ public class RedisConfig {
@Bean @Bean
StringRedisTemplate stringRedisTemplate(RedisConnectionFactory connectionFactory){ StringRedisTemplate stringRedisTemplate(RedisConnectionFactory connectionFactory){
// StringRedisTemplate stringRedisTemplate = new StringRedisTemplate(); StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
// stringRedisTemplate.setConnectionFactory(connectionFactory); stringRedisTemplate.setConnectionFactory(connectionFactory);
// stringRedisTemplate.setDefaultSerializer(new StringRedisSerializer()); stringRedisTemplate.setDefaultSerializer(new StringRedisSerializer());
return new StringRedisTemplate(connectionFactory); return stringRedisTemplate;
} }
} }
...@@ -20,7 +20,7 @@ myth-job: ...@@ -20,7 +20,7 @@ myth-job:
spring: spring:
redis: redis:
database: 0 database: 0
host: 10.0.101.133 host: 10.0.120.218
port: 6379 port: 6379
password: password:
pool: pool:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment