当前位置:网站首页>Swagger2 shows that there is a problem with the get interface, which can be solved with annotations
Swagger2 shows that there is a problem with the get interface, which can be solved with annotations
2022-07-25 09:32:00 【Program Yuan who just wants to make money】
Code access swagger after , The successful running , but get The parameters displayed by the interface are body, This is not in line with

normal swagger It will appear get The interface looks like this :

I have tried several annotation modifications , Finally, I got it right !
Join in @ApiImplicitParams This annotation , It can be solved , The value inside can be modified according to your own parameters !
/**
* Text messaging
* phoneNumbers Mobile number to be sent
* templateParam Variable substitution in templates JSON strand , The template content is " Your verification code is :${code}, Do not disclose to others !"
*/
@GetMapping(value = "/sendSms")
@ApiOperation(value = " Send SMS verification code ")
@ApiImplicitParams({
@ApiImplicitParam(value = " Phone number ", name = "phoneNumbers",required = true,paramType = "query",dataType = "String"),
@ApiImplicitParam(value = " SMS template code ,0: Sign in ,1: register ", name = "templateCode",required = true,paramType = "query",dataType = "String"),
})
public ResponseData sendSms(@RequestParam @NotBlank @Pattern(regexp = "^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\\\\d{8}$")
String phoneNumbers, @RequestParam @NotBlank String templateCode) {
log.info("phoneNumbers:{},templateCode:{}",phoneNumbers,templateCode);边栏推荐
猜你喜欢

*6-2 CCF 2015-03-3 节日

CentOS changes MySQL database directory

初始Flask以及简单地上手应用

@4-1 CCF 2020-06-1 线性分类器

为什么要使用JSON.stringify()和JSON.parse()
![[De1CTF 2019]SSRF Me](/img/12/44c37cc713b49172a10579c9628c94.png)
[De1CTF 2019]SSRF Me
![[De1CTF 2019]SSRF Me](/img/12/44c37cc713b49172a10579c9628c94.png)
[De1CTF 2019]SSRF Me

Publish Yum private server using nexus3 (offline intranet)

@3-1 CCF 2020-09-1 称检测点查询

Unable to start debugging on the web server, the web server failed to find the requested resource
随机推荐
Go foundation 2
SSM框架整合,简单案例
The interviewer asked: how to prevent oversold? There are several ways to achieve it
@1-1 CCF 2021-04-1 灰度直方图
【代码源】每日一题 国家铁路
*6-3 节约小能手
PHP网站设计思路
*6-2 CCF 2015-03-3 节日
idea实用tips---如今将pom.xml(红色)改为pom.xml(蓝色)
数据控制语言(DCL)
Redis安装(Ubuntu)
redis的五种数据结构原理分析
C#语言和SQL Server数据库技术
通过robocopy对文件/夹进行复制
Mongodb exploration phase [easy to understand]
*6-1 CCF 2015-03-2 数字排序
Notes on in-depth analysis of C language 1
C#语言和SQL Server数据库技术
【cf】Round 128 C. Binary String
[De1CTF 2019]SSRF Me