Lombok

Lombok

springboot2.4.2

mvn依赖 

<dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.12</version>
            <scope>provided</scope>
        </dependency>

 

pojo例子

package com.xjsun.bookmanager.pojo;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Author {
    private int id;
    private String name;
}

 

上一篇:mac版eclipse安装lombok


下一篇:springcloud项目导入lombok之后仍然存在 this(code,message,data:null);中data未识别爆红