Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解决扫描不到包的问题,以及数据库连接问题 #9

Merged
merged 1 commit into from
Oct 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void doScan() {
long start=System.currentTimeMillis();
offlineTaskScanService.scanTask();
long end =System.currentTimeMillis();
log.info("OfflineTaskJob end. time:{}ms",end-start);
log.info("OfflineTaskJob end. time:{}ms\n",end-start);

}
}
6 changes: 6 additions & 0 deletions common-offline-task-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
<artifactId>common-offline-task-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.storm.commons</groupId>
<artifactId>common-offline-task-service</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

</dependencies>

<build>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.storm.commons.commonofflinetaskweb;
package org.storm.commons.offlinetask;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.storm.commons.commonofflinetaskweb;
package org.storm.commons.offlinetask;

import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package org.storm.commons.offlinetask.controllers;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.storm.commons.offlinetask.MyApi;
import org.storm.commons.offlinetask.api.OfflineTaskManageApi;
import org.storm.commons.offlinetask.api.OfflineTaskScanApi;
import org.storm.commons.offlinetask.domain.OfflineTaskDTO;

import javax.annotation.Resource;

@RestController
@RequestMapping("/demo")
@Slf4j
public class DemoControllers {

@Autowired
private MyApi myApi;

@Autowired
private OfflineTaskManageApi offlineTaskManageApi;

@Autowired
private OfflineTaskScanApi offlineTaskScanApi;

/**
* http://localhost:8080/demo/getMyApiName
* @return myApiImpl
*/
@GetMapping("/getMyApiName")
String getMyApiName() {
String myApiName = myApi.getName();
log.info(myApiName);
if(offlineTaskManageApi != null){
OfflineTaskDTO offlineTaskDTO = offlineTaskManageApi.selectById(1L);
log.info("offlineTaskDTO:{}", JSON.toJSONString(offlineTaskDTO));
}
if(offlineTaskScanApi != null){
log.info("offlineTaskDTO:{}", JSON.toJSONString(offlineTaskScanApi));
}

return myApiName;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.storm.commons.commonofflinetaskweb.service.impl;
package org.storm.commons.offlinetask.service.impl;

import org.springframework.stereotype.Service;
import org.storm.commons.offlinetask.MyApi;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ server.port=8080

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/myDB?characterEncoding=UTF-8&useSSL=false
spring.datasource.username=liy
spring.datasource.username=liyue
spring.datasource.password=123456

spring.aop.proxy-target-class=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.storm.commons.commonofflinetaskweb;
package org.storm.commons.offlinetask;

import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Assertions;
Expand All @@ -7,7 +7,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.storm.commons.offlinetask.MyApi;

@RunWith(SpringRunner.class)
@SpringBootTest
Expand Down