本文整理了Java中io.micronaut.http.annotation.Get
类的一些代码示例,展示了Get
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Get
类的具体详情如下:
包路径:io.micronaut.http.annotation.Get
类名称:Get
暂无
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* @return The current leader address
*/
@Get(uri = "/status/leader", single = true)
Publisher<String> status();
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* Reads a Key from Consul. See https://www.consul.io/api/kv.html.
*
* @param key The key to read
* @return A {@link Publisher} that emits a list of {@link KeyValue}
*/
@Get(uri = "/kv/{+key}?recurse", single = true)
Publisher<List<KeyValue>> readValues(String key);
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* Gets all of the registered services.
*
* @return The {@link NewServiceEntry} instances
*/
@Get(uri = "/agent/services", single = true)
Publisher<Map<String, ServiceEntry>> getServices();
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* Gets all of the service names and optional tags.
*
* @return A Map where the keys are service names and the values are service tags
*/
@Get(uri = "/catalog/services", single = true)
Publisher<Map<String, List<String>>> getServiceNames();
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* Returns the configuration and member information of the local agent.
*
* @return the {@link LocalAgentConfiguration} instance
*/
@Get(uri = "/agent/self", single = true)
Publisher<LocalAgentConfiguration> getSelf();
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* Returns the members the agent sees in the cluster gossip pool.
*
* @return the {@link MemberEntry} instances
*/
@Get(uri = "/agent/members", single = true)
Publisher<List<MemberEntry>> getMembers();
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* Gets all of the registered nodes.
*
* @return All the nodes
*/
@Get(uri = "/catalog/nodes", single = true)
Publisher<List<CatalogEntry>> getNodes();
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* Gets all the nodes for the given data center.
*
* @param datacenter The data center
* @return A publisher that emits the nodes
*/
@Get(uri = "/catalog/nodes?dc={datacenter}", single = true)
Publisher<List<CatalogEntry>> getNodes(@NotNull String datacenter);
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* @return A {@link Publisher} with applications info.
*/
@SuppressWarnings("WeakerAccess")
@Get("/apps")
@Produces(single = true)
public abstract Publisher<ApplicationInfos> getApplicationInfosInternal();
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* Obtain a {@link ApplicationInfo} for the given app id.
*
* @param appId The app id
* @return The {@link ApplicationInfo} instance
*/
@Get(uri = "/apps/{appId}", single = true)
Publisher<ApplicationInfo> getApplicationInfo(@NotBlank String appId);
代码示例来源:origin: micronaut-projects/micronaut-core
@Get
public HttpStatus index() {
return HttpStatus.CREATED;
}
//end::respondHttpStatus[]
代码示例来源:origin: micronaut-projects/micronaut-core
@Get("/{number}")
String issue(Integer number) {
return appPrefix + ": issue # " + number + "!";
}
}
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* @param vipAddress The vip address
* @return A {@link Publisher} with applications info
*/
@SuppressWarnings("WeakerAccess")
@Get("/vips/{vipAddress}")
@Produces(single = true)
public abstract Publisher<ApplicationInfos> getApplicationVipsInternal(String vipAddress);
代码示例来源:origin: micronaut-projects/micronaut-core
@Get("/nullable")
String nullable(@Nullable Integer max) {
return "Parameter Value: " + (max != null ? max : "null");
}
代码示例来源:origin: micronaut-projects/micronaut-core
@Get("/list")
String list(List<Integer> values) {
assert values.stream().allMatch(val -> val instanceof Integer);
return "Parameter Value: " + values;
}
代码示例来源:origin: micronaut-projects/micronaut-core
/**
* Obtain a {@link InstanceInfo} for the given app id.
*
* @param appId The app id
* @param instanceId The instance id (this is the value of {@link InstanceInfo#getId()})
* @return The {@link InstanceInfo} instance
*/
@Get(uri = "/apps/{appId}/{instanceId}", single = true)
Publisher<InstanceInfo> getInstanceInfo(@NotBlank String appId, @NotBlank String instanceId);
代码示例来源:origin: micronaut-projects/micronaut-core
@Get("/optional-list")
String optionalList(Optional<List<Integer>> values) {
if (values.isPresent()) {
assert values.get().stream().allMatch(val -> val instanceof Integer);
return "Parameter Value: " + values.get();
} else {
return "Parameter Value: none";
}
}
}
代码示例来源:origin: micronaut-projects/micronaut-core
@Get
public HttpResponse index(String username) {
return HttpResponse.ok("Authenticated: " + username);
}
}
代码示例来源:origin: micronaut-projects/micronaut-core
@Get("/greet/{name}")
Message greet(String name) {
return new Message("Hello " + name);
}
// end::json[]
代码示例来源:origin: micronaut-projects/micronaut-core
@Get("/maybestock/{isbn}")
public Maybe<Map> maybestock(String isbn) {
return Maybe.empty(); //<2>
}
}
内容来源于网络,如有侵权,请联系作者删除!