refactor(notify):重构通知授权模块,移除外部接口

- 移除用户通知授权检查、消费和记录查询的外部接口
- 废弃相关请求和响应 DTO 类文件
- 将授权检查和统计功能迁移至内部服务调用
- 新增批量检查授权方法 batchCheckAuthorization- 新增获取用户授权统计信息方法 getAuthorizationStats
- 更新 UserNotificationAuthorizationService 接口定义- 优化 ServiceImpl 中的数据处理逻辑和引入 Collectors 工具类
This commit is contained in:
2025-10-14 23:18:49 +08:00
parent 44b20890d5
commit ff708a3fc3
8 changed files with 111 additions and 355 deletions

View File

@@ -2,7 +2,9 @@ package com.ycwl.basic.service;
import com.ycwl.basic.model.pc.notify.entity.UserNotificationAuthorizationEntity;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 用户通知授权记录Service接口
@@ -84,4 +86,46 @@ public interface UserNotificationAuthorizationService {
* @return 授权记录
*/
UserNotificationAuthorizationEntity getById(Long id);
/**
* 批量检查多个模板的授权状态
*
* @param memberId 用户ID
* @param templateIds 模板ID列表
* @param scenicId 景区ID
* @return 授权记录映射
*/
Map<String, UserNotificationAuthorizationEntity> batchCheckAuthorization(
Long memberId, List<String> templateIds, Long scenicId);
/**
* 获取用户授权统计信息
*
* @param memberId 用户ID
* @return 统计信息
*/
AuthorizationStats getAuthorizationStats(Long memberId);
/**
* 授权统计信息DTO
*/
class AuthorizationStats {
private int totalTemplates; // 总模板数
private int totalAuthorizations; // 总授权次数
private int totalConsumed; // 总消费次数
private int totalRemaining; // 剩余授权次数
private Date queryTime; // 查询时间
// getters and setters
public int getTotalTemplates() { return totalTemplates; }
public void setTotalTemplates(int totalTemplates) { this.totalTemplates = totalTemplates; }
public int getTotalAuthorizations() { return totalAuthorizations; }
public void setTotalAuthorizations(int totalAuthorizations) { this.totalAuthorizations = totalAuthorizations; }
public int getTotalConsumed() { return totalConsumed; }
public void setTotalConsumed(int totalConsumed) { this.totalConsumed = totalConsumed; }
public int getTotalRemaining() { return totalRemaining; }
public void setTotalRemaining(int totalRemaining) { this.totalRemaining = totalRemaining; }
public Date getQueryTime() { return queryTime; }
public void setQueryTime(Date queryTime) { this.queryTime = queryTime; }
}
}