feat:机器人消息模板接口联调
This commit is contained in:
parent
e7f246acd3
commit
6590df3c04
@ -1,5 +1,6 @@
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\feign\AccountApi.java
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\feign\RobotTagApi.java
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\vo\req\RobotMsgTemplatePageQuery.java
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\feign\MessageApi.java
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\vo\resp\UserAccountResp.java
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\vo\resp\MsgTemplateResp.java
|
||||
@ -11,7 +12,6 @@ D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\vo\req\UpdateRobo
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\vo\resp\MessageDispatchResp.java
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\vo\req\RobotMsgTemplateReq.java
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\vo\req\RobotAccountReq.java
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\vo\req\MsgTemplatePageQuery.java
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\vo\req\UserAccountReq.java
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\vo\resp\MessageTemplateResp.java
|
||||
D:\im-center\im-center-api\src\main\java\cn\axzo\im\center\api\vo\req\RobotTagReq.java
|
||||
|
||||
@ -14,8 +14,17 @@ import org.apache.commons.lang3.StringUtils;
|
||||
@Getter
|
||||
public enum AppTypeEnum {
|
||||
|
||||
/**
|
||||
* 工人端
|
||||
*/
|
||||
WORKER("cm", "工人端"),
|
||||
/**
|
||||
* 企业管理端
|
||||
*/
|
||||
ENTERPRISE("cmp", "企业管理端"),
|
||||
/**
|
||||
* 服务器 机器人
|
||||
*/
|
||||
SYSTEM("system", "服务器");
|
||||
|
||||
|
||||
|
||||
@ -68,6 +68,43 @@
|
||||
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:3.0.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-core:10.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:10.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.xuxueli:xxl-job-core:2.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-dns:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-haproxy:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http2:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-memcache:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-mqtt:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-redis:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-smtp:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-socks:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-stomp:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-xml:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler-proxy:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-rxtx:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-sctp:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-udt:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-epoll:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-kqueue:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns-classes-macos:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-x86_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-aarch_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-x86_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-aarch_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-x86_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-aarch_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.5.15" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.32" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.axzo.framework:axzo-web-spring-boot-starter:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.axzo.framework:axzo-spring-boot-starter:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.axzo.framework.jackson:jackson-starter:1.0.0-SNAPSHOT" level="project" />
|
||||
@ -191,21 +228,12 @@
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjrt:1.9.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.redisson:redisson-spring-boot-starter:3.15.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.redisson:redisson:3.15.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-dns:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.cache:cache-api:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.reactivex.rxjava3:rxjava:3.0.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.marshalling:jboss-marshalling-river:2.0.11.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.marshalling:jboss-marshalling:2.0.11.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.32" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.12.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.22" level="project" />
|
||||
@ -261,31 +289,6 @@
|
||||
<orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-common:4.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-acl:4.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-remoting:4.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-haproxy:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-http2:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-memcache:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-mqtt:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-redis:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-smtp:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-socks:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-stomp:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec-xml:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler-proxy:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-rxtx:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-sctp:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-udt:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-epoll:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport-classes-kqueue:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver-dns-classes-macos:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-x86_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-epoll:linux-aarch_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-x86_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-transport-native-kqueue:osx-aarch_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-x86_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: io.netty:netty-resolver-dns-native-macos:osx-aarch_64:4.1.70.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-logging:4.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.rocketmq:rocketmq-srvutil:4.9.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-cli:commons-cli:1.2" level="project" />
|
||||
@ -333,7 +336,6 @@
|
||||
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.32" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.axzo.third:third-party-api:2.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.axzo.basics:basics-profiles-common:2.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.axzo.pudge:pudge-core:2.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.axzo.apollo:apollo-workspace-common:2.0.0-SNAPSHOT" level="project" />
|
||||
|
||||
@ -29,12 +29,10 @@
|
||||
<dependency>
|
||||
<groupId>cn.axzo.msgcenter</groupId>
|
||||
<artifactId>msg-center-api</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xuxueli</groupId>
|
||||
<artifactId>xxl-job-core</artifactId>
|
||||
<version>2.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework</groupId>
|
||||
|
||||
@ -1,44 +0,0 @@
|
||||
//package cn.axzo.im.job;
|
||||
//
|
||||
//import cn.axzo.outman.client.task.BaseJobHandler;
|
||||
//import cn.axzo.outman.common.constants.CommonConstants;
|
||||
//import cn.axzo.outman.service.api.TaskService;
|
||||
//import cn.azxo.framework.common.utils.LogUtil;
|
||||
//import com.xxl.job.core.biz.model.ReturnT;
|
||||
//import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//
|
||||
///**
|
||||
// * 百度访问令牌刷新定时任务
|
||||
// *
|
||||
// * @author zhaoyong
|
||||
// * @see BaiduAccessTokenRefreshJobHandler
|
||||
// * @since 2021-06-28 21:58
|
||||
// */
|
||||
//@Slf4j
|
||||
//@Component
|
||||
//public class BaiduAccessTokenRefreshJobHandler extends BaseJobHandler {
|
||||
//
|
||||
// @Resource(name = "taskService")
|
||||
// private TaskService taskService;
|
||||
//
|
||||
// @Override
|
||||
// @XxlJob("baiduAccessTokenRefreshJobHandler")
|
||||
// public ReturnT<String> execute(String param) throws Exception {
|
||||
// return jobLoggerTemplate.execute(CommonConstants.CTX_LOG_ID_MDC, () -> {
|
||||
// log.info("BaiduAccessTokenRefreshJobHandler.execute task Start ......");
|
||||
// try {
|
||||
// taskService.refreshBaiduAccessToken();
|
||||
// } catch (Exception e) {
|
||||
// LogUtil.error("BaiduAccessTokenRefreshJobHandler.execute is error", e);
|
||||
// return ReturnT.FAIL;
|
||||
// }
|
||||
// log.info("BaiduAccessTokenRefreshJobHandler.execute task End ......");
|
||||
// return ReturnT.SUCCESS;
|
||||
// });
|
||||
// }
|
||||
//
|
||||
//}
|
||||
@ -1,33 +1,33 @@
|
||||
//package cn.axzo.im.job;
|
||||
//
|
||||
//import cn.azxo.framework.common.logger.JobLoggerTemplate;
|
||||
//import cn.azxo.framework.common.service.JobParamResolver;
|
||||
//import com.xxl.job.core.biz.model.ReturnT;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//
|
||||
///**
|
||||
// * 基础定时任务
|
||||
// *
|
||||
// * @author zhaoyong
|
||||
// * @see BaseJobHandler
|
||||
// * @since 2021-06-23 18:32
|
||||
// */
|
||||
//public abstract class BaseJobHandler {
|
||||
//
|
||||
// @Resource(name = "jobLoggerTemplate")
|
||||
// protected JobLoggerTemplate jobLoggerTemplate;
|
||||
//
|
||||
// @Resource(name = "jobParamResolver")
|
||||
// protected JobParamResolver jobParamResolver;
|
||||
//
|
||||
// /**
|
||||
// * 定时任务执行逻辑
|
||||
// *
|
||||
// * @param param
|
||||
// * @return
|
||||
// * @throws Exception
|
||||
// */
|
||||
// public abstract ReturnT<String> execute(String param) throws Exception;
|
||||
//
|
||||
//}
|
||||
package cn.axzo.im.job;
|
||||
|
||||
import cn.azxo.framework.common.logger.JobLoggerTemplate;
|
||||
import cn.azxo.framework.common.service.JobParamResolver;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 基础定时任务
|
||||
*
|
||||
* @author zhaoyong
|
||||
* @see BaseJobHandler
|
||||
* @since 2021-06-23 18:32
|
||||
*/
|
||||
public abstract class BaseJobHandler {
|
||||
|
||||
@Resource(name = "jobLoggerTemplate")
|
||||
protected JobLoggerTemplate jobLoggerTemplate;
|
||||
|
||||
@Resource(name = "jobParamResolver")
|
||||
protected JobParamResolver jobParamResolver;
|
||||
|
||||
/**
|
||||
* 定时任务执行逻辑
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public abstract ReturnT<String> execute(String param) throws Exception;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
package cn.axzo.im.job;
|
||||
|
||||
import cn.azxo.framework.common.utils.LogUtil;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 百度访问令牌刷新定时任务
|
||||
*
|
||||
* @author zhaoyong
|
||||
* @see SyncImAccountJobHandler
|
||||
* @since 2021-06-28 21:58
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SyncImAccountJobHandler extends BaseJobHandler {
|
||||
/**
|
||||
* MDC 日志 KEY
|
||||
*/
|
||||
public static final String CTX_LOG_ID_MDC = "ctxLogId";
|
||||
|
||||
@Override
|
||||
@XxlJob("syncImAccountJobHandler")
|
||||
public ReturnT<String> execute(String param) throws Exception {
|
||||
return jobLoggerTemplate.execute(CTX_LOG_ID_MDC, () -> {
|
||||
log.info("SyncImAccountJobHandler.execute task Start ......");
|
||||
try {
|
||||
System.out.println("sync im account to user info");
|
||||
} catch (Exception e) {
|
||||
LogUtil.error("SyncImAccountJobHandler.execute is error", e);
|
||||
return ReturnT.FAIL;
|
||||
}
|
||||
log.info("SyncImAccountJobHandler.execute task End ......");
|
||||
return ReturnT.SUCCESS;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,70 +1,70 @@
|
||||
//package cn.axzo.im.job;
|
||||
//
|
||||
//import cn.azxo.framework.common.logger.JobLoggerTemplate;
|
||||
//import cn.azxo.framework.common.service.JobParamResolver;
|
||||
//import cn.azxo.framework.common.spring.condition.NonLocalEnvironment;
|
||||
//import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//
|
||||
///**
|
||||
// * Xxl Job Config
|
||||
// *
|
||||
// * @author zhaoyong
|
||||
// * @see XxlJobConfig
|
||||
// * @since 2021-06-23 18:28
|
||||
// */
|
||||
//@Slf4j
|
||||
//@Configuration
|
||||
//public class XxlJobConfig {
|
||||
//
|
||||
// @Value("${xxl.job.admin.addresses}")
|
||||
// private String adminAddresses;
|
||||
//
|
||||
// @Value("${xxl.job.executor.appName}")
|
||||
// private String appName;
|
||||
//
|
||||
// @Value("${xxl.job.executor.ip:}")
|
||||
// private String ip;
|
||||
//
|
||||
// @Value("${xxl.job.executor.port}")
|
||||
// private int port;
|
||||
//
|
||||
// @Value("${xxl.job.accessToken:}")
|
||||
// private String accessToken;
|
||||
//
|
||||
// @Value("${xxl.job.executor.logPath:}")
|
||||
// private String logPath;
|
||||
//
|
||||
// @Value("${xxl.job.executor.logRetentionDays}")
|
||||
// private int logRetentionDays;
|
||||
//
|
||||
// @Bean
|
||||
// @NonLocalEnvironment
|
||||
// public XxlJobSpringExecutor xxlJobExecutor() {
|
||||
// log.info(">>>>>>>>>>> axzo outman service xxl-job config init.");
|
||||
// XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
||||
// xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
|
||||
// xxlJobSpringExecutor.setAppname(appName);
|
||||
// xxlJobSpringExecutor.setIp(ip);
|
||||
// xxlJobSpringExecutor.setPort(port);
|
||||
// xxlJobSpringExecutor.setAccessToken(accessToken);
|
||||
// xxlJobSpringExecutor.setLogPath(logPath);
|
||||
// xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
|
||||
// return xxlJobSpringExecutor;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Bean("jobParamResolver")
|
||||
// public JobParamResolver jobParamResolver() {
|
||||
// return new JobParamResolver();
|
||||
// }
|
||||
//
|
||||
// @Bean("jobLoggerTemplate")
|
||||
// public JobLoggerTemplate jobLoggerTemplate() {
|
||||
// return new JobLoggerTemplate();
|
||||
// }
|
||||
//
|
||||
//}
|
||||
package cn.axzo.im.job;
|
||||
|
||||
import cn.azxo.framework.common.logger.JobLoggerTemplate;
|
||||
import cn.azxo.framework.common.service.JobParamResolver;
|
||||
import cn.azxo.framework.common.spring.condition.NonLocalEnvironment;
|
||||
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Xxl Job Config
|
||||
*
|
||||
* @author zhaoyong
|
||||
* @see XxlJobConfig
|
||||
* @since 2021-06-23 18:28
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class XxlJobConfig {
|
||||
|
||||
@Value("${xxl.job.admin.addresses}")
|
||||
private String adminAddresses;
|
||||
|
||||
@Value("${xxl.job.executor.appName}")
|
||||
private String appName;
|
||||
|
||||
@Value("${xxl.job.executor.ip:}")
|
||||
private String ip;
|
||||
|
||||
@Value("${xxl.job.executor.port}")
|
||||
private int port;
|
||||
|
||||
@Value("${xxl.job.accessToken:}")
|
||||
private String accessToken;
|
||||
|
||||
@Value("${xxl.job.executor.logPath:}")
|
||||
private String logPath;
|
||||
|
||||
@Value("${xxl.job.executor.logRetentionDays}")
|
||||
private int logRetentionDays;
|
||||
|
||||
@Bean
|
||||
@NonLocalEnvironment
|
||||
public XxlJobSpringExecutor xxlJobExecutor() {
|
||||
log.info("----axzo im-center service xxl-job config init---");
|
||||
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
||||
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
|
||||
xxlJobSpringExecutor.setAppname(appName);
|
||||
xxlJobSpringExecutor.setIp(ip);
|
||||
xxlJobSpringExecutor.setPort(port);
|
||||
xxlJobSpringExecutor.setAccessToken(accessToken);
|
||||
xxlJobSpringExecutor.setLogPath(logPath);
|
||||
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
|
||||
return xxlJobSpringExecutor;
|
||||
}
|
||||
|
||||
|
||||
@Bean("jobParamResolver")
|
||||
public JobParamResolver jobParamResolver() {
|
||||
return new JobParamResolver();
|
||||
}
|
||||
|
||||
@Bean("jobLoggerTemplate")
|
||||
public JobLoggerTemplate jobLoggerTemplate() {
|
||||
return new JobLoggerTemplate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -154,11 +154,11 @@ public class RobotInfoService {
|
||||
}
|
||||
|
||||
public PageResp<RobotInfoResp> queryRobotInfoList(RobotPageQuery robotInfoQuery) {
|
||||
IPage<RobotInfo> robotInfoIPage = robotInfoDao.queryRobotInfoOfPage(robotInfoQuery);
|
||||
List<RobotInfoResp> list = BeanMapper.copyList(robotInfoIPage.getRecords(), RobotInfoResp.class);
|
||||
PageResp<RobotInfoResp> pageOfRobotInfoResp = PageResp.list(robotInfoIPage.getCurrent(), robotInfoIPage.getSize(),
|
||||
robotInfoIPage.getTotal(), list);
|
||||
list.forEach(robotInfoResp -> {
|
||||
IPage<RobotInfo> robotInfoPage = robotInfoDao.queryRobotInfoOfPage(robotInfoQuery);
|
||||
List<RobotInfoResp> robotInfoRespList = BeanMapper.copyList(robotInfoPage.getRecords(), RobotInfoResp.class);
|
||||
PageResp<RobotInfoResp> pageOfRobotInfoResp = PageResp.list(robotInfoPage.getCurrent(), robotInfoPage.getSize(),
|
||||
robotInfoPage.getTotal(), robotInfoRespList);
|
||||
robotInfoRespList.forEach(robotInfoResp -> {
|
||||
RobotInfo robotInfo = robotInfoDao.lambdaQuery().eq(RobotInfo::getIsDelete, 0)
|
||||
.eq(RobotInfo::getId, robotInfoResp.getId()).one();
|
||||
if (robotInfo == null) {
|
||||
@ -173,7 +173,7 @@ public class RobotInfoService {
|
||||
robotTag.setUseCount(useCount);
|
||||
});
|
||||
});
|
||||
list.forEach(this::fillRobotRespOfMsgTemplate);
|
||||
robotInfoRespList.forEach(this::fillRobotRespOfMsgTemplate);
|
||||
return pageOfRobotInfoResp;
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,10 @@ import cn.axzo.im.dao.repository.RobotInfoDao;
|
||||
import cn.axzo.im.dao.repository.RobotMsgTemplateDao;
|
||||
import cn.axzo.im.entity.RobotInfo;
|
||||
import cn.axzo.im.entity.RobotMsgTemplate;
|
||||
import cn.axzo.msg.center.service.template.client.MessageTemplateClient;
|
||||
import cn.axzo.msg.center.service.template.response.MessageTemplatePageResponse;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import cn.azxo.framework.common.utils.StringUtils;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -19,7 +23,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 机器人消息模板服务
|
||||
@ -36,6 +42,10 @@ public class RobotMsgTemplateService {
|
||||
@Resource
|
||||
private RobotMsgTemplateDao robotMsgTemplateDao;
|
||||
|
||||
|
||||
@Resource
|
||||
private MessageTemplateClient messageTemplateClient;
|
||||
|
||||
@Resource
|
||||
private RobotInfoDao robotInfoDao;
|
||||
|
||||
@ -93,14 +103,25 @@ public class RobotMsgTemplateService {
|
||||
if (CollectionUtils.isEmpty(msgTemplateIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<RobotMsgTemplateResp> templateRespList = msgTemplateIds.stream().map(msgTemplateId -> {
|
||||
//TODO 根据msgTemplateId查询 显示排序问题
|
||||
RobotMsgTemplateResp template = new RobotMsgTemplateResp();
|
||||
template.setMsgTemplateId(msgTemplateId);
|
||||
template.setStatus("上架啦");
|
||||
return template;
|
||||
}).collect(Collectors.toList());
|
||||
return templateRespList;
|
||||
CommonResponse<List<MessageTemplatePageResponse>> commonResponse = messageTemplateClient.listByCodes(msgTemplateIds);
|
||||
List<MessageTemplatePageResponse> templatePageResponses = commonResponse.getData();
|
||||
if (CollectionUtils.isNotEmpty(templatePageResponses)) {
|
||||
List<RobotMsgTemplateResp> robotMsgTemplates = templatePageResponses.stream().map(messageTemplatePageResponse -> {
|
||||
RobotMsgTemplateResp robotMsgTemplateResp = new RobotMsgTemplateResp();
|
||||
|
||||
robotMsgTemplateResp.setMsgTemplateId(messageTemplatePageResponse.getTemplateCode());
|
||||
robotMsgTemplateResp.setStatus(messageTemplatePageResponse.getStatus().getDesc());
|
||||
robotMsgTemplateResp.setMsgCategory(StringUtils.join(messageTemplatePageResponse.getGroupNodeNamePaths(), "|"));
|
||||
robotMsgTemplateResp.setMsgContent(messageTemplatePageResponse.getContent());
|
||||
robotMsgTemplateResp.setMsgHeader(messageTemplatePageResponse.getTitle());
|
||||
robotMsgTemplateResp.setMsgType(messageTemplatePageResponse.getCategory().getMessage());
|
||||
robotMsgTemplateResp.setMsgName(messageTemplatePageResponse.getTemplateName());
|
||||
return robotMsgTemplateResp;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return robotMsgTemplates;
|
||||
}
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
public List<String> queryRobotIdByTemplate(String templateId) {
|
||||
|
||||
7
pom.xml
7
pom.xml
@ -54,8 +54,13 @@
|
||||
<dependency>
|
||||
<groupId>cn.axzo.msgcenter</groupId>
|
||||
<artifactId>msg-center-api</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xuxueli</groupId>
|
||||
<artifactId>xxl-job-core</artifactId>
|
||||
<version>2.2.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.axzo.im.center</groupId>
|
||||
<artifactId>im-center-common</artifactId>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user