Package halfpipe.example.endpoint

Source Code of halfpipe.example.endpoint.HelloEndpoint

package halfpipe.example.endpoint;

import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import halfpipe.example.api.Message;
import halfpipe.example.properties.ExampleServiceProps;
import halfpipe.logging.Log;
import org.slf4j.Logger;
import org.springframework.stereotype.Component;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Component
@Path("/hello")
@Api(value = "hello", description = "A hello world endpoint")
public class HelloEndpoint {

    @Log
    Logger logger;

    @Inject
    private ExampleServiceProps exampleServiceProps;

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(value = "message", notes = "a nice hello", response = Message.class)
     public Message message() {
        logger.info("My Things {}", exampleServiceProps.getMyThings().get());
       return new Message(exampleServiceProps.getDefaultMessage().get());
     }
}
TOP

Related Classes of halfpipe.example.endpoint.HelloEndpoint

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.