当前位置:网站首页>Logical deletion_ Swagger2 framework integration
Logical deletion_ Swagger2 framework integration
2022-06-11 03:21:00 【The bright moon is always fresh】
Logical deletion
1、 adding annotations 
2、 Add the plug-in
/** * Logical removal plug-in */
@Bean
public ISqlInjector sqlInjector() {
return new LogicSqlInjector();
}
3、 Method realization
@DeleteMapping("{id}")
public boolean delTeacher(@PathVariable String id){
boolean remove = teacherService.removeById(id);
return remove;
}
Swagger2 Framework integration
stay common Modular pom File add dependency
<!--swagger-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<scope>provided </scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<scope>provided </scope>
</dependency>
Create a three-level module service_base
(2) Add configuration class
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket webApiConfig(){
return new Docket(DocumentationType.SWAGGER_2)
.groupName("webApi")
.apiInfo(webApiInfo())
.select()
.paths(Predicates.not(PathSelectors.regex("/admin/.*")))
.paths(Predicates.not(PathSelectors.regex("/error.*")))
.build();
}
private ApiInfo webApiInfo(){
return new ApiInfoBuilder()
.title(" Website - Course Center API file ")
.description(" This document describes the microservice interface definition of the course center ")
.version("1.0")
.contact(new Contact("Helen", "http://atguigu.com", "[email protected]"))
.build();
}
}
边栏推荐
- Three ways of reflection
- Difference between idea open and import project
- C语言指针
- PIP installation Qt5.
- Minimum common ancestor of binary tree
- Log4j use
- How should Xiaobai start the Amazon self support evaluation?
- Artalk | how to build a domestic hyperfusion evolutionary base with minimum investment?
- Multivalued mapping: arraylistmultimap and hashmultimap
- 潮玩力真火力!年轻人第一台巨幕影院?酷开电视Max 86“庞然来袭
猜你喜欢

B_ QuRT_ User_ Guide(16)

js顶部图标菜单点击切换背景色js特效

Correct posture of cocoscreator's native secondary development

If not, use the code generator to generate a set of addition, deletion, modification and query (2)
![[cloud native] what is micro service? How to build it? Teach you how to build the first micro service (framework)](/img/2c/50c692e090d64ab67f7501beb1d989.png)
[cloud native] what is micro service? How to build it? Teach you how to build the first micro service (framework)

【安全科普】挖矿技术,从一个理工男的爱情故事讲起

Artalk | how to build a domestic hyperfusion evolutionary base with minimum investment?

B_QuRT_User_Guide(18)

three.js炫酷科技感背景h5动画

计算机视觉(AI)面试大全
随机推荐
B_ QuRT_ User_ Guide(19)
通过程序启动QQ,实现自动登录.
PostgreSQL source code learning (22) - fault recovery ③ - transaction log registration
GD32 can发送报no mailbox 故障
iQOO 8实测上手体验:王者归来,从不高调
ThoughtWorks. QRcode full-featured generator
B_QuRT_User_Guide(17)
WinDbg virtual machine dual machine debugging driver file debugging
File file = new file ("test.txt") file path
Correct posture of cocoscreator's native secondary development
618将至!全渠道开售,高价低配的OPPO Reno6能赢吗?
ORA-00392 ORA-00312 错误处理
postgresql源码学习(十七)—— MVCC②-快照与隔离级别简介
三维GIS行业需求及展望
{dataSource-1} closing ... {dataSource-1} closed
Vocabulary Construction -- code completion fast food tutorial (3) - word segmentation
ASLR
科技PRO实力测评:高端按摩椅市场综合PK,究竟谁才配得上机皇?
Cygwin reports an error child_ info_ fork::abort: XXX. dll: Loaded to different address: parent(XXX) != child(XXX)
If there is no separation ----- > > log interpretation (3)