Commit f6aae6ee by 朱瑞泽

暂定

parent 8a5d3529
......@@ -27,6 +27,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
......
......@@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.gic</groupId>
<artifactId>gic-demo-pom</artifactId>
<version>1.0-SNAPSHOT</version>
<artifactId>gic-pom-base</artifactId>
<version>4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gic-demo-single-service</artifactId>
......@@ -18,6 +18,8 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<libraryVersion>1.0-SNAPSHOT</libraryVersion>
<!-- api依赖,正式版会在 gic-pom-base 里生成 -->
<gic-demo-single-api>1.0-SNAPSHOT</gic-demo-single-api>
</properties>
<dependencies>
......@@ -46,12 +48,6 @@
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-demo-config</artifactId>
<version>${gic-demo-config}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-sharding-sdk</artifactId>
<version>${gic-sharding-sdk}</version>
</dependency>
......@@ -76,8 +72,8 @@
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-demo-project-api</artifactId>
<version>${gic-demo-project-api}</version>
<artifactId>gic-demo-single-api</artifactId>
<version>${gic-demo-single-api}</version>
</dependency>
<dependency>
......@@ -87,6 +83,13 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.1.7.RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
......
......@@ -2,9 +2,9 @@ package com.gic.demo.single.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.demo.project.api.dto.DemoStoreDTO;
import com.gic.demo.project.api.service.DemoStoreApiService;
import com.gic.demo.project.api.utils.DemoProjectApiConstant;
import com.gic.demo.single.api.dto.DemoStoreDTO;
import com.gic.demo.single.api.service.DemoStoreApiService;
import com.gic.demo.single.api.utils.DemoSinglApiConstant;
import com.gic.demo.single.entity.TabGicDemoStore;
import com.gic.demo.single.service.DemoStoreService;
import org.apache.commons.lang3.RandomUtils;
......@@ -29,7 +29,7 @@ public class DemoStoreApiServiceImpl implements DemoStoreApiService {
@Override
public ServiceResponse<DemoStoreDTO> findDemoStoreById(String storeId) {
if (RandomUtils.nextInt(0, 10) > 5) {
return ServiceResponse.failure(DemoProjectApiConstant.ERROR, "服务异常");
return ServiceResponse.failure(DemoSinglApiConstant.ERROR, "服务异常");
}
TabGicDemoStore store = localService.findDemoStoreById(storeId);
return ServiceResponse.success(EntityUtil.changeEntityByOrika(DemoStoreDTO.class, store));
......
......@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<import resource="classpath:gic-demo-init.xml"/>
<import resource="classpath:applicationContext-init.xml"/>
<import resource="classpath:dubbo-gic-demo-service.xml"/>
<import resource="classpath*:dubbo-setting.xml"/>
<import resource="classpath:jdbc-gic-demo-service.xml"/>
......
......@@ -15,6 +15,6 @@
<dubbo:protocol name="dubbo" port="30102"/>
<dubbo:service interface="com.gic.demo.project.api.service.DemoStoreApiService" ref="demoStoreApiServiceImpl" timeout="60000" />
<dubbo:service interface="com.gic.demo.single.api.service.DemoStoreApiService" ref="demoStoreApiServiceImpl" timeout="60000" />
</beans>
......@@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.gic</groupId>
<artifactId>gic-demo-pom</artifactId>
<version>1.0-SNAPSHOT</version>
<artifactId>gic-pom-base</artifactId>
<version>4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gic-demo-single-web</artifactId>
......@@ -19,39 +19,82 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<libraryVersion>1.0-SNAPSHOT</libraryVersion>
<!-- api依赖,正式版会在 gic-pom-base 里生成 -->
<gic-demo-single-api>1.0-SNAPSHOT</gic-demo-single-api>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-demo-common</artifactId>
<artifactId>gic-commons</artifactId>
<version>${gic-commons}</version>
<exclusions>
<exclusion>
<artifactId>dubbo</artifactId>
<groupId>com.alibaba</groupId>
</exclusion>
<exclusion>
<artifactId>logback-core</artifactId>
<groupId>ch.qos.logback</groupId>
</exclusion>
<exclusion>
<artifactId>spring-data-redis</artifactId>
<groupId>org.springframework.data</groupId>
</exclusion>
<exclusion>
<artifactId>servlet-api</artifactId>
<groupId>javax.servlet</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.23.2-GA</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-demo-config</artifactId>
<artifactId>gic-platform-config</artifactId>
<version>${gic-platform-config}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-demo-project-api</artifactId>
<artifactId>gic-demo-single-api</artifactId>
<version>${gic-demo-single-api}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.1.5.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>logback-classic</artifactId>
<groupId>ch.qos.logback</groupId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.9</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.23</version>
</dependency>
</dependencies>
......
......@@ -13,7 +13,7 @@ import org.springframework.context.annotation.ImportResource;
*/
@SpringBootApplication
@ImportResource(value = {
"classpath*:gic-demo-init.xml",
"classpath*:applicationContext-init.xml",
"classpath*:dubbo-setting.xml",
"classpath*:dubbo-gic-demo-web.xml",
"classpath*:spring-interceptor.xml"
......@@ -22,7 +22,7 @@ public class Main {
public static void main(String[] args) {
ConfigurableApplicationContext context = SpringApplication.run(Main.class, args);
DubboContextUtil.setApplicationContext(context.getParent());
DubboContextUtil.setApplicationContext(context);
}
}
\ No newline at end of file
......@@ -3,8 +3,8 @@ package com.gic.demo.single.web.controller;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.demo.project.api.dto.DemoStoreDTO;
import com.gic.demo.project.api.service.DemoStoreApiService;
import com.gic.demo.single.api.dto.DemoStoreDTO;
import com.gic.demo.single.api.service.DemoStoreApiService;
import com.gic.demo.single.web.exception.GicDemoErrCode;
import com.gic.demo.single.web.vo.DemoStoreVO;
import org.apache.commons.lang.StringUtils;
......
......@@ -14,6 +14,6 @@
<!-- 应用名称 -->
<dubbo:application name="gic-demo-single-web"/>
<dubbo:reference interface="com.gic.demo.project.api.service.DemoStoreApiService" id="demoStoreApiService" timeout="60000" retries="0"/>
<dubbo:reference interface="com.gic.demo.single.api.service.DemoStoreApiService" id="demoStoreApiService" timeout="60000" retries="0"/>
</beans>
\ No newline at end of file
dubbo.registry.file=gic-demo-project-web
\ No newline at end of file
dubbo.registry.file=gic-demo-single-web
\ 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