mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-07-23 09:39:33 +08:00
代码优化
This commit is contained in:
parent
1af46e9323
commit
404305aa71
@ -1,7 +1,6 @@
|
||||
package xyz.playedu.api.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -26,16 +25,12 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||
}
|
||||
|
||||
public AdminUser findByEmail(String email) {
|
||||
QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("email", email);
|
||||
return this.getBaseMapper().selectOne(queryWrapper);
|
||||
return getOne(query().getWrapper().eq("email", email));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdminUser findById(Integer id) {
|
||||
QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id", id);
|
||||
return this.getBaseMapper().selectOne(queryWrapper);
|
||||
return getOne((query().getWrapper().eq("id", id)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user