Package com.changestuffs.scrum.server.rest

Source Code of com.changestuffs.scrum.server.rest.BootstrapperResource

package com.changestuffs.scrum.server.rest;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import com.changestuffs.scrum.server.authentication.CurrentUserDtoProvider;
import com.changestuffs.scrum.shared.dto.CurrentUserDto;
import com.google.inject.Inject;

@Path(BootstrapperResource.PATH)
@Produces(MediaType.APPLICATION_JSON)
public class BootstrapperResource {
 
  static final String PATH = "rest/{project}/currentUser";
  private CurrentUserDtoProvider currentUserDtoProvider;

  @Inject
  public BootstrapperResource(CurrentUserDtoProvider currentUserDtoProvider) {
    this.currentUserDtoProvider = currentUserDtoProvider;
  }

  @GET
  public Response currentUser() {
    CurrentUserDto currentUser = currentUserDtoProvider.get();

    return Response.ok(currentUser).build();
  }
}
TOP

Related Classes of com.changestuffs.scrum.server.rest.BootstrapperResource

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.