xiaoqiantx

This commit is contained in:
xiaoqiantx223 2024-07-17 17:42:52 +08:00
parent 03e3825dc0
commit 1289e2a378
3 changed files with 27 additions and 2 deletions

View File

@ -1,7 +1,6 @@
package net.maku.maku.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.*;
import java.math.BigDecimal;
import java.util.Date;

View File

@ -1,5 +1,6 @@
package net.maku.maku.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -16,6 +17,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.UUID;
/**
*
@ -60,4 +62,28 @@ public class TUserServiceImpl extends BaseServiceImpl<TUserDao, TUserEntity> imp
removeByIds(idList);
}
@Override
public TUserEntity login(TUserEntity entity) {
LambdaQueryWrapper<TUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TUserEntity::getUsername, entity.getUsername());
wrapper.eq(TUserEntity::getPassword, entity.getPassword());
TUserEntity one = getOne(wrapper);
if(ObjectUtils.isNotNull(one)) {
UUID uuid = UUID.randomUUID();
one.setAvatar(uuid.toString());
updateById(one);
return one;
}
return null;
}
@Override
public TUserVO updateUser(TUserVO vo) {
TUserEntity entity = new TUserEntity();
entity.setUsername(vo.getUsername());
entity.setPassword(vo.getPassword());
updateById(entity);
return vo;
}
}

View File

@ -4,7 +4,7 @@ spring:
database: 0
host: 127.0.0.1
port: 6379
# password: wxbc5b16589b8f183e
password: 123456
#timeout: 6000ms # 连接超时时长(毫秒)
datasource:
dynamic: