white knight

导航

 

@SpringBootApplication

@EnableJpaAuditing

public class Application {...}

 

@Component

public class AuditorAwareImpl implements AuditorAware<String> {

  public String getCurrentAuditor() {

    return "aaa";

  }

}

 

@Entity

@EntityListeners(AuditingEntityListener.class)

public class A {

  @CreatedBy

  private String addUser;

  

  @LastModifiedBy

  private String modifyUser;

 

  @CreatedDate

  private LocalDateTime addTime;

 

  @LastModifiedDate

  private LocalDateTime modifyTime;

}

 

posted on 2018-04-27 16:23  white knight  阅读(1040)  评论(0编辑  收藏  举报