AdminMessageService.java 1.62 KB
package com.diligrp.rider.service;

import com.diligrp.rider.entity.RiderMessageTemplate;

import java.util.List;
import java.util.Map;

/**
 * 管理端消息服务
 */
public interface AdminMessageService {

    /**
     * 发送消息给指定骑手
     *
     * @param cityId  城市ID
     * @param riderId 骑手ID
     * @param type    消息类型
     * @param title   标题
     * @param content 内容
     * @param bizType 业务类型
     * @param bizId   业务ID
     */
    void sendToRider(Long cityId, Long riderId, Integer type, String title, String content, String bizType, Long bizId);

    /**
     * 群发消息(城市内所有骑手)
     *
     * @param cityId  城市ID
     * @param type    消息类型
     * @param title   标题
     * @param content 内容
     */
    void broadcastToCity(Long cityId, Integer type, String title, String content);

    /**
     * 查询消息列表(管理端)
     *
     * @param cityId  城市ID
     * @param riderId 骑手ID(可选)
     * @param type    消息类型(可选)
     * @param page    页码
     * @return 分页数据
     */
    Map<String, Object> listMessages(Long cityId, Long riderId, Integer type, Integer page);

    /**
     * 获取模板列表
     *
     * @return 模板列表
     */
    List<RiderMessageTemplate> listTemplates();

    /**
     * 根据模板发送消息(供业务代码调用)
     *
     * @param cityId  城市ID
     * @param riderId 骑手ID
     * @param bizType 业务类型
     * @param params  模板参数
     */
    void sendByTemplate(Long cityId, Long riderId, String bizType, Map<String, Object> params);
}