// Path: public-api/src/main/java/info/rolandkrueger/userservice/api/_internal/RestApiConstants.java
// public final class RestApiConstants {
// 
//     private RestApiConstants() {
//     }
// 
//     public static final String AUTHORITIES_RESOURCE = "authorities";
// 
//     public static final String UPDATE_USER_RESOURCE = "update-user";
//     public static final String LOGIN_USER_RESOURCE = "login-user";
//     public static final String USERS_RESOURCE = "users";
//     public static final String REGISTRATIONS_RESOURCE = "registrations";
//     public static final String SEARCH_RESOURCE = "search";
// 
//     public static final String AUTHORITY_PARAM = "authority";
//     public static final String USERNAME_PARAM = "username";
//     public static final String TOKEN_PARAM = "token";
// 
//     public static final String PROJECTION = "projection";
//     public static final String CONFIRM = "confirm";
//     public static final String UPDATE = "update";
//     public static final String LOGIN = "login";
// }
// 
// Path: service/src/main/java/info/rolandkrueger/userservice/model/UserExcerptProjection.java
// @Projection(name = UserProjections.Values.USER_EXCERPT_DATA, types = User.class)
// public interface UserExcerptProjection extends Identifiable<Long> {
//     String getUsername();
// 
//     LocalDate getRegistrationDate();
// 
//     LocalDateTime getLastLogin();
// 
//     String getEmail();
// }


import info.rolandkrueger.userservice.api._internal.RestApiConstants;
import info.rolandkrueger.userservice.model.UserExcerptProjection;
import org.springframework.hateoas.Resource;
import org.springframework.hateoas.ResourceProcessor;
import org.springframework.hateoas.mvc.ControllerLinkBuilder;
import org.springframework.stereotype.Component;
package info.rolandkrueger.userservice.controller;


/**
 * @author Roland Krüger
 */
@Component
public class UserExcerptProjectionResourceProcessor implements ResourceProcessor<Resource<UserExcerptProjection>> {
    @Override
    public Resource<UserExcerptProjection> process(Resource<UserExcerptProjection> resource) {
        resource.add(ControllerLinkBuilder
                .linkTo(UpdateUserRestController.class)
                .slash(resource.getContent())
// Path: public-api/src/main/java/info/rolandkrueger/userservice/api/_internal/RestApiConstants.java
// public final class RestApiConstants {
// 
//     private RestApiConstants() {
//     }
// 
//     public static final String AUTHORITIES_RESOURCE = "authorities";
// 
//     public static final String UPDATE_USER_RESOURCE = "update-user";
//     public static final String LOGIN_USER_RESOURCE = "login-user";
//     public static final String USERS_RESOURCE = "users";
//     public static final String REGISTRATIONS_RESOURCE = "registrations";
//     public static final String SEARCH_RESOURCE = "search";
// 
//     public static final String AUTHORITY_PARAM = "authority";
//     public static final String USERNAME_PARAM = "username";
//     public static final String TOKEN_PARAM = "token";
// 
//     public static final String PROJECTION = "projection";
//     public static final String CONFIRM = "confirm";
//     public static final String UPDATE = "update";
//     public static final String LOGIN = "login";
// }
// 
// Path: service/src/main/java/info/rolandkrueger/userservice/model/UserExcerptProjection.java
// @Projection(name = UserProjections.Values.USER_EXCERPT_DATA, types = User.class)
// public interface UserExcerptProjection extends Identifiable<Long> {
//     String getUsername();
// 
//     LocalDate getRegistrationDate();
// 
//     LocalDateTime getLastLogin();
// 
//     String getEmail();
// }


// Path: service/src/main/java/info/rolandkrueger/userservice/controller/UserExcerptProjectionResourceProcessor.java
import info.rolandkrueger.userservice.api._internal.RestApiConstants;
import info.rolandkrueger.userservice.model.UserExcerptProjection;
import org.springframework.hateoas.Resource;
import org.springframework.hateoas.ResourceProcessor;
import org.springframework.hateoas.mvc.ControllerLinkBuilder;
import org.springframework.stereotype.Component;

package info.rolandkrueger.userservice.controller;


/**
 * @author Roland Krüger
 */
@Component
public class UserExcerptProjectionResourceProcessor implements ResourceProcessor<Resource<UserExcerptProjection>> {
    @Override
    public Resource<UserExcerptProjection> process(Resource<UserExcerptProjection> resource) {
        resource.add(ControllerLinkBuilder
                .linkTo(UpdateUserRestController.class)
                .slash(resource.getContent())
                .withRel(RestApiConstants.UPDATE));