国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術(shù)文章
文章詳情頁

SpringBoot @RequestParam、@PathVaribale、@RequestBody實(shí)戰(zhàn)案例

瀏覽:74日期:2023-04-09 10:05:47

實(shí)例User

package com.iflytek.odeon.shipper.model.rx;import io.swagger.annotations.ApiModelProperty;public class Student { @ApiModelProperty(value = '名稱', example = 'zhangsan', required = true) private String name; private Integer call; public Student() { } public Student(String name, Integer call) { this.name = name; this.call = call; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getCall() { return call; } public void setCall(Integer call) { this.call = call; } @Override public String toString() { return 'Student{' +'name=’' + name + ’’’ +', call=' + call +’}’; }}

實(shí)例Controller

package com.iflytek.odeon.shipper.controller;import com.iflytek.odeon.shipper.model.rx.Student;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.*;/** * 測試注解及調(diào)試功能API */@RestController@RequestMapping('/v1')public class SampleController { @PostMapping('/hi') public Student hi(@RequestBody() Student student) { return new Student(student.getName(), student.getCall()); } @PostMapping('/hello') public Student hello(@RequestParam(value = 'name') String name, @RequestParam(value = 'call') Integer call) { Student stuResponse = new Student(); stuResponse.setName(name + 'call'); stuResponse.setCall(call); return stuResponse; } @GetMapping('/hello/{id}') public Integer getUrl(@PathVariable(value = 'id') Integer id) { return id; }}

效果

body

SpringBoot @RequestParam、@PathVaribale、@RequestBody實(shí)戰(zhàn)案例

parme key value

SpringBoot @RequestParam、@PathVaribale、@RequestBody實(shí)戰(zhàn)案例

pathvar/{id}

SpringBoot @RequestParam、@PathVaribale、@RequestBody實(shí)戰(zhàn)案例

到此這篇關(guān)于SpringBoot @RequestParam、@PathVaribale、@RequestBody實(shí)戰(zhàn)案例的文章就介紹到這了,更多相關(guān)SpringBoot @RequestParam、@PathVaribale、@RequestBody內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!

標(biāo)簽: Spring
相關(guān)文章:
主站蜘蛛池模板: 一级一级 a爱片免费视频 | 91在线精品亚洲一区二区 | 不卡无毒免费毛片视频观看 | 成人免费视频一区二区三区 | 99久久精品国产一区二区 | 亚洲欧洲国产视频 | 国产精品免费视频一区二区三区 | 久草在线免费看 | 精品在线一区二区三区 | 在线精品欧美日韩 | 日韩精品亚洲专区在线观看 | 天天看夜夜看 | a级毛片免费播放 | 国产99视频免费精品是看6 | 怡红院亚洲怡红院首页 | 九九久久国产精品 | 狠狠一区 | 久久精品视频免费 | 天干天干天啪啪夜爽爽色 | 97视频久久| 日一区二区 | 久久精品欧美日韩精品 | 日韩在线黄色 | 三级毛片子 | 久久精品免费观看久久 | 亚洲国产毛片aaaaa无费看 | 国产网曝手机视频在线观看 | 国产一区中文字幕在线观看 | 国产一区二区免费不卡在线播放 | 99久久香蕉国产综合影院 | www中文字幕 | 久草资源福利 | 国产成人 免费观看 | 交性视频免费看 | 亚洲一级香蕉视频 | 久久免费观看国产精品 | 免费欧洲毛片a级视频无风险 | 亚洲精品一区二区久久 | 国内9l视频自拍 | 欧美毛片a级毛片免费观 | 欧美成人26uuu欧美毛片 |