Springboot的各种注解

 

@TableFiled:mybatisPlus提供的注解—自动填充策略,在此类中统一为公共字段赋值

  例如:

@TableField(fill = FieldFill.INSERT) //插入时填充字段
private LocalDateTime createTime;

@TableField(fill = FieldFill.INSERT_UPDATE) //插入和更新时填充字段
private LocalDateTime updateTime;

@TableField(fill = FieldFill.INSERT) //插入时填充字段
private Long createUser;

@TableField(fill = FieldFill.INSERT_UPDATE) //插入和更新时填充字段
private Long updateUser;


@TableField("FName") //驼峰命名 
private String fname;
 

@PathVaraible:@PathVaraible 注解和@RequestMapping或者具体的GetMapping配合使用,在path中通过{}中指定在url中传递的参数

   例如:

@GetMapping("/{id}")
public R<Employee> getById(@PathVariable Long id){
    Employee id1 = employeeService.getById(id);
}

 

posted @ 2022-06-28 16:36  Yellow98  阅读(130)  评论(0)    收藏  举报