Commit 0ea71217 authored by 陈家荣's avatar 陈家荣

remove dubbo service

parent 9f3732c9
package com.hdp.pi.config.kolon;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
@ConditionalOnProperty(value = "asConsumer")
@Configuration
@ImportResource(value = { "classpath:META-INF/spring/kolon-dubbo-consumer.xml" })
@PropertySource({ "classpath:kolon.${mode}.properties","classpath:kolon.properties" })
@Component("kolonDubboServiceConsumer")
public class DubboServiceConsumer {
}
package com.hdp.pi.config.kolon;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.stereotype.Component;
@ConditionalOnProperty(value = "asProvider")
@Configuration
@ImportResource(value = { "classpath:META-INF/spring/kolon-dubbo-provider.xml" })
@Component("kolonDubboServiceProvider")
public class DubboServiceProvider {
}
package com.hdp.pi.service.kolon;
public interface FtpService {
}
/**
*
*/
package com.hdp.pi.service.kolon;
import org.springframework.beans.factory.annotation.Value;
/**
* @author yangyw
*
*/
public class FtpServiceImpl implements FtpService {
@Value("${kolon.property.ftp.server}")
private String ftpServer;
@Value("${kolon.property.ftp.port}")
private Integer ftpPort;
@Value("${kolon.property.ftp.userName}")
private String ftpUserName;
@Value("${kolon.property.ftp.password}")
private String ftpPassword;
@Value("${kolon.property.ftp.splitFlag}")
private String ftpSplitFlag;
@Value("${kolon.property.ftp.fileName}")
private String ftpFileName;
}
......@@ -24,12 +24,8 @@ import com.hdp.pi.utils.kolon.Util;
* @author yangyw
*
*/
// @Transactional(readOnly = true)
public class KolonMemberServiceImpl implements KolonMemberService {
// private static final Logger logger = LoggerFactory.getLogger(KolonMemberServiceImpl.class);
@Autowired
private FtpUtil ftpUtil;
......
......@@ -8,29 +8,33 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.orm.jpa.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;
@Configuration
@ComponentScan(basePackages = { "com.hdp.pi.config.kolon", "com.hdp.pi.utils.kolon" })
@ComponentScan(basePackages = {"com.hdp.pi.utils.kolon","com.hdp.pi.api.kolon" })
@EnableAutoConfiguration
@PropertySource({ "classpath:kolon.${mode}.properties", "classpath:kolon.properties" })
@EnableJpaRepositories(value="com.hdp.pi.repository")
@PropertySource({ "classpath:kolon.${mode}.properties","classpath:kolon.properties" })
@EnableJpaRepositories(value = "com.hdp.pi.repository")
@EntityScan("com.hdp.pi.domain")
@ImportResource({ "classpath*:META-INF/spring/applicationContext.xml" })
@EnableScheduling
public class KolonStarter implements CommandLineRunner{
private static final Logger LOGGER = LoggerFactory.getLogger(KolonStarter.class);
public class KolonStarter implements CommandLineRunner {
private static final Logger LOGGER = LoggerFactory.getLogger(KolonStarter.class);
public static void main(String[] args) {
SpringApplication app = new SpringApplication(KolonStarter.class);
app.setWebEnvironment(true);
app.run(args);
}
@Override
public void run(String... args) throws Exception {
LOGGER.info("piplus-parent kolon服务已启动!");
Thread.currentThread().join();
}
public static void main(String[] args) {
SpringApplication app = new SpringApplication(KolonStarter.class);
app.setWebEnvironment(false);
app.run(args);
}
@Override
public void run(String... args) throws Exception {
LOGGER.info("piplus-parent kolon服务已启动!");
Thread.currentThread().join();
}
}
......@@ -15,7 +15,7 @@ import com.hdp.pi.service.baseservice.GlobalVariableService;
import com.hdp.pi.service.kolon.KolonMemberService;
@Component
public class FtpService {
public class FtpScheduledTask {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
......@@ -13,16 +13,14 @@
<!-- 用dubbo协议在20880端口暴露服务 -->
<dubbo:protocol name="dubbo" port="${kolon.dubbo.port}"
host="${dubbo.host}" />
<bean id="kolonMemberService" class="com.hdp.pi.service.kolon.KolonMemberServiceImpl" />
<dubbo:service timeout="10000"
interface="com.hdp.pi.service.kolon.KolonMemberService" ref="kolonMemberService"
version="1.0.0" />
<bean id="ftpUtil" class="com.hdp.pi.utils.kolon.FtpUtil" />
<!-- 引用其它模块 -->
<dubbo:reference interface="com.hdp.pi.service.baseservice.GlobalVariableService"
<bean id="kolonMemberService" class="com.hdp.pi.service.kolon.KolonMemberServiceImpl" />
<bean id="ftpUtil" class="com.hdp.pi.utils.kolon.FtpUtil" />
<dubbo:reference interface="com.hdp.pi.service.baseservice.GlobalVariableService"
id="globalVariableService" version="1.0.0" />
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<dubbo:reference interface="com.hdp.pi.service.kolon.KolonMemberService"
id="kolonMemberService" version="1.0.0" />
</beans>
\ No newline at end of file
......@@ -8,6 +8,9 @@ spring.datasource.test-on-return=false
spring.datasource.filters=stat
spring.datasource.validation-interval=300000
securityfilter.urlpatterns=/v1.0/*
server.port=8080
server.port=0
dubbo.host=0.0.0.0
kolon.dubbo.port=21896
......@@ -24,22 +27,22 @@ kolon.property.ftp.getFileDir = /Emarsys/
kolon.property.ftp.getFileHistoryDir = /Emarsys/history/
kolon.property.ftp.getFileName = contact.csv
kolon.property.ftp.tempAddFileName = /temp/tempAddContact.csv
kolon.property.ftp.tempUpdateFileName = /temp/tempUpdateContact.csv
kolon.property.ftp.putFileDir = /SCRM/
kolon.property.ftp.putAddFileName = newContact.csv
kolon.property.ftp.putUpdateFileName = updateContact.csv
kolon.property.ftp.tempAddFileName = /temp/tempAddContact.csv
kolon.property.ftp.tempUpdateFileName = /temp/tempUpdateContact.csv
#test dev
#kolon.property.ftp.server = 172.18.8.202
#kolon.property.ftp.port = 21
#kolon.property.ftp.userName = ftpuser
#kolon.property.ftp.password = 1234
#kolon.property.ftp.tempAddFileName = /temp/tempAddContact.csv
#kolon.property.ftp.tempUpdateFileName = /temp/tempUpdateContact.csv
#kolon.property.ftp.tempAddFileName = E:/FTP/SCRM/temp/tempAddContact.csv
#kolon.property.ftp.tempUpdateFileName = E:/FTP/SCRM/temp/tempUpdateContact.csv
......
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