Сущность
Код: Выделить всё
@Entity
@Table(name = "customers")
@NamedQueries({
@NamedQuery(name = "Customers.findAll", query = "SELECT c FROM Customers c")})
public class Customers implements Serializable {...};
Код: Выделить всё
@RestController
@RequestMapping("/customers")
public class CustomersController {
@RequestMapping(method = GET)
public List list() {
return null;
}
@RequestMapping(value = "/{id}", method = GET)
public Object get(@PathVariable String id) {
return null;
}
@RequestMapping(value = "/{id}", method = PUT)
public ResponseEntity put(@PathVariable String id, @RequestBody Object input) {
return null;
}
@RequestMapping(value = "/{id}", method = POST)
public ResponseEntity post(@PathVariable String id, @RequestBody Object input) {
return null;
}
@RequestMapping(value = "/{id}", method = DELETE)
public ResponseEntity delete(@PathVariable String id) {
return null;
}
}
Код: Выделить всё
public interface CustomersRepository extends JpaRepository {
public Optional findOneByEmail(String email);
}
Код: Выделить всё
{
"customerses" : {
"href" : "http://localhost:8089/customerses{?page,size,sort}",
"templated" : true
}
}
}
Заранее спасибо.
Подробнее здесь: https://stackoverflow.com/questions/431 ... -the-links
Мобильная версия