Quarkus常用注解

371
0

Quarkus常用注解

import javax.ws.rs.*

import javax.inject.Inject;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
@ApplicationScoped
@Produces
@Named("Chinese")
public MyBean getMyBean(){
    return new MyBean();
}

 

@ConfigProperty("aa.bb.id")

String id;

 

@Inject

Myservice myservice;


@Path("/news")
@Get / @Post 

@Produces(MediaType.TEXT_PLAIN) 
@Consumes(MediaType.APPLICATION_JSON)  

public String getNews(@Context UriInfo uriInfo,@QueryParam("id") String id,PostInfo postInfo,@NotBlank @HeaderParam("token") String token){ 

  reutrn "hello"

}

全部评论