TASK:配置文件;

This commit is contained in:
shahaibo
2024-05-17 17:59:04 +08:00
parent b3591f879d
commit e634481113
5 changed files with 74 additions and 74 deletions

View File

@@ -154,63 +154,63 @@ public class GenerateConsumer {
} }
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) // @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
@RabbitHandler // @RabbitHandler
public void generateConsumer1(Message msg, Channel channel) { // public void generateConsumer1(Message msg, Channel channel) {
generate(msg, channel, "consumer 1"); // generate(msg, channel, "consumer 1");
} // }
//
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) // @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
@RabbitHandler // @RabbitHandler
public void generateConsumer2(Message msg, Channel channel) { // public void generateConsumer2(Message msg, Channel channel) {
generate(msg, channel, "consumer 2"); // generate(msg, channel, "consumer 2");
} // }
//
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) // @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
@RabbitHandler // @RabbitHandler
public void generateConsumer3(Message msg, Channel channel) { // public void generateConsumer3(Message msg, Channel channel) {
generate(msg, channel, "consumer 3"); // generate(msg, channel, "consumer 3");
} // }
//
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) // @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
@RabbitHandler // @RabbitHandler
public void generateConsumer4(Message msg, Channel channel) { // public void generateConsumer4(Message msg, Channel channel) {
generate(msg, channel, "consumer 4"); // generate(msg, channel, "consumer 4");
} // }
//
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) // @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
@RabbitHandler // @RabbitHandler
public void generateConsumer5(Message msg, Channel channel) { // public void generateConsumer5(Message msg, Channel channel) {
generate(msg, channel, "consumer 5"); // generate(msg, channel, "consumer 5");
} // }
//
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) // @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
@RabbitHandler // @RabbitHandler
public void generateConsumer6(Message msg, Channel channel) { // public void generateConsumer6(Message msg, Channel channel) {
generate(msg, channel, "consumer 6"); // generate(msg, channel, "consumer 6");
} // }
//
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) // @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
@RabbitHandler // @RabbitHandler
public void generateConsumer7(Message msg, Channel channel) { // public void generateConsumer7(Message msg, Channel channel) {
generate(msg, channel, "consumer 7"); // generate(msg, channel, "consumer 7");
} // }
//
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) // @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
@RabbitHandler // @RabbitHandler
public void generateConsumer8(Message msg, Channel channel) { // public void generateConsumer8(Message msg, Channel channel) {
generate(msg, channel, "consumer 8"); // generate(msg, channel, "consumer 8");
} // }
//
@RabbitListener(queues = MQConfig.GENERATE_QUEUE) // @RabbitListener(queues = MQConfig.GENERATE_QUEUE)
@RabbitHandler // @RabbitHandler
public void generateConsumer9(Message msg, Channel channel) { // public void generateConsumer9(Message msg, Channel channel) {
generate(msg, channel, "consumer 9"); // generate(msg, channel, "consumer 9");
} // }
//
@RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE) // @RabbitListener(queues = MQConfig.GENERATE_RESULT_QUEUE)
@RabbitHandler // @RabbitHandler
public void getGenerateResult(Message msg, Channel channel) { // public void getGenerateResult(Message msg, Channel channel) {
processGenerateResult(msg, channel); // processGenerateResult(msg, channel);
} // }
} }

View File

@@ -218,17 +218,17 @@ public class SRConsumer {
taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null); taskListService.updateTaskStatusOrOutputRedis(uniqueId, "fail", null);
} }
@RabbitListener(queues = MQConfig.SR_QUEUE) // @RabbitListener(queues = MQConfig.SR_QUEUE)
@RabbitHandler // @RabbitHandler
public void SRConsumer1(Message msg, Channel channel) { // public void SRConsumer1(Message msg, Channel channel) {
superResolution(msg, channel, "consumer 1"); // superResolution(msg, channel, "consumer 1");
} // }
//
//
@RabbitListener(queues = MQConfig.SR_RESULT_QUEUE) // @RabbitListener(queues = MQConfig.SR_RESULT_QUEUE)
@RabbitHandler // @RabbitHandler
public void SRResultConsumer1(Message msg, Channel channel) { // public void SRResultConsumer1(Message msg, Channel channel) {
getSRResult(msg, channel, "consumer 1"); // getSRResult(msg, channel, "consumer 1");
} // }
} }

View File

@@ -8,7 +8,7 @@ import org.springframework.stereotype.Component;
@Slf4j @Slf4j
public class GenerateTask { public class GenerateTask {
@Scheduled(cron = "0 0 */1 * * ?") // @Scheduled(cron = "0 0 */1 * * ?")
public void generateScheduled(){ public void generateScheduled(){
log.info("测试定时器generate"); log.info("测试定时器generate");

View File

@@ -23,7 +23,7 @@ public class PaypalTask {
@Resource @Resource
private PayPalCheckoutService payPalCheckoutService; private PayPalCheckoutService payPalCheckoutService;
@Scheduled(cron = "0/30 * * * * ?") // @Scheduled(cron = "0/30 * * * * ?")
public void orderConfirm() throws SerializeException { public void orderConfirm() throws SerializeException {
log.info("PayPal orderConfirm 被执行......"); log.info("PayPal orderConfirm 被执行......");

View File

@@ -21,7 +21,7 @@ spring.security.jwtExpiration=8640000000
#spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource #spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource
spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\ spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\
/api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/**,\ /api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/**,\
/api/product/**,/api/ali-pay/**,/api/order-info/**,/api/paypal/**,/api/credits/**,/api/inquiry/**,/api/tasks/**,/api/python/prepareForSR /api/product/**,/api/ali-pay/**,/api/order-info/**,/api/paypal/**,/api/credits/**,/api/inquiry/**,/api/tasks/**,/api/python/prepareForSR,/api/portfolio/**
spring.security.authApi=/auth/login spring.security.authApi=/auth/login