Commit c08c9937 authored by 曲欣红's avatar 曲欣红

Merge branch 'master' of http://gitlab.egolm.com/key/sso.git

parents d60ca77d eacd49ef
...@@ -38,6 +38,10 @@ ...@@ -38,6 +38,10 @@
<artifactId>cxf-spring-boot-starter-jaxws</artifactId> <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.3.2</version> <version>3.3.2</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId> <artifactId>spring-boot-devtools</artifactId>
...@@ -83,6 +87,10 @@ ...@@ -83,6 +87,10 @@
<artifactId>javax.ws.rs-api</artifactId> <artifactId>javax.ws.rs-api</artifactId>
<version>2.1.1</version> <version>2.1.1</version>
</dependency> </dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -2,10 +2,11 @@ package com.egolm.sso; ...@@ -2,10 +2,11 @@ package com.egolm.sso;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}) @SpringBootApplication
@EnableTransactionManagement
public class SSOApplication { public class SSOApplication {
private static ApplicationContext applicationContext; private static ApplicationContext applicationContext;
......
package com.egolm.sso.config;
import javax.sql.DataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import com.alibaba.druid.pool.DruidDataSource;
@Configuration
public class DataSourceConfig {
@Bean
@Primary
@ConfigurationProperties(prefix = "spring.datasource")
public DataSource getDataSource() {
return DataSourceBuilder.create().type(DruidDataSource.class).build();
}
@Bean
@Primary
public PlatformTransactionManager getTransactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
@Primary
public JdbcTemplate getJdbcTemplate(DataSource dataSource) {
JdbcTemplate jdbcTemplate = new JdbcTemplate();
jdbcTemplate.setDataSource(dataSource);
return jdbcTemplate;
}
}
\ No newline at end of file
...@@ -19,7 +19,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -19,7 +19,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import com.egolm.sso.service.XsipSdService; import com.egolm.sso.service.MaterialMasterService;
@Configuration @Configuration
public class WsConfig { public class WsConfig {
...@@ -31,13 +31,13 @@ public class WsConfig { ...@@ -31,13 +31,13 @@ public class WsConfig {
WSS4JInInterceptor authInterceptor; WSS4JInInterceptor authInterceptor;
@Autowired @Autowired
XsipSdService xsipSdService; MaterialMasterService materialMasterService;
@Bean @Bean
public Endpoint endpoint() { public Endpoint endpoint() {
EndpointImpl endpoint = new EndpointImpl(bus, xsipSdService); EndpointImpl endpoint = new EndpointImpl(bus, materialMasterService);
endpoint.setInInterceptors(Arrays.asList(authInterceptor)); endpoint.setInInterceptors(Arrays.asList(authInterceptor));
endpoint.publish("/xsip"); endpoint.publish("/material_master");
return endpoint; return endpoint;
} }
......
package com.egolm.sso.service;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService(targetNamespace = "http://service.sso.egolm.com")
public interface MaterialMasterService {
@WebMethod
public void execute(String xml);
}
package com.egolm.sso.service;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService(targetNamespace = "http://service.sso.egolm.com")
public interface XsipSdService {
/**
* 001
* @param xml
*/
@WebMethod
public void pushMaterialMaster(String xml);
/**
* 002
* @param xml
*/
@WebMethod
public void pushPriceList(String xml);
/**
* 005
* @param xml
*/
@WebMethod
public void pushProFormaInvoice(String xml);
/**
* 007
* @param xml
*/
@WebMethod
public void pushShippingNotfirmation(String xml);
/**
* 008
* @param xml
*/
@WebMethod
public void pushSoConfirmQuotation(String xml);
/**
* 009
* @param xml
*/
@WebMethod
public void pushSoDnDeletion(String xml);
}
package com.egolm.sso.service.impl;
import javax.jws.WebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import com.egolm.sso.service.MaterialMasterService;
@Component
@WebService(serviceName = "MaterialMasterService", targetNamespace = "http://service.sso.egolm.com", endpointInterface = "com.egolm.sso.service.MaterialMasterService")
public class MaterialMasterServiceImpl implements MaterialMasterService {
@Autowired
JdbcTemplate jdbcTemplate;
@Override
public void execute(String xml) {
System.out.println(xml);
}
}
package com.egolm.sso.service.impl;
import javax.jws.WebMethod;
import javax.jws.WebService;
import org.springframework.stereotype.Component;
import com.egolm.sso.service.XsipSdService;
@Component
@WebService(serviceName = "XsipSdService",
targetNamespace = "http://service.sso.egolm.com",
endpointInterface = "com.egolm.sso.service.XsipSdService")
public class XsipSdServiceImpl implements XsipSdService {
@Override
@WebMethod
public void pushMaterialMaster(String xml) {
System.out.println(xml);
}
@Override
public void pushPriceList(String xml) {
System.out.println(xml);
}
@Override
public void pushProFormaInvoice(String xml) {
System.out.println(xml);
}
@Override
public void pushShippingNotfirmation(String xml) {
System.out.println(xml);
}
@Override
public void pushSoConfirmQuotation(String xml) {
System.out.println(xml);
}
@Override
public void pushSoDnDeletion(String xml) {
System.out.println(xml);
}
}
wsUsername=test
wsPassword=78258c537d6e4d5fb210a57d05619fb6
\ No newline at end of file
wsUsername: test
wsPassword: 78258c537d6e4d5fb210a57d05619fb6
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://10.10.0.111:3306/sso?useSSL=false&useUnicode=true&characterEncoding=utf8
username: root
password: 'egolm#2018'
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: true
testOnReturn: true
poolPreparedStatements: true
maxOpenPreparedStatements: 20
\ No newline at end of file
wsUsername=schneider
wsPassword=f14d4a80f823438a875b1924384c944c
\ No newline at end of file
wsUsername: schneider
wsPassword: f14d4a80f823438a875b1924384c944c
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://10.10.0.111:3306/sso?useSSL=false&useUnicode=true&characterEncoding=utf8
username: root
password: 'egolm#2018'
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: true
testOnReturn: true
poolPreparedStatements: true
maxOpenPreparedStatements: 20
\ No newline at end of file
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