Commit 888dd6a6 by chamberone

feat: 提交测试类

1 parent ffa2380c
...@@ -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");
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!