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
@Entity | |
@Data | |
public class StockOwned { | |
@JsonIgnore | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) | |
long stockOwnedId; | |
@JsonIgnore | |
@OneToOne |
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
JsonNode notCheckedResponse = aquireStockGlobalQuoteString(stockSymbol); | |
String searchedStockName = stockName; | |
String response = ""; | |
ObjectMapper mapper = new ObjectMapper(); | |
if(notCheckedResponse.has("Error Message")){ | |
try { | |
response = mapper.writeValueAsString(notCheckedResponse); | |
} catch (JsonProcessingException e) { | |
e.printStackTrace(); | |
} |
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
@Configuration | |
@EnableWebSecurity | |
public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | |
@Override | |
protected void configure(HttpSecurity http) throws Exception { | |
http | |
.authorizeRequests() | |
.antMatchers("/", "/aviav","/h2").permitAll() | |
.anyRequest().authenticated() | |
.and() |
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
@Configuration | |
@Slf4j | |
public class LoadDatabase { | |
@Bean | |
CommandLineRunner initDatabase(UserRepository repository, StockRepository stockRepository) { | |
return args -> { | |
Stock stock1 = new Stock("Ubisoft","UBI"); | |
Stock stock2 = new Stock("ElectronicArts","ELA"); | |
Stock stock3 = new Stock("Adesso","ASO"); |