当前位置:网站首页>Solve the problem of swagger document interface 404
Solve the problem of swagger document interface 404
2022-06-11 11:56:00 【Code GuWa of nobody】
Problem description :swagger Document test interface 404 Check and solve , In case of such problems, let's see how to solve and troubleshoot them .

The interface test :

How to solve this problem at this time ? Log
1, Analyze the root of the problem , If permission control is added, release swagger Address , It shows that we are not swagger No release , There is a problem with authentication .

There seems to be no problem with log authentication ? What is the cause of that ?

GET http://localhost:11031/{GET%20/ydpw/collection/list}
In fact, many people would say that there is an extra space in this address, but it is not , Transcoding is normal .
So what is the problem ?
The reason is that our service name and route name are the same, which is not standardized , As a result, the address cannot be found. Let's remove the name of the controller .

The code is not standardized , No, it's rotten , So the code should be standardized ...
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill Zhuang Qian ([email protected])
*/
package cn.citms.portal.cms.controller;
import cn.citms.example.entity.cms.TblDirectoryCollection;
import cn.citms.example.vo.cms.DirectoryCollectionVo;
import cn.citms.portal.cms.service.DirectoryService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import org.apache.commons.lang.StringUtils;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.UUID;
/**
* Answer options controller
*
* @author Blade
* @since 2022-02-16
*/
@RestController
@AllArgsConstructor
@RequestMapping("/collection")
@Api(value = " Catalog collection ", tags = " Catalog collection ")
public class DirectoryCollectionController extends BladeController {
private DirectoryService directoryService;
/**
* details
*/
@GetMapping("/list")
@ApiOperationSupport(order = 1)
@ApiOperation(value = " All favorites of the current user ", notes = " All favorites of the current user ")
public R detail(DirectoryCollectionVo directoryCollection) {
List<DirectoryCollectionVo> result = directoryService.list(directoryCollection);
return R.data(result);
}
}
边栏推荐
- ELK - ElastAlert最大的坑
- 吊打面试官,涨姿势
- Publish WordPress database cache plug-in: DB cache reloaded 3.1
- 浙大联合微软亚研院发布视频识别新方法,可对视频逐帧识别且无需,数据标记,或可用于手语翻译等
- [file upload vulnerability 06] server file content detection and bypass experiment + image horse production method (based on upload-labs-14 shooting range)
- Create a folder in the WordPress Library
- Runtime reconfiguration of etcd
- 2019 book list
- 深度学习与CV教程(14) | 图像分割 (FCN,SegNet,U-Net,PSPNet,DeepLab,RefineNet)
- Notes on topic brushing (XIV) -- binary tree: sequence traversal and DFS, BFS
猜你喜欢

01_ Description object_ Class diagram
![my. Binlog startup failure caused by the difference between [mysql] and [mysqld] in CNF](/img/bd/a28e74654c7821b3a9cd9260d2e399.png)
my. Binlog startup failure caused by the difference between [mysql] and [mysqld] in CNF

How does Sister Feng change to ice?

MSF CS OpenSSL traffic encryption

C# 读取txt文件生成Word文档

JS addition and multiplication error resolution number precision

How to solve the problem that high-precision positioning technologies such as ultra wideband UWB, Bluetooth AOA and RTK cannot be widely used due to their high cost? Adopt the idea of integrated deplo

web开发选型,web开发毕业谁

刷题笔记(十三)--二叉树:前中后序遍历(复习)
![[第二章 基因和染色体的关系]生物知识概括–高一生物](/img/f0/9f78682798a7874ba176797a6b22ca.png)
[第二章 基因和染色体的关系]生物知识概括–高一生物
随机推荐
C # set or verify the format of text field in PDF
Hang up the interviewer
Where is it safer to open an account for soda ash futures? How much capital is needed for a transaction?
JEST 单元测试说明 config.json
Eulato
Test cos HTML cache static cache plug-in
Memory mapping image of the grayloc module in the surfacefinder process
[JUC supplementary] immutable object, shared meta mode, final principle
js面试题---箭头函数,find和filter some和every
中文输入法输入事件composition的使用
Use cache to reduce network requests
17.4 creating multiple threads, data sharing problem analysis and case code
Hamiltonian graph
arguments.callee 实现函数递归调用
Typescript compilation options and configuration files
Intl.numberformat set number format
2019 book list
Intermediate web development engineer, interview questions + Notes + project practice
Problems encountered in installing mysql8 under centos7.x couldn't open file /etc/pki/rpm-gpg/rpm-gpg-key-mysql-2022
How does Sister Feng change to ice?