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 888dd6a6
authored
May 17, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 提交测试类
1 parent
ffa2380c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/OrderController.java
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/OrderController.java
View file @
888dd6a
...
@@ -21,6 +21,7 @@ import com.alibaba.cloud.integration.common.Result;
...
@@ -21,6 +21,7 @@ import com.alibaba.cloud.integration.common.Result;
import
com.alibaba.cloud.integration.order.service.OrderService
;
import
com.alibaba.cloud.integration.order.service.OrderService
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -38,16 +39,20 @@ public class OrderController {
...
@@ -38,16 +39,20 @@ public class OrderController {
@PostMapping
(
"/create"
)
@PostMapping
(
"/create"
)
public
Result
<?>
createOrder
(
@RequestParam
(
"userId"
)
String
userId
,
public
Result
<?>
createOrder
(
@RequestParam
(
"userId"
)
String
userId
,
@RequestParam
(
"commodityCode"
)
String
commodityCode
,
@RequestParam
(
"commodityCode"
)
String
commodityCode
,
@RequestParam
(
"count"
)
Integer
count
)
{
@RequestParam
(
"count"
)
Integer
count
)
{
Result
<?>
res
=
null
;
Result
<?>
res
=
null
;
try
{
try
{
res
=
orderService
.
createOrder
(
userId
,
commodityCode
,
count
);
res
=
orderService
.
createOrder
(
userId
,
commodityCode
,
count
);
}
}
catch
(
BusinessException
e
)
{
catch
(
BusinessException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
return
Result
.
failed
(
e
.
getMessage
());
}
}
return
res
;
return
res
;
}
}
@GetMapping
(
"/test"
)
public
Result
<?>
test
(
@RequestParam
(
"param"
)
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