Expose all ids

master
esensar 2017-06-13 22:58:37 +02:00
parent a1dca0fd01
commit 1cac3cdc26
4 changed files with 75 additions and 0 deletions

View File

@ -1,6 +1,10 @@
package ba.steleks;
import ba.steleks.model.Event;
import ba.steleks.model.EventTeam;
import ba.steleks.model.EventType;
import ba.steleks.model.Media;
import ba.steleks.storage.StorageProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
@ -9,6 +13,9 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

View File

@ -0,0 +1,24 @@
package ba.steleks;/**
* Created by ensar on 13/06/17.
*/
import ba.steleks.model.Event;
import ba.steleks.model.EventTeam;
import ba.steleks.model.EventType;
import ba.steleks.model.Media;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;
import java.util.logging.Logger;
@Configuration
public class RepositoryConfig extends RepositoryRestConfigurerAdapter {
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.exposeIdsFor(Event.class);
config.exposeIdsFor(EventTeam.class);
config.exposeIdsFor(EventType.class);
config.exposeIdsFor(Media.class);
}
}

View File

@ -0,0 +1,22 @@
package ba.steleks;/**
* Created by ensar on 13/06/17.
*/
import ba.steleks.model.Participant;
import ba.steleks.model.Team;
import ba.steleks.model.TeamCategory;
import ba.steleks.model.TeamMedia;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;
@Configuration
public class RepositoryConfig extends RepositoryRestConfigurerAdapter {
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.exposeIdsFor(Participant.class);
config.exposeIdsFor(Team.class);
config.exposeIdsFor(TeamCategory.class);
config.exposeIdsFor(TeamMedia.class);
}
}

View File

@ -0,0 +1,22 @@
package ba.steleks;/**
* Created by ensar on 13/06/17.
*/
import ba.steleks.model.Course;
import ba.steleks.model.MembershipType;
import ba.steleks.model.User;
import ba.steleks.model.UserRole;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;
@Configuration
public class RepositoryConfig extends RepositoryRestConfigurerAdapter {
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.exposeIdsFor(Course.class);
config.exposeIdsFor(MembershipType.class);
config.exposeIdsFor(User.class);
config.exposeIdsFor(UserRole.class);
}
}