Skip to content

Instantly share code, notes, and snippets.

@Entity
@Data
public class StockOwned {
@JsonIgnore
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
long stockOwnedId;
@JsonIgnore
@OneToOne
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();
}
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/", "/aviav","/h2").permitAll()
.anyRequest().authenticated()
.and()
@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");