6,笔记

1,UserDetails是SpringSecurity验证框架内部提供的用户验证接口
   进一步了解  https://www.jianshu.com/p/c3b49d0a490b
2,jpa用法
    List userEntity=userJPA.findusername(user.getName());

 @Query(value = "select * from t_user where t_name=?1",nativeQuery = true)
    List findusername(String name);
    //编号
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ali_id")
3,判断参数为空的验证和去除参数的空格
    siteId = (siteId == null ? 0 : siteId.trim());
  userId = (userId == null ? 0 : userId.trim());
  gamecategory = (gamecategory == null ? 0 : gamecategory.trim());
account = (account == null ? "" : account.trim());


4,字符串判断为空】
   Strings.isNullOrEmpty()
      if (Strings.isNullOrEmpty(platFormCode)) {
            return true;
        }

前提要到瑞jar'
              
            com.google.guava
            guava
            25.1-jre
            compile
        

5, StringUtils.isEmpty 验证
public static String encodePassword(String psw) {
    if(StringUtils.isEmpty(psw)){
        return null;
    }else{
        return DigestUtils.sha1Hex(psw);
    }
} 

6,扫描包  :
 @ComponentScan() ,@ComponentScan(basePackages={"cn.kfit","org.kfit"})

你可能感兴趣的:(6,笔记)