using Microsoft.AspNetCore.Mvc; using Nirvana.Common.ApiBase; using YBDevice.NApi.Application.MessageInfo; namespace YBDevice.NApi.Controllers.Api { /// /// 消息管理 /// public class MessageController : BaseController { private readonly IMessageService _messageService; public MessageController(IMessageService messageService) { _messageService = messageService; } /// /// 获取消息模板列表 /// /// 小程序appid /// [HttpGet] public async Task GetTplListAsync(string appid) { return await _messageService.GetTplListAsync(appid); } /// /// 消息订阅 /// /// /// [HttpPost] public async Task SubscribeAsync([FromBody] SubscribeC2SDto data) { return await _messageService.SubscribeAsync(data); } /// /// 获取订阅状态 /// /// 小程序appid /// [HttpGet] public async Task GetSubscribeInfoAsync(string appid) { return await _messageService.GetSubscribeInfoAsync(appid); } /// /// 消息取消订阅 /// /// /// [HttpPost] public async Task UnSubscribeAsync(UnSubscribeC2SDto data) { return await _messageService.UnSubscribeAsync(data); } /// /// 获取客服配置信息 /// /// 小程序appid /// [HttpGet] public async Task GetServiceInfoAsync(string appid) { return await _messageService.GetServiceInfoAsync(appid); } } }