api定义
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
package org.xyzh.api.usercenter.achievement;
|
||||
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbAchievement;
|
||||
import org.xyzh.common.dto.usercenter.TbUserAchievement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 用户成就服务接口
|
||||
* @filename UserAchievementService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface UserAchievementService {
|
||||
|
||||
/**
|
||||
* @description 获取所有成就列表
|
||||
* @param type 成就类型(可选)
|
||||
* @param level 成就等级(可选)
|
||||
* @return ResultDomain<TbAchievement> 成就列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbAchievement> getAllAchievements(Integer type, Integer level);
|
||||
|
||||
/**
|
||||
* @description 获取用户已获得的成就
|
||||
* @param userID 用户ID
|
||||
* @param type 成就类型(可选)
|
||||
* @return ResultDomain<TbUserAchievement> 用户成就列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserAchievement> getUserAchievements(String userID, Integer type);
|
||||
|
||||
/**
|
||||
* @description 检查用户是否已获得成就
|
||||
* @param userID 用户ID
|
||||
* @param achievementID 成就ID
|
||||
* @return ResultDomain<Boolean> 是否已获得
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<Boolean> hasAchievement(String userID, String achievementID);
|
||||
|
||||
/**
|
||||
* @description 授予用户成就
|
||||
* @param userID 用户ID
|
||||
* @param achievementID 成就ID
|
||||
* @return ResultDomain<TbUserAchievement> 授予结果
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserAchievement> grantAchievement(String userID, String achievementID);
|
||||
|
||||
/**
|
||||
* @description 获取成就详情
|
||||
* @param achievementID 成就ID
|
||||
* @return ResultDomain<TbAchievement> 成就详情
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbAchievement> getAchievementDetail(String achievementID);
|
||||
|
||||
/**
|
||||
* @description 检查用户是否满足成就条件
|
||||
* @param userID 用户ID
|
||||
* @param achievementID 成就ID
|
||||
* @return ResultDomain<Boolean> 是否满足条件
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<Boolean> checkAchievementCondition(String userID, String achievementID);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.xyzh.api.usercenter.browse;
|
||||
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbUserBrowseRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 用户浏览记录服务接口
|
||||
* @filename UserBrowseRecordService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface UserBrowseRecordService {
|
||||
|
||||
/**
|
||||
* @description 添加浏览记录
|
||||
* @param browseRecord 浏览记录
|
||||
* @return ResultDomain<TbUserBrowseRecord> 添加结果
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserBrowseRecord> addBrowseRecord(TbUserBrowseRecord browseRecord);
|
||||
|
||||
/**
|
||||
* @description 获取用户浏览记录
|
||||
* @param userID 用户ID
|
||||
* @param browseType 浏览类型(可选)
|
||||
* @param limit 限制数量(可选)
|
||||
* @return ResultDomain<TbUserBrowseRecord> 浏览记录列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserBrowseRecord> getUserBrowseRecords(String userID, Integer browseType, Integer limit);
|
||||
|
||||
/**
|
||||
* @description 删除浏览记录
|
||||
* @param recordID 记录ID
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<Boolean> deleteBrowseRecord(String recordID);
|
||||
|
||||
/**
|
||||
* @description 清空用户浏览记录
|
||||
* @param userID 用户ID
|
||||
* @param browseType 浏览类型(可选)
|
||||
* @return ResultDomain<Boolean> 清空结果
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<Boolean> clearUserBrowseRecords(String userID, Integer browseType);
|
||||
|
||||
/**
|
||||
* @description 获取浏览统计
|
||||
* @param userID 用户ID
|
||||
* @param browseType 浏览类型(可选)
|
||||
* @return ResultDomain<Integer> 浏览次数
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<Integer> getBrowseCount(String userID, Integer browseType);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.xyzh.api.usercenter.collection;
|
||||
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbUserCollection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 用户收藏服务接口
|
||||
* @filename UserCollectionService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface UserCollectionService {
|
||||
|
||||
/**
|
||||
* @description 添加收藏
|
||||
* @param userCollection 收藏信息
|
||||
* @return ResultDomain<TbUserCollection> 添加结果
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserCollection> addCollection(TbUserCollection userCollection);
|
||||
|
||||
/**
|
||||
* @description 取消收藏
|
||||
* @param userID 用户ID
|
||||
* @param collectionType 收藏类型
|
||||
* @param collectionID 收藏对象ID
|
||||
* @return ResultDomain<Boolean> 取消结果
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<Boolean> removeCollection(String userID, Integer collectionType, String collectionID);
|
||||
|
||||
/**
|
||||
* @description 检查是否已收藏
|
||||
* @param userID 用户ID
|
||||
* @param collectionType 收藏类型
|
||||
* @param collectionID 收藏对象ID
|
||||
* @return ResultDomain<Boolean> 是否已收藏
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<Boolean> isCollected(String userID, Integer collectionType, String collectionID);
|
||||
|
||||
/**
|
||||
* @description 获取用户收藏列表
|
||||
* @param userID 用户ID
|
||||
* @param collectionType 收藏类型(可选)
|
||||
* @return ResultDomain<TbUserCollection> 收藏列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserCollection> getUserCollections(String userID, Integer collectionType);
|
||||
|
||||
/**
|
||||
* @description 获取收藏详情
|
||||
* @param userID 用户ID
|
||||
* @param collectionType 收藏类型
|
||||
* @param collectionID 收藏对象ID
|
||||
* @return ResultDomain<TbUserCollection> 收藏详情
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserCollection> getCollectionDetail(String userID, Integer collectionType, String collectionID);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package org.xyzh.api.usercenter.points;
|
||||
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbUserPoints;
|
||||
import org.xyzh.common.dto.usercenter.TbPointsRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 用户积分服务接口
|
||||
* @filename UserPointsService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface UserPointsService {
|
||||
|
||||
/**
|
||||
* @description 获取用户积分信息
|
||||
* @param userID 用户ID
|
||||
* @return ResultDomain<TbUserPoints> 用户积分信息
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserPoints> getUserPoints(String userID);
|
||||
|
||||
/**
|
||||
* @description 更新用户积分
|
||||
* @param userPoints 用户积分信息
|
||||
* @return ResultDomain<TbUserPoints> 更新结果
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserPoints> updateUserPoints(TbUserPoints userPoints);
|
||||
|
||||
/**
|
||||
* @description 增加用户积分
|
||||
* @param userID 用户ID
|
||||
* @param points 积分数量
|
||||
* @param sourceType 来源类型
|
||||
* @param sourceID 来源ID
|
||||
* @param description 说明
|
||||
* @return ResultDomain<TbUserPoints> 更新结果
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserPoints> addUserPoints(String userID, Integer points, Integer sourceType, String sourceID, String description);
|
||||
|
||||
/**
|
||||
* @description 消费用户积分
|
||||
* @param userID 用户ID
|
||||
* @param points 积分数量
|
||||
* @param sourceType 来源类型
|
||||
* @param sourceID 来源ID
|
||||
* @param description 说明
|
||||
* @return ResultDomain<TbUserPoints> 更新结果
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserPoints> consumeUserPoints(String userID, Integer points, Integer sourceType, String sourceID, String description);
|
||||
|
||||
/**
|
||||
* @description 获取用户积分记录
|
||||
* @param userID 用户ID
|
||||
* @param type 类型(1获得 2消费)
|
||||
* @param sourceType 来源类型
|
||||
* @return ResultDomain<TbPointsRecord> 积分记录列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbPointsRecord> getPointsRecords(String userID, Integer type, Integer sourceType);
|
||||
|
||||
/**
|
||||
* @description 添加积分记录
|
||||
* @param pointsRecord 积分记录
|
||||
* @return ResultDomain<TbPointsRecord> 添加结果
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbPointsRecord> addPointsRecord(TbPointsRecord pointsRecord);
|
||||
}
|
||||
Reference in New Issue
Block a user