1.2.1 restful api设计示例

本文详细介绍了RESTful API请求参数与Spring MVC后台处理参数的多种方式,包括@RequestParam、@RequestBody、@PathVariable等注解的使用场景,以及如何通过@RequestMapping和@ResponseBody实现不同类型的HTTP请求处理。

Rest API请求参数与Spring后台常用接收参数注解的各种类型介绍。

  • @RequestParam
  • @RequestBody
  • @PathVariable
  • 实体Bean
  • 数据类型

另外还有两个常用方法注解:

  • @RequestMapping
  • @Responsebody

@RequestMapping(“url”),这里的 url写的是请求路径的一部分,一般作用在 Controller的方法上,作为请求的映射地址。

@ResponseBody是作用在方法上的,@ResponseBody 表示该方法的返回结果直接写入 HTTP response body 中,一般在异步获取数据时使用【也就是AJAX】,在使用 @RequestMapping后,返回值通常解析为跳转路径,但是加上 @ResponseBody 后返回结果不会被解析为跳转路径,而是直接写入 HTTP response body 中。 比如异步获取 json 数据,加上 @ResponseBody 后,会直接返回 json 数据。@RequestBody 将 HTTP 请求正文插入方法中,使用适合的 HttpMessageConverter 将请求体写入某个对象。

标准restful api请求资源实例

以student实体为例:

/**
* Get请求
* @return
*/
@RequestMapping(value="student",method=RequestMethod.GET)
@ResponseBody
public Student read(Student student) {
    return student;
}

/**
* POST请求
* @return
*/
@RequestMapping(value="student",method=RequestMethod.POST)
@ResponseBody
public int creat(Student student) {
    return 0;
}

/**
* PUT请求
* @return
*/
@RequestMapping(value="student",method=RequestMethod.PUT)
@ResponseBody
public Student update(Student student) {
    return student;
}

/**
* DELETE请求
* @return
*/
@RequestMapping(value="student",method=RequestMethod.DELETE)
@ResponseBody
public int delete(Student student) {
    return 0;
}
下载方式:https://renmaiwang.cn/s/t0445 在时序发生器设计实验中,如何达成T4至T1的生成? 时序发生器的构建可以通过运用一个4位循环移位寄存器来达成T4至T1的输出。 具体而言:- **CLR(清除)**: 作为全局清零信号,当CLR呈现低电平状态时,所有输出(涵盖T1至T4)皆会被清除。 - **STOP**: 在T4脉冲的下降沿时刻,若STOP信号处于低电平状态,则T1至T4会被重置。 - **启动流程**: 当启动信号START处于高电平,并且STOP为高电平时,移位寄存器将在每个时钟的上升沿向左移动一位。 移位寄存器的输出端对应了T4、T3、T2、T1。 #### 2. 时序发生器如何调控T1至T4的波形形态? 时序发生器通过以下几个信号调控T1至T4的波形形态:- **CLR**: 当CLR处于低电平状态时,所有输出均会被清零。 - **STOP**: 若STOP信号为低电平,且在T4脉冲的下降沿时刻,所有输出同样会被清零。 - **START**: 在START信号有效(通常为高电平),并且STOP为高电平时,移位寄存器启动,从而产生环形脉冲输出。 ### 微程序控制器实验#### 3. 微程序控制器实验中的四条机器指令及其对应的微程序段指定的机器指令及其关联的微程序段如下:- **NOP**: 00- **R0->B**: 04- **A+B->R0**: 05- **P<1>**: 30- **IN->R0**: 32- **R0->OUT**: 33- **HLT**: 35#### 4. 微程序段中的微操作/微命令序列针对每条微指令,其对应的微操作或微命令序列如下:- **IN->R0**: 输入(IN)单元的数据被...
Below is a list of versions that are available for the restAPI plugin. To find other plugins, please review this listing of most recent releases of all plugins. Plugins extend and enhance the functionality of Openfire. To install plugins, copy the .jar file into the plugins directory of your Openfire installation. Releases Info File Version Released Openfire Version Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.12.0 2025年7月4日 5.0.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.11.0 2024年6月25日 4.8.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.10.2 2023年1120日 4.7.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.10.1 202211月9日 4.7.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.10.0 2022年9月29日 4.7.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.9.1 2022年8月4日 4.7.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.9.0 2022年8月4日 4.7.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.8.3 2022年7月19日 4.7.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.8.2 2022年6月27日 4.7.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.8.1 2022年6月23日 4.7.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.8.0 2022年4月6日 4.7.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.7.1 2022214日 4.7.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.7.0 2022119日 4.7.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.6.0 2021年6月18日 4.6.1 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.4.0 2020年224日 4.1.1 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.3.10 2020年1月7日 4.1.1 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.3.9 2019年3月21日 4.1.1 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.3.8 2018年1128日 4.1.1 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.3.7 2018年8月30日 4.1.1 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.3.6 2018年8月27日 4.1.1 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.3.5 2018年8月13日 4.1.1 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.3.1 2018年4月20日 4.1.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.3.0 2018年3月7日 4.1.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.2.5 2016年10月14日 4.1.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.2.4 2016年7月4日 4.0.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.2.3 2016年5月3日 4.0.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.2.2 2016年120日 4.0.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.2.1 2015年1124日 3.11.0 alpha + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.1.7 2015年1113日 3.10.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.1.6 2015年9月24日 3.9.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.1.5 2015年9月1日 3.9.0 + Plugin REST API Allows administration over a RESTful API. ReadMe Changelog Download 1.0.2 2015年3月3日 3.9.0 + The plugins below, so-called SNAPSHOTS, are build automatically by the continuous integration system. They represent the latest development, but are untested. Snapshots Info File Version Built at Openfire Version Plugin REST API ReadMe Changelog Download 1.12.1-SNAPSHOT 2025年7月4日 5.0.0 + Plugin REST API ReadMe Changelog Download 1.12.0-SNAPSHOT 2025年7月4日 5.0.0 + Plugin REST API ReadMe Changelog Download 1.11.1-SNAPSHOT 2025年7月4日 5.0.0 + Plugin REST API ReadMe Changelog Download 1.11.1-SNAPSHOT 2024年1118日 4.8.0 + Plugin REST API ReadMe Changelog Download 1.11.1-SNAPSHOT 2024年10月5日 4.8.0 + Plugin REST API ReadMe Changelog Download 1.11.1-SNAPSHOT 2024年6月26日 4.8.0 + Plugin REST API ReadMe Changelog Download 1.11.1-SNAPSHOT 2024年6月25日 4.8.0 + Plugin REST API ReadMe Changelog Download 1.11.0-SNAPSHOT 2024年6月25日 4.8.0 + Plugin REST API ReadMe Changelog Download 1.10.3-SNAPSHOT 2024年4月17日 4.7.0 + Plugin REST API ReadMe Changelog Download 1.10.3-SNAPSHOT 2024年112日 4.7.0 + Plugin REST API ReadMe Changelog Download 1.10.3-SNAPSHOT 2023年1120日 4.7.0 + Plugin REST API ReadMe Changelog Download 1.10.2-SNAPSHOT 2023年6月19日 4.7.0 + Plugin REST API ReadMe Changelog Download 1.10.2-SNAPSHOT 2023年5月3日 4.7.0 + Plugin REST API ReadMe Changelog Download 1.10.2-SNAPSHOT 2023年126日 4.7.0 + Plugin REST API ReadMe Changelog Download 1.10.2-SNAPSHOT 2023年123日 4.7.0 + Plugin REST API ReadMe Changelog Download 1.10.2-SNAPSHOT 202212月31日 4.7.0 + Plugin REST API ReadMe Changelog Download 1.10.2-SNAPSHOT 20221224日 4.7.0 + Plugin REST API ReadMe Changelog Download 1.10.2-SNAPSHOT 20221224日 4.7.0 + Plugin REST API ReadMe Changelog Download 1.10.2-SNAPSHOT 202211月9日 4.7.0 + Plugin REST API ReadMe Changelog Download 1.10.1-SNAPSHOT 2022111日 4.7.0 +
10-03
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值