-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/com/leungcheng/spring_simple_backend/controller/OrderController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.leungcheng.spring_simple_backend.controller; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import com.leungcheng.spring_simple_backend.auth.UserAuthenticatedInfoToken; | ||
import com.leungcheng.spring_simple_backend.domain.order.Order; | ||
import com.leungcheng.spring_simple_backend.domain.order.OrderService; | ||
import jakarta.validation.Valid; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class OrderController { | ||
@Autowired private OrderService orderService; | ||
|
||
@PostMapping("/orders") | ||
@ResponseStatus(HttpStatus.CREATED) | ||
Order newOrder( | ||
@Valid @RequestBody CreateOrderRequest createOrderRequest, | ||
UserAuthenticatedInfoToken authToken) { | ||
throw new UnsupportedOperationException("Not implemented"); | ||
} | ||
|
||
public record CreateOrderRequest( | ||
String requestId, ImmutableMap<String, Integer> productIdToQuantity) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters