You've already forked FrameTour-BE
feat(notify): 新增用户通知授权管理功能
- 添加用户通知授权记录的完整CRUD操作 - 实现授权次数的记录与消费逻辑 - 提供授权状态检查与剩余次数查询接口 - 支持按用户、模板或景区维度查询授权记录 - 新增授权统计信息接口,包括总授权数、消费数等 - 完成移动端相关请求/响应DTO定义 - 集成MyBatis Mapper实现数据持久化操作 - 添加服务层事务控制确保操作一致性
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
package com.ycwl.basic.service;
|
||||
|
||||
import com.ycwl.basic.model.pc.notify.entity.UserNotificationAuthorizationEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户通知授权记录Service接口
|
||||
*
|
||||
* @Author: System
|
||||
* @Date: 2024/12/28
|
||||
*/
|
||||
public interface UserNotificationAuthorizationService {
|
||||
|
||||
/**
|
||||
* 检查用户是否对指定模板有授权
|
||||
*
|
||||
* @param memberId 用户ID
|
||||
* @param templateId 模板ID
|
||||
* @param scenicId 景区ID
|
||||
* @return 授权记录,如果没有授权返回null
|
||||
*/
|
||||
UserNotificationAuthorizationEntity checkAuthorization(Long memberId, String templateId, Long scenicId);
|
||||
|
||||
/**
|
||||
* 检查用户是否还有剩余授权次数
|
||||
*
|
||||
* @param memberId 用户ID
|
||||
* @param templateId 模板ID
|
||||
* @param scenicId 景区ID
|
||||
* @return 剩余授权次数,0表示没有剩余
|
||||
*/
|
||||
Integer getRemainingCount(Long memberId, String templateId, Long scenicId);
|
||||
|
||||
/**
|
||||
* 记录用户授权
|
||||
*
|
||||
* @param memberId 用户ID
|
||||
* @param templateId 模板ID
|
||||
* @param scenicId 景区ID
|
||||
* @return 授权记录
|
||||
*/
|
||||
UserNotificationAuthorizationEntity recordAuthorization(Long memberId, String templateId, Long scenicId);
|
||||
|
||||
/**
|
||||
* 消费一次授权
|
||||
*
|
||||
* @param memberId 用户ID
|
||||
* @param templateId 模板ID
|
||||
* @param scenicId 景区ID
|
||||
* @return 是否消费成功
|
||||
*/
|
||||
boolean consumeAuthorization(Long memberId, String templateId, Long scenicId);
|
||||
|
||||
/**
|
||||
* 查询用户的授权记录列表
|
||||
*
|
||||
* @param memberId 用户ID
|
||||
* @return 授权记录列表
|
||||
*/
|
||||
List<UserNotificationAuthorizationEntity> getUserAuthorizations(Long memberId);
|
||||
|
||||
/**
|
||||
* 查询用户对指定模板的授权记录列表
|
||||
*
|
||||
* @param memberId 用户ID
|
||||
* @param templateId 模板ID
|
||||
* @return 授权记录列表
|
||||
*/
|
||||
List<UserNotificationAuthorizationEntity> getUserAuthorizationsByTemplate(Long memberId, String templateId);
|
||||
|
||||
/**
|
||||
* 查询景区的授权记录列表
|
||||
*
|
||||
* @param scenicId 景区ID
|
||||
* @return 授权记录列表
|
||||
*/
|
||||
List<UserNotificationAuthorizationEntity> getScenicAuthorizations(Long scenicId);
|
||||
|
||||
/**
|
||||
* 根据ID查询授权记录
|
||||
*
|
||||
* @param id 记录ID
|
||||
* @return 授权记录
|
||||
*/
|
||||
UserNotificationAuthorizationEntity getById(Long id);
|
||||
}
|
||||
Reference in New Issue
Block a user