Fixed conflicts
This commit is contained in:
@@ -9,4 +9,4 @@ This module contains articles about REST APIs in Spring
|
||||
- [Spring RequestMapping](https://www.baeldung.com/spring-requestmapping)
|
||||
- [Spring and Apache FileUpload](https://www.baeldung.com/spring-apache-file-upload)
|
||||
- [Test a REST API with curl](https://www.baeldung.com/curl-rest)
|
||||
- [CORS with Spring](https://www.baeldung.com/spring-cors)
|
||||
- [Best Practices for REST API Error Handling](https://www.baeldung.com/rest-api-error-handling-best-practices)
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.baeldung.cors;
|
||||
|
||||
public class Account {
|
||||
private Long id;
|
||||
|
||||
public Account(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.baeldung.cors;
|
||||
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@CrossOrigin(maxAge = 3600)
|
||||
@RestController
|
||||
@RequestMapping("/account")
|
||||
public class AccountController {
|
||||
|
||||
@CrossOrigin("http://example.com")
|
||||
@RequestMapping("/{id}")
|
||||
public Account retrieve(@PathVariable Long id) {
|
||||
return new Account(id);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.DELETE, path = "/{id}")
|
||||
public void remove(@PathVariable Long id) {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user