Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-demo-project
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-project
Commits
fcf7d0ea
Commit
fcf7d0ea
authored
Jun 06, 2019
by
朱瑞泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update doc
parent
e86bc210
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
2 deletions
+26
-2
DemoStoreApiConstant.java
.../com/gic/demo/project/api/utils/DemoStoreApiConstant.java
+15
-0
DemoStoreInnerService.java
.../project/service/inner/service/DemoStoreInnerService.java
+2
-0
DemoStoreInnerServiceImpl.java
...service/inner/service/impl/DemoStoreInnerServiceImpl.java
+2
-0
DemoStoreApiServiceImpl.java
.../project/service/service/api/DemoStoreApiServiceImpl.java
+2
-1
DemoProjectController.java
...ic/demo/project/web/controller/DemoProjectController.java
+5
-1
No files found.
gic-demo-project-api/src/main/java/com/gic/demo/project/api/utils/DemoStoreApiConstant.java
0 → 100644
View file @
fcf7d0ea
package
com
.
gic
.
demo
.
project
.
api
.
utils
;
/**
* demo api 常量
*
* @author zhurz
*/
public
class
DemoStoreApiConstant
{
/**
* 服务异常
*/
public
static
final
String
ERROR
=
"9999"
;
}
gic-demo-project-service/src/main/java/com/gic/demo/project/service/inner/service/DemoStoreInnerService.java
View file @
fcf7d0ea
...
...
@@ -3,6 +3,8 @@ package com.gic.demo.project.service.inner.service;
import
com.gic.demo.project.service.entity.TabGicDemoStore
;
/**
* 门店内部服务
*
* @author zhurz
*/
public
interface
DemoStoreInnerService
{
...
...
gic-demo-project-service/src/main/java/com/gic/demo/project/service/inner/service/impl/DemoStoreInnerServiceImpl.java
View file @
fcf7d0ea
...
...
@@ -9,6 +9,8 @@ import org.springframework.stereotype.Service;
/**
* 门店内部服务
*
* @author zhurz
*/
@Service
...
...
gic-demo-project-service/src/main/java/com/gic/demo/project/service/service/api/DemoStoreApiServiceImpl.java
View file @
fcf7d0ea
...
...
@@ -4,6 +4,7 @@ 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.DemoStoreApiConstant
;
import
com.gic.demo.project.service.entity.TabGicDemoStore
;
import
com.gic.demo.project.service.inner.service.DemoStoreInnerService
;
import
org.apache.commons.lang3.RandomUtils
;
...
...
@@ -28,7 +29,7 @@ public class DemoStoreApiServiceImpl implements DemoStoreApiService {
@Override
public
ServiceResponse
<
DemoStoreDTO
>
findDemoStoreById
(
String
storeId
)
{
if
(
RandomUtils
.
nextInt
(
0
,
10
)
>
5
)
{
return
ServiceResponse
.
failure
(
"0001"
,
"服务异常"
);
return
ServiceResponse
.
failure
(
DemoStoreApiConstant
.
ERROR
,
"服务异常"
);
}
TabGicDemoStore
store
=
localService
.
findDemoStoreById
(
storeId
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityByOrika
(
DemoStoreDTO
.
class
,
store
));
...
...
gic-demo-project-web/src/main/java/com/gic/demo/project/web/controller/DemoProjectController.java
View file @
fcf7d0ea
package
com
.
gic
.
demo
.
project
.
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.project.web.exception.GicDemoErrCode
;
import
com.gic.demo.project.web.vo.DemoStoreVO
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -39,7 +41,9 @@ public class DemoProjectController {
}
ServiceResponse
<
DemoStoreDTO
>
response
=
demoStoreApiService
.
findDemoStoreById
(
storeId
);
if
(
response
.
isSuccess
())
{
return
RestResponse
.
success
(
response
.
getResult
());
// 转换为VO
DemoStoreVO
vo
=
EntityUtil
.
changeEntityByOrika
(
DemoStoreVO
.
class
,
response
.
getResult
());
return
RestResponse
.
success
(
vo
);
}
logger
.
warn
(
"获取门店信息异常 -> {} -> {}"
,
storeId
,
response
.
getMessage
());
return
GicDemoErrCode
.
ERR_1
.
buildFailureResponse
();
...
...
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