[Spring Cloud] - 14. Users Microservice Order Service
목차 [Spring Cloud] - 20. Users Microservice AuthorizationHeaderFilter 추가 [Spring Cloud] - 19. Users Microservice JWT 생성 [Spring Cloud] - 18. Users Microservice 로그인 성공 처리 [Spring Cloud] - 17. Users Microservice Routes 정보 변경 [Spring Cloud] - 16. Users Microservice loadUserByUsername() 구현 [Spring Cloud] - 15. Users Microservice AuthenticationFilter [Spring Cloud] - 14. Users Microservice Order Service [Spring Cloud] - 13. Users Microservice Catalog [Spring Cloud] - 12. Users Microservice 사용자 조회 [Spring Cloud] - 11. Users Microservice Gateway 연동 [Spring Cloud] - 10. Users Microservice 사용자 추가 [Spring Cloud] - 개발하는 마이크로서비스 애플리케이션 9 [Spring Cloud] - Users Microservice Users Microservice Order Service설정server: port: 0spring: application: name: order-service h2: console: enabled: true settings: web-allow-others: true datasource: driver-class-name: org.h2.Driver username: sa password: url: jdbc:h2:mem:testdb jpa: hibernate: ddl-auto: create-drop generate-ddl: true show-sql: trueeureka: client: register-with-eureka: true fetch-registry: true service-url: defaultZone: http://localhost:8761/eureka instance: instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}} @Data@Entity@Table(name = "orders")public class OrderEntity implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false, length = 120) private String productId; @Column(nullable = false) private Integer qty; @Column(nullable = false) private Integer unitPrice; @Column(nullable = false) private Integer totalPrice; @Column(nullable = false) private String userId; @Column(nullable = false, unique = true) private String orderId; @Column(nullable = false, updatable = false, insertable = false) @ColumnDefault(value = "CURRENT_TIMESTAMP") private Date createdAt;} @Repositorypublic interface OrderRepository extends CrudRepository<OrderEntity, Long> { OrderEntity findByOrderId(String orderId); Iterable<OrderEntity> findByUserId(String userId);} @Data@JsonInclude(JsonInclude.Include.NON_NULL)public class ResponseOrder { private String productId; private Integer qty; private Integer unitPrice; private Integer totalPrice; private Date createdAt; private String orderId;} @Datapublic class RequestOrder { private String productId; private Integer qty; private Integer unitPrice;}