• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RequestMapping类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中io.advantageous.qbit.annotation.RequestMapping的典型用法代码示例。如果您正苦于以下问题:Java RequestMapping类的具体用法?Java RequestMapping怎么用?Java RequestMapping使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RequestMapping类属于io.advantageous.qbit.annotation包,在下文中一共展示了RequestMapping类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: submit

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping(method = RequestMethod.POST)
public void submit(final Callback<HttpResponse<String>> callback) {
    final HttpContext httpContext = new HttpContext();
    final Optional<HttpRequest> httpRequest = httpContext.getHttpRequest();


    final StringBuilder sb = new StringBuilder(128);

    if (httpRequest.isPresent()) {
        sb.append("Content Type :" ).append(httpRequest.get().getContentType()).append("\n");
        sb.append(" Method :").append(httpRequest.get().getMethod()).append("\n");
        sb.append(" Form Body Length ").append(httpRequest.get().getBody().length).append("\n");
        sb.append(" Params ").append(httpRequest.get().getParams().toString()).append("\n");
        sb.append(" Form Params ").append(httpRequest.get().getFormParams().toString()).append("\n");

        HttpTextResponse textResponse = HttpResponseBuilder.httpResponseBuilder()

                .setJsonBodyCodeOk(sb.toString())
                .buildTextResponse();

        callback.accept(textResponse);
    }
}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:24,代码来源:FormSubmit.java


示例2: findEmployee

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping("/find")
public void findEmployee(final Callback<Employee> employeeCallback,
                         @RequestParam("name") final String name) {

    final long startTime = super.time;

    final CallbackBuilder callbackBuilder = super.reactor.callbackBuilder();
    callbackBuilder.delegateWithLogging(employeeCallback, logger, "employeeMap3");
    callbackBuilder.withOptionalCallback(Employee.class, employeeOptional -> {


        /** Record timing. */
        super.recordTiming("findEmployee", time - startTime);

        if (employeeOptional.isPresent()) {
            /* Increment count of employees found. */
            super.incrementCount("employeeFound");
            employeeCallback.returnThis(employeeOptional.get());
        } else {
            /* Increment count of employees not found. */
            super.incrementCount("employeeNotFound");
            employeeCallback.onError(new Exception("Employee not found"));
        }
    });
    employeeService.findEmployeeByName(callbackBuilder.build(), name);
}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:27,代码来源:CompanyRestServiceUsingReactor.java


示例3: findEmployee

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping("/find")
public void findEmployee(final Callback<Employee> employeeCallback,
                         @RequestParam("name") final String name) {

    final CallbackBuilder callbackBuilder = CallbackBuilder.newCallbackBuilder();
    // Forward to error handling and timeout defined in empMapCallback, but install some additional logging for
    // timeout and error handling that associates the error and timeout handling with this call.
    callbackBuilder.delegateWithLogging(employeeCallback, logger, "employeeMap3");
    callbackBuilder.withOptionalCallback(Employee.class, employeeOptional -> {


        if (employeeOptional.isPresent()) {
            employeeCallback.returnThis(employeeOptional.get());
        } else {
            employeeCallback.onError(new Exception("Employee not found"));
        }
    });
    employeeService.findEmployeeByName(callbackBuilder.build(), name);
}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:20,代码来源:CompanyRestService.java


示例4: httpInfo

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping ("http-info")
public String httpInfo() {

    final StringBuilder builder = new StringBuilder();
    final HttpContext httpContext = new HttpContext();
    final Optional<HttpRequest> httpRequest = httpContext.getHttpRequest();
    if (httpRequest.isPresent()) {
        builder.append("URI = ").append(httpRequest.get().getUri()).append("\n");
        builder.append("HTTP Method = ").append(httpRequest.get().getMethod()).append("\n");
        builder.append("USER AGENT = ").append(
                httpRequest.get().getHeaders().getFirst(HttpHeaders.USER_AGENT)).append("\n");
    } else {
        builder.append("request not found");
    }


    final RequestContext requestContext = new RequestContext();

    if (requestContext.getMethodCall().isPresent()) {
        final MethodCall<Object> methodCall = requestContext.getMethodCall().get();
        builder.append("Object Name = ").append(methodCall.objectName()).append("\n");
        builder.append("Method Name = ").append(methodCall.name()).append("\n");
    }
    return builder.toString();
}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:26,代码来源:RestService.java


示例5: hello8

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping(value = "/hello8", contentType = "application/xml", code = HttpStatus.CREATED)
public void hello8(final Callback<HttpTextResponse> callback) {

    final HttpTextResponse response = HttpResponseBuilder
            .httpResponseBuilder()
            .setBody("<xml><hi>hello world</hi></xml>")
            .setCode(201).buildTextResponse();
    callback.returnThis(response);
}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:10,代码来源:HelloWorldJSend.java


示例6: employeeMap

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping("/emap")
public void employeeMap(final Callback<Map<String, Employee>> empMapCallback) {

    final CallbackBuilder callbackBuilder =  super.reactor.callbackBuilder();
    callbackBuilder.wrap(empMapCallback); //Forward to error handling, timeout, and callback defined in empMapCallback
    employeeService.getEmployeesAsMap(callbackBuilder.build());

}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:9,代码来源:CompanyRestServiceUsingReactor.java


示例7: employeeMap2

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping("/emap2")
public void employeeMap2(final Callback<Map<String, Employee>> empMapCallback) {

    final CallbackBuilder callbackBuilder = super.reactor.callbackBuilder();
    callbackBuilder.delegate(empMapCallback); //Forward to error handling and timeout defined in empMapCallback

    callbackBuilder.withMapCallback(String.class, Employee.class, employeeMap -> {
        logger.info("GET MAP {}", employeeMap);
        empMapCallback.returnThis(employeeMap);
    });
    employeeService.getEmployeesAsMap(callbackBuilder.build());

}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:14,代码来源:CompanyRestServiceUsingReactor.java


示例8: employeeMap3

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping("/emap3")
public void employeeMap3(final Callback<Map<String, Employee>> empMapCallback) {

    final CallbackBuilder callbackBuilder = super.reactor.callbackBuilder();
    // Forward to error handling and timeout defined in empMapCallback, but install some additional logging for
    // timeout and error handling that associates the error and timeout handling with this call.
    callbackBuilder.delegateWithLogging(empMapCallback, logger, "employeeMap3");
    callbackBuilder.withMapCallback(String.class, Employee.class, employeeMap -> {
        logger.info("GET MAP {}", employeeMap);
        empMapCallback.returnThis(employeeMap);
    });
    employeeService.getEmployeesAsMap(callbackBuilder.build());
}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:14,代码来源:CompanyRestServiceUsingReactor.java


示例9: employeeList

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping("/elist")
public void employeeList(final Callback<List<Employee>> empListCallback) {

    final CallbackBuilder callbackBuilder = super.reactor.callbackBuilder();
    // Forward to error handling and timeout defined in empMapCallback, but install some additional logging for
    // timeout and error handling that associates the error and timeout handling with this call.
    callbackBuilder.delegateWithLogging(empListCallback, logger, "employeeList");
    callbackBuilder.withListCallback(Employee.class, employeeList -> {
        logger.info("GET List {}", employeeList);
        empListCallback.returnThis(employeeList);
    });
    employeeService.getEmployeesAsList(callbackBuilder.build());
}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:14,代码来源:CompanyRestServiceUsingReactor.java


示例10: employeeMap

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping("/emap")
public void employeeMap(final Callback<Map<String, Employee>> empMapCallback) {

    final CallbackBuilder callbackBuilder = CallbackBuilder.newCallbackBuilder();
    callbackBuilder.wrap(empMapCallback); //Forward to error handling, timeout, and callback defined in empMapCallback
    employeeService.getEmployeesAsMap(callbackBuilder.build());

}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:9,代码来源:CompanyRestService.java


示例11: employeeMap2

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping("/emap2")
public void employeeMap2(final Callback<Map<String, Employee>> empMapCallback) {

    final CallbackBuilder callbackBuilder = CallbackBuilder.newCallbackBuilder();
    callbackBuilder.delegate(empMapCallback); //Forward to error handling and timeout defined in empMapCallback

    callbackBuilder.withMapCallback(String.class, Employee.class, employeeMap -> {
        logger.info("GET MAP {}", employeeMap);
        empMapCallback.returnThis(employeeMap);
    });
    employeeService.getEmployeesAsMap(callbackBuilder.build());

}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:14,代码来源:CompanyRestService.java


示例12: employeeMap3

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping("/emap3")
public void employeeMap3(final Callback<Map<String, Employee>> empMapCallback) {

    final CallbackBuilder callbackBuilder = CallbackBuilder.newCallbackBuilder();
    // Forward to error handling and timeout defined in empMapCallback, but install some additional logging for
    // timeout and error handling that associates the error and timeout handling with this call.
    callbackBuilder.delegateWithLogging(empMapCallback, logger, "employeeMap3");
    callbackBuilder.withMapCallback(String.class, Employee.class, employeeMap -> {
        logger.info("GET MAP {}", employeeMap);
        empMapCallback.returnThis(employeeMap);
    });
    employeeService.getEmployeesAsMap(callbackBuilder.build());
}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:14,代码来源:CompanyRestService.java


示例13: employeeList

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping("/elist")
public void employeeList(final Callback<List<Employee>> empListCallback) {

    final CallbackBuilder callbackBuilder = CallbackBuilder.newCallbackBuilder();
    // Forward to error handling and timeout defined in empMapCallback, but install some additional logging for
    // timeout and error handling that associates the error and timeout handling with this call.
    callbackBuilder.delegateWithLogging(empListCallback, logger, "employeeList");
    callbackBuilder.withListCallback(Employee.class, employeeList -> {
        logger.info("GET List {}", employeeList);
        empListCallback.returnThis(employeeList);
    });
    employeeService.getEmployeesAsList(callbackBuilder.build());
}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:14,代码来源:CompanyRestService.java


示例14: register

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping("/register")
@Auth
public SessionModel register(
        @RequestParam("email") String email,
        @RequestParam("password") String password
) {
    return new SessionModel("SESSION_ID");
}
 
开发者ID:advantageous,项目名称:qbit-extensions,代码行数:9,代码来源:UserEndpoint.java


示例15: add

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping(value = "/todo", method = RequestMethod.POST,
        description = "add a todo item to the list", summary = "adds todo",
        returnDescription = "returns true if successful")
public boolean add(final Todo todo) {

    todoMap.put(todo.getId(), todo);
    return true;
}
 
开发者ID:MammatusTech,项目名称:qbit-microservices-examples,代码行数:9,代码来源:TodoService.java


示例16: remove

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping(value = "/todo", method = RequestMethod.DELETE,
        description = "Deletes an item by id",  summary = "delete a todo item")
public void remove(@RequestParam(value = "id", description = "id of Todo item to delete")
                       final String id) {

    todoMap.remove(id);
}
 
开发者ID:MammatusTech,项目名称:qbit-microservices-examples,代码行数:8,代码来源:TodoService.java


示例17: suggestGC

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
/**
 * Run a gc if possible.
 *
 * @return true if no exceptions
 */
@RequestMapping(value = "/suggest-gc", summary = "run a gc if possible",
        description = "Run a System.gc().",
        returnDescription = "if run and there were no exceptions, returns true"
)
public boolean suggestGC() {
    System.gc();
    return true;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:14,代码来源:Admin.java


示例18: getServiceEndpointInfo

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
/**
 * Read annotation.
 *
 * @return swagger meta data
 */
@RequestMapping(value = "/meta/", summary = "swagger meta data about this service",
        description = "Swagger meta data. Swagger is used to generate " +
                "documents and clients.",
        returnDescription = "returns Swagger 2.0 JSON meta data."
)
public ServiceEndpointInfo getServiceEndpointInfo() {

    return serviceEndpointInfo;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:15,代码来源:Admin.java


示例19: getAdminServiceEndpoint

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
/**
 * Read annotation.
 *
 * @return swagger meta data for admin
 */
@RequestMapping(value = "/admin-meta/", summary = "swagger meta data about the admin services",
        description = "Swagger admin meta data for the admin itself. Swagger is used to generate " +
                "documents and clients.",
        returnDescription = "returns Swagger 2.0 JSON meta data."
)
public ServiceEndpointInfo getAdminServiceEndpoint() {

    return adminServiceEndpoint;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:15,代码来源:Admin.java


示例20: getSystemProperties

import io.advantageous.qbit.annotation.RequestMapping; //导入依赖的package包/类
@RequestMapping(value = "/system/property/",
        summary = "",
        description = "",
        returnDescription = "")
public Map<String, String> getSystemProperties() {
    Map<String, String> propertyMap = new LinkedHashMap<>(System.getProperties().size());

    System.getProperties().entrySet().stream()
            .filter(entry -> !isBlackListed((String) entry.getKey()))
            .forEach(
                    entry -> propertyMap.put(entry.getKey().toString(), entry.getValue().toString()));
    return propertyMap;
}
 
开发者ID:advantageous,项目名称:qbit,代码行数:14,代码来源:Admin.java



注:本文中的io.advantageous.qbit.annotation.RequestMapping类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UIColumn类代码示例发布时间:2022-05-23
下一篇:
Java HistoricActivityInstanceEntity类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap