Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-demo-single
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gic_demo
gic-demo-single
Commits
f6aae6ee
Commit
f6aae6ee
authored
Jun 10, 2019
by
朱瑞泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂定
parent
8a5d3529
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
79 additions
and
30 deletions
+79
-30
pom.xml
gic-demo-single-api/pom.xml
+1
-0
pom.xml
gic-demo-single-service/pom.xml
+13
-10
DemoStoreApiServiceImpl.java
...mo/single/service/outer/impl/DemoStoreApiServiceImpl.java
+4
-4
applicationContext-conf.xml
...le-service/src/main/resources/applicationContext-conf.xml
+1
-1
dubbo-gic-demo-service.xml
...gle-service/src/main/resources/dubbo-gic-demo-service.xml
+1
-1
pom.xml
gic-demo-single-web/pom.xml
+50
-7
Main.java
...ingle-web/src/main/java/com/gic/demo/single/web/Main.java
+3
-2
DemoProjectController.java
...gic/demo/single/web/controller/DemoProjectController.java
+2
-2
dubbo-gic-demo-web.xml
...demo-single-web/src/main/resources/dubbo-gic-demo-web.xml
+2
-1
dubbo-project.properties
...mo-single-web/src/main/resources/dubbo-project.properties
+2
-2
No files found.
gic-demo-single-api/pom.xml
View file @
f6aae6ee
...
...
@@ -27,6 +27,7 @@
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.12
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
...
...
gic-demo-single-service/pom.xml
View file @
f6aae6ee
...
...
@@ -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>
...
...
gic-demo-single-service/src/main/java/com/gic/demo/single/service/outer/impl/DemoStoreApiServiceImpl.java
View file @
f6aae6ee
...
...
@@ -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.DemoProject
ApiConstant
;
import
com.gic.demo.
single
.api.dto.DemoStoreDTO
;
import
com.gic.demo.
single
.api.service.DemoStoreApiService
;
import
com.gic.demo.
single.api.utils.DemoSingl
ApiConstant
;
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
(
Demo
Project
ApiConstant
.
ERROR
,
"服务异常"
);
return
ServiceResponse
.
failure
(
Demo
Singl
ApiConstant
.
ERROR
,
"服务异常"
);
}
TabGicDemoStore
store
=
localService
.
findDemoStoreById
(
storeId
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityByOrika
(
DemoStoreDTO
.
class
,
store
));
...
...
gic-demo-single-service/src/main/resources/applicationContext-conf.xml
View file @
f6aae6ee
...
...
@@ -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"
/>
...
...
gic-demo-single-service/src/main/resources/dubbo-gic-demo-service.xml
View file @
f6aae6ee
...
...
@@ -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>
gic-demo-single-web/pom.xml
View file @
f6aae6ee
...
...
@@ -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>
...
...
gic-demo-single-web/src/main/java/com/gic/demo/single/web/Main.java
View file @
f6aae6ee
...
...
@@ -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
gic-demo-single-web/src/main/java/com/gic/demo/single/web/controller/DemoProjectController.java
View file @
f6aae6ee
...
...
@@ -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
;
...
...
gic-demo-single-web/src/main/resources/dubbo-gic-demo-web.xml
View file @
f6aae6ee
...
...
@@ -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
gic-demo-single-web/src/main/resources/dubbo-project.properties
View file @
f6aae6ee
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment