- 实现问题列表获取、问题创建、更新和删除功能 - 添加用户问题列表获取和单个问题获取功能 - 实现问题搜索功能 - 优化消息服务实现 - 重构部分现有服务的代码结构
84 lines
2.4 KiB
Java
84 lines
2.4 KiB
Java
package com.example.copykamanotes.service;
|
||
|
||
import com.example.copykamanotes.model.base.ApiResponse;
|
||
import com.example.copykamanotes.model.dto.user.LoginRequest;
|
||
import com.example.copykamanotes.model.dto.user.RegisterRequest;
|
||
import com.example.copykamanotes.model.dto.user.UpdateUserRequest;
|
||
import com.example.copykamanotes.model.dto.user.UserQueryParam;
|
||
import com.example.copykamanotes.model.entity.User;
|
||
import com.example.copykamanotes.model.vo.user.AvatarVO;
|
||
import com.example.copykamanotes.model.vo.user.LoginUserVO;
|
||
import com.example.copykamanotes.model.vo.user.RegisterVO;
|
||
import com.example.copykamanotes.model.vo.user.UserVO;
|
||
import org.springframework.transaction.annotation.Transactional;
|
||
import org.springframework.web.multipart.MultipartFile;
|
||
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
|
||
@Transactional
|
||
public interface UserService {
|
||
|
||
/**
|
||
* 注册
|
||
*
|
||
* @param registerRequest 注册请求
|
||
* @return 注册成功用户信息的响应对象
|
||
*/
|
||
ApiResponse<RegisterVO> register(RegisterRequest registerRequest);
|
||
|
||
/**
|
||
* 登录
|
||
*
|
||
* @param loginRequest 登录请求
|
||
* @return 登录成功用户信息的响应对象
|
||
*/
|
||
ApiResponse<LoginUserVO> login(LoginRequest loginRequest);
|
||
|
||
/**
|
||
* 自动登录服务
|
||
*
|
||
* @return 登录成功用户信息的响应对象
|
||
*/
|
||
ApiResponse<LoginUserVO> whoami();
|
||
|
||
/**
|
||
* 获取用户信息
|
||
*
|
||
* @param userId 用户ID
|
||
* @return 用户信息的响应对象
|
||
*/
|
||
ApiResponse<UserVO> getUserInfo(Long userId);
|
||
|
||
/**
|
||
* 更新用户信息
|
||
*
|
||
* @param updateUserRequest 更新所要包含的用户信息
|
||
* @return 更新成功用户信息的响应对象
|
||
*/
|
||
ApiResponse<LoginUserVO> updateUserInfo(UpdateUserRequest updateUserRequest);
|
||
|
||
/**
|
||
* 根据用户 ID 列表查询并转换为 Map 格式
|
||
*
|
||
* @param authorIds 包含多个用户 ID 的列表
|
||
* @return 一个 Map,其中键是 userId,值是对应的 User 对象
|
||
*/
|
||
Map<Long, User> getUserMapByIds(List<Long> authorIds);
|
||
|
||
/**
|
||
* 获取用户列表
|
||
* @param userQueryParam 查询参数
|
||
* @return 用户列表
|
||
*/
|
||
ApiResponse<List<User>> getUserList(UserQueryParam userQueryParam);
|
||
|
||
/**
|
||
* 上传用户头像
|
||
*
|
||
* @param file 文件对象
|
||
* @return 包含上传成功头像的 URL 的响应对象
|
||
*/
|
||
ApiResponse<AvatarVO> uploadAvatar(MultipartFile file);
|
||
}
|