本文整理匯總了Java中org.springframework.data.rest.core.config.RepositoryRestConfiguration.setBaseUri方法的典型用法代碼示例。如果您正苦於以下問題:Java RepositoryRestConfiguration.setBaseUri方法的具體用法?Java RepositoryRestConfiguration.setBaseUri怎麽用?Java RepositoryRestConfiguration.setBaseUri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.data.rest.core.config.RepositoryRestConfiguration
的用法示例。
在下文中一共展示了RepositoryRestConfiguration.setBaseUri方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.setBaseUri(URI.create(config.getBaseUri().getPath() + "/api"));
config.exposeIdsFor(AbTestConfiguration.class);
config.exposeIdsFor(AbTestVariant.class);
config.setDefaultPageSize(1000);
}
示例2: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.exposeIdsFor(Article.class, Category.class, Menu.class,
PsychTest.class, PsychTestQuestion.class, PsychTestResult.class, PsychTestQuestionOption.class,
Consultant.class, Profile.class, ProfileItem.class, User.class,
CourseCategory.class, Course.class, OfficialArticle.class, Blog.class, ConsExpertise.class, Room.class, ChatMessage.class);
try {
config.setReturnBodyOnCreate(true);
config.setReturnBodyOnUpdate(true);
config.setBaseUri(new URI("/api/v1"));
} catch (URISyntaxException e) {
e.printStackTrace();
}
}
示例3: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
protected void configureRepositoryRestConfiguration(final RepositoryRestConfiguration config) {
super.configureRepositoryRestConfiguration(config);
config.exposeIdsFor(Todo.class);
try {
config.setBaseUri(new URI("/rest"));
} catch (final URISyntaxException e) {
e.printStackTrace();
}
}