using MyCode.Project.Domain.Businesses.Sms.Templates; using MyCode.Project.Domain.Businesses.WorkProcess; using MyCode.Project.Domain.Message.Request.Clerk; using MyCode.Project.Domain.Message.Request.Message; using MyCode.Project.Domain.Message.Response.Message; using MyCode.Project.Domain.Message.Response.Shop; using MyCode.Project.Domain.Message.Response.User; using MyCode.Project.Infrastructure.Common; using MyCode.Project.Infrastructure.Enumeration; using MyCode.Project.Infrastructure.Extensions; using MyCode.Project.Services; using Senparc.CO2NET.Extensions; using System; using System.Collections.Generic; using System.Web.Http; namespace MyCode.Project.WebApi.Areas.Wechat.Controllers { /// ///消息中心 相关 /// public class SysMessageController : BaseWechatController { private ISysMessageService _sysMessageService; private IChatService _chatService; private IShopActionLogService _shopActionLogService; private INotificationTaskService _notificationTaskService; /// /// 初始化一个类型的实例 /// public SysMessageController(ISysMessageService sysMessageService , IChatService chatService , IShopActionLogService shopActionLogService , INotificationTaskService notificationTaskService ) { _sysMessageService = sysMessageService; _chatService = chatService; _shopActionLogService = shopActionLogService; _notificationTaskService = notificationTaskService; } #region 消息中心分页列表 /// /// 消息中心分页列表 /// /// [HttpPost] public PageResult GetMessages(PagedSearch search) { if (!search.Condition.ShopID.HasValue) { PagedSearch newSearch = new PagedSearch(); newSearch = search; return _sysMessageService.GetMessages(this.CurrentLogin, newSearch); } if (search.PageSize > 1 && search.Condition.ShopID.HasValue) { //记录小程序操作 if (this.CurrentLogin.RoleType == LoginRoleType.CustomerID) _shopActionLogService.SetShopActionLog(search.Condition.ShopID.SafeValue(), this.CurrentLogin.CustomerId.SafeValue(), 1, 12); else _shopActionLogService.SetShopActionLog(search.Condition.ShopID.SafeValue(), this.CurrentLogin.ClerkId.SafeValue(), 2, 12); } return _sysMessageService.GetMessages(this.CurrentLogin, search); } #endregion //#region 公告栏的消息 ///// ///// 公告栏的消息 ///// ///// //[HttpPost] //public PageResult GetMessages(PagedSearch search) //{ // return _sysMessageService.GetMessages(this.CurrentLogin, search); //} //#endregion #region 消息详情 /// /// 消息详情 /// /// 消息主键 [HttpGet] public void ddddd(Guid memberId, Guid shopId, Guid sheetId) { _chatService.SendMemberChatService(memberId, shopId, sheetId); } #endregion /// /// 发送短信 /// /// [HttpPost] [AllowAnonymous] public void SendSmsMsg(SmsNotificationData ddd) { _notificationTaskService.SendSmsMsg(ddd.ToJson()); } #region 消息详情 /// /// 消息详情 /// /// 消息主键 [HttpGet] [AllowAnonymous] public MessageDetailResp GetMessageDetail(Guid ID) { return _sysMessageService.GetMessageDetail(ID); } #endregion } }