Created
November 21, 2017 20:42
-
-
Save odedia/cecacb4a9f9ad72c8d5b8bf9c999dc9e to your computer and use it in GitHub Desktop.
This file contains hidden or 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.odedia.springsession.rest; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.cloud.client.discovery.EnableDiscoveryClient; | |
| import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | |
| import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; | |
| import org.springframework.web.bind.annotation.GetMapping; | |
| import org.springframework.web.bind.annotation.RestController; | |
| import com.odedia.springsession.dto.Order; | |
| @SpringBootApplication | |
| @EnableDiscoveryClient | |
| @EnableWebSecurity | |
| @EnableRedisHttpSession | |
| @RestController | |
| public class RestApplication { | |
| public static void main(String[] args) { | |
| SpringApplication.run(RestApplication.class, args); | |
| } | |
| @GetMapping("/orders") | |
| public List<Order> getOrders() { | |
| return Arrays.asList(new Order(1L, "David Cohen", 25.4F), new Order(2L, "Danny Smith", 30.3F), new Order(3L, "Jerry Richardson", 40F)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment