当前位置:网站首页>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);
}
}
边栏推荐
- 苹果MobileOne: 移动端仅需1ms的高性能骨干
- 2022 | framework for Android interview -- Analysis of the core principles of binder, handler, WMS and AMS!
- 普通人应当如何挑选年金险产品?
- 在毕设中学习03
- Web development model selection, who graduated from web development
- 深度学习与CV教程(14) | 图像分割 (FCN,SegNet,U-Net,PSPNet,DeepLab,RefineNet)
- 浙大联合微软亚研院发布视频识别新方法,可对视频逐帧识别且无需,数据标记,或可用于手语翻译等
- arguments.callee 实现函数递归调用
- C# 设置或验证 PDF中的文本域格式
- 刷题笔记(十三)--二叉树:前中后序遍历(复习)
猜你喜欢

Intermediate web development engineer, interview questions + Notes + project practice

解决swagger文档接口404的问题

JS addition and multiplication error resolution number precision

JS to realize the rotation chart (riding light). Pictures can be switched left and right. Moving the mouse will stop the rotation

【LeetCode】1049. Weight of the last stone II (wrong question 2)

CVPR 2022 | 文本引导的实体级别图像操作ManiTrans

Elk - elastalert largest pit

2022 | framework for Android interview -- Analysis of the core principles of binder, handler, WMS and AMS!

中级web开发工程师,面试题+笔记+项目实战

ELK - ElastAlert最大的坑
随机推荐
让你理解选择排序(C语言)
Etcd的运行时重配置
Centos7.x下安装mysql8遇到的问题Couldn‘t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
WordPress database cache plug-in: DB cache Reloaded
How should ordinary people choose annuity insurance products?
Use cache to reduce network requests
在毕设中学习03
What is a Gerber file? Introduction to PCB Gerber file
Elk - elastalert largest pit
Hang up the interviewer
Guangdong municipal safety construction data management software 2022 new forms are coming
[Chapter II Relationship between genes and chromosomes] summary of biological knowledge - Biology in grade one of senior high school
中文输入法输入事件composition的使用
log4j-slf4j-impl cannot be present with log4j-to-slf4j
PS does not display text cursor, text box, and does not highlight after selection
Golang uses XOR ^ to exchange two variables and encrypt / decrypt them
Node连接MySql数据库写模糊查询接口
调整数组顺序使奇数位于偶数前面(C语言)
Guice integrated properties configuration
MSF CS OpenSSL traffic encryption