Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 18d74679
authored
May 17, 2023
by
章国平
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'develop'
Master See merge request !2
2 parents
1925de63
a4b8b71c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
30 deletions
config-init/config/project-gateway.yaml
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/OrderController.java
config-init/config/project-gateway.yaml
View file @
18d7467
...
...
@@ -2,40 +2,20 @@ spring:
cloud
:
gateway
:
routes
:
-
id
:
placeOrder
uri
:
lb://project-order
predicates
:
-
Path=/order/create
-
id
:
queryStorage
uri
:
lb://project-storage
predicates
:
-
Path=/storage/
-
id
:
queryAccount
uri
:
lb://project-account
predicates
:
-
Path=/account/
-
id
:
praiseItemRocketMQ
uri
:
lb://project-provider
predicates
:
-
Path=/praise/rocketmq
-
id
:
praiseItemSentinel
uri
:
lb://project-provider
predicates
:
-
Path=/praise/sentinel
-
id
:
queryPraise
uri
:
lb://project-consumer
predicates
:
-
Path=/praise/query
-
id
:
user
uri
:
lb://user
predicates
:
-
Path=/user/**, /v1/team/**, /v1/user/**
-
id
:
order
uri
:
lb://project-order
predicates
:
-
Path=/order/**
-
id
:
gis
uri
:
lb://gis
uri
:
lb://
project-
gis
predicates
:
-
Path=/gis/**
-
id
:
district
uri
:
lb://district
uri
:
lb://
project-
district
predicates
:
-
Path=/district/**
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/OrderController.java
View file @
18d7467
...
...
@@ -21,6 +21,7 @@ import com.alibaba.cloud.integration.common.Result;
import
com.alibaba.cloud.integration.order.service.OrderService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
...
@@ -38,16 +39,20 @@ public class OrderController {
@PostMapping
(
"/create"
)
public
Result
<?>
createOrder
(
@RequestParam
(
"userId"
)
String
userId
,
@RequestParam
(
"commodityCode"
)
String
commodityCode
,
@RequestParam
(
"count"
)
Integer
count
)
{
@RequestParam
(
"commodityCode"
)
String
commodityCode
,
@RequestParam
(
"count"
)
Integer
count
)
{
Result
<?>
res
=
null
;
try
{
res
=
orderService
.
createOrder
(
userId
,
commodityCode
,
count
);
}
catch
(
BusinessException
e
)
{
}
catch
(
BusinessException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
}
return
res
;
}
@GetMapping
(
"/test"
)
public
Result
<?>
test
(
@RequestParam
(
value
=
"param"
,
required
=
false
)
String
param
)
{
System
.
out
.
println
(
"test ok"
);
return
Result
.
success
(
"test ok"
);
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment