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
{ | |
"product": "Apple", | |
"price": "1.25" | |
} |
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
package com.coderef.delivery; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; | |
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; | |
@SpringBootApplication | |
@EnableEurekaClient | |
public class DeliveryOrderServiceApplication { |
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
package com.coderef.delivery.security; | |
import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.http.HttpMethod; | |
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; | |
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; | |
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer; |
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
package com.coderef.delivery.exception; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.ControllerAdvice; | |
import org.springframework.web.bind.annotation.ExceptionHandler; | |
import javax.validation.ConstraintViolationException; | |
import java.util.stream.Collectors; |
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
package com.coderef.delivery.controller; | |
import com.coderef.delivery.model.Order; | |
import com.coderef.delivery.service.OrderService; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.*; | |
@RestController |
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
package com.coderef.delivery.service; | |
import com.coderef.delivery.model.Order; | |
import com.coderef.delivery.repository.OrderRepository; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Service; | |
import org.springframework.validation.annotation.Validated; | |
@Service | |
public class OrderService { |
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
package com.coderef.delivery.repository; | |
import com.coderef.delivery.model.Order; | |
import org.springframework.data.repository.CrudRepository; | |
public interface OrderRepository extends CrudRepository<Order, Integer> { | |
} |
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
package com.coderef.delivery.model; | |
import org.hibernate.validator.constraints.NotEmpty; | |
import javax.persistence.*; | |
import javax.validation.constraints.NotNull; | |
import java.io.Serializable; | |
@Entity | |
@Table(name = "`order`") |
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
package com.coderef.delivery.controller; | |
import com.coderef.delivery.model.Order; | |
import com.coderef.delivery.service.OrderService; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.*; | |
@RestController |
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
server: | |
port: 9093 | |
eureka: | |
instance: | |
hostname: localhost | |
port: 9091 | |
client: | |
registerWithEureka: true | |
fetchRegistry: false |
NewerOlder