1234567891011121314151617181920212223242526272829303132333435 |
- package com.fdkankan.ucenter.service.impl;
- import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
- import com.fdkankan.ucenter.entity.UserPlatform;
- import com.fdkankan.ucenter.mapper.IUserPlatformMapper;
- import com.fdkankan.ucenter.service.IUserPlatformService;
- import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
- import org.springframework.stereotype.Service;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.stream.Collectors;
- /**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author
- * @since 2024-11-19
- */
- @Service
- public class UserPlatformServiceImpl extends ServiceImpl<IUserPlatformMapper, UserPlatform> implements IUserPlatformService {
- @Override
- public List<String> getByUserId(Long id) {
- LambdaQueryWrapper<UserPlatform> wrapper = new LambdaQueryWrapper<>();
- wrapper.eq(UserPlatform::getUserId,id);
- List<UserPlatform> list = this.list(wrapper);
- if(list.isEmpty()){
- return new ArrayList<>();
- }
- return list.stream().map(UserPlatform::getPlatformKey).collect(Collectors.toList());
- }
- }
|