配置CrudRepository的URL路径

时间:2017-08-21 07:25:37

标签: java spring-boot

存储库

@RepositoryRestResource(path = "app/cities",collectionResourceRel = "app/cities")
public interface CityRepository extends CrudRepository<City, Integer> {
    List<City> findByName(@Param("name")  String name);
}

在网址http://localhost:8080/cities中进行映射。

如何将此路径更改为http://localhost:8080/api/cities

注释

@RepositoryRestResource(path = "app/cities",collectionResourceRel = "app/cities")

无济于事。

0 个答案:

没有答案