using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using MyCode.Project.Domain.Message.Response.User;
using MyCode.Project.Infrastructure.Constant;
using MyCode.Project.WebApi.Controllers;
using MyCode.Project.Domain.Config;
using MyCode.Project.Services;
using MyCode.Project.Infrastructure.Common;
using MyCode.Project.Domain.Message.Request.User;
using MyCode.Project.Infrastructure.Enumeration;
using MyCode.Project.Domain.Message.Act.User;
using MyCode.Project.Domain.Message.Response.Goods;
using MyCode.Project.Domain.Model;
using MyCode.Project.Domain.Message.Response.Common;
using MyCode.Project.Domain.Businesses.BillKeeping;
using MyCode.Project.Domain.Message.Response.Member;
using MyCode.Project.Domain.Message.Response.WebSocket;
using MyCode.Project.Domain.Message.Response.Chat;
using MyCode.Project.Domain.Message.Request.WebSocket;
namespace MyCode.Project.WebApi.Areas.Wechat.Controllers
{
///
/// WebSocket消息相关,仅供对接返回参数,接口都是无效的
///
public class WebSocketController : BaseWechatController
{
private IWebSocketService _webSocketService;
private IChatService _chatService;
///
///
///
///
public WebSocketController(IWebSocketService webSocketService
, IChatService chatService)
{
_webSocketService = webSocketService;
_chatService = chatService;
}
#region GetHomeMessgeList(获取首页的消息)
///
/// 获取首页的消息(不要对接)
///
///
[HttpPost]
[AllowAnonymous]
public WebSocketMessgeResp> GetHomeMessgeList(MessgeRequst requst)
{
WebSocketMessgeResp> result = new WebSocketMessgeResp>();
result.ContentTxt = new List();
HomeMessgeResp homeMessgeResp = new HomeMessgeResp();
result.ContentTxt.Add(homeMessgeResp);
return result;
}
#endregion
#region GetChatMemberJoin(会话页面--会员进店)
///
/// 会话页面--会员进店(不要对接)
///
///
[HttpGet]
[AllowAnonymous]
public ChatMemberJoin GetChatMemberJoin()
{
ChatMemberJoin result = new ChatMemberJoin();
return result;
}
#endregion
#region GetSampleRemind(会话页面--灰色提醒/邀约/生日提醒)
///
/// 会话页面--灰色提醒/邀约/生日提醒(不要对接)
///
///
[HttpGet]
[AllowAnonymous]
public ChatSampleRemind GetSampleRemind()
{
ChatSampleRemind result = new ChatSampleRemind();
return result;
}
#endregion
#region ChatSheetRemind(会话页面--消费单)
///
/// 会话页面--消费单(不要对接)
///
///
[HttpGet]
[AllowAnonymous]
public ChatSheetRemind GetSheetRemind()
{
ChatSheetRemind result = new ChatSheetRemind();
return result;
}
#endregion
#region ChatServiceRemind(会话页面--服务单)
///
/// 会话页面--服务单(不要对接)
///
///
[HttpGet]
[AllowAnonymous]
public ChatServiceRemind ChatServiceRemind()
{
ChatServiceRemind result = new ChatServiceRemind();
return result;
}
#endregion
#region ChatRechargeRemind(会话页面--充值单)
///
/// 会话页面--充值单(不要对接)
///
///
[HttpGet]
[AllowAnonymous]
public ChatRechargeRemind ChatRechargeRemind()
{
ChatRechargeRemind result = new ChatRechargeRemind();
return result;
}
#endregion
#region ChatServiceRemind(素材库)
///
/// 素材库(不要对接)
///
///
[HttpGet]
[AllowAnonymous]
public MaterialsStore MaterialsStore()
{
MaterialsStore result = new MaterialsStore();
return result;
}
#endregion
#region ConsumptionReminder(消费提醒消息)
///
/// 消费提醒消息(不要对接)
///
///
[HttpGet]
[AllowAnonymous]
public void ConsumptionReminder(string id)
{
_webSocketService.ConsumptionReminder(id);
}
#endregion
#region GetHomeMessgeAmountList(获取首页会员与统计列表)
///
/// 获取首页会员与统计列表
///
/// 店铺主键
[HttpGet]
public List GetHomeMessgeAmountList(Guid shopId)
{
return _webSocketService.GetHomeMessgeList(shopId,this.CurrentLogin);
}
#endregion
#region GetChatMessagePageList(获取历史消息分页列表)
///
/// 获取历史消息分页列表
///
/// 分页参数
[HttpPost]
public PageResult> GetMessagePageList(PagedSearch search)
{
return _webSocketService.GetMessagePageList(search, this.CurrentLogin);
}
#endregion
#region SendChatMemberJoin(会话页面--获取会员画像)
///
/// 会话页面--获取会员画像
///
///
[HttpGet]
public WebSocketMessgeResp SendChatMemberJoin(Guid id,Guid shopId)
{
return _chatService.SendMemberJoinRemind(id, shopId, 0, this.CurrentLogin.UserId);//仅发送给当前操作人查看
}
#endregion
#region SendMaterialsStore(素材库)
///
/// 素材库(不要对接,一期代码所用接口)
///
///
[HttpGet]
[AllowAnonymous]
public void SendMaterialsStore(string id)
{
_chatService.SendMaterialsStore(id);
}
#endregion
#region WebSocketKpiMessage(业绩通知接口--不要对接)
///
/// 业绩通知接口--不要对接
///
///
///
[HttpGet]
[AllowAnonymous]
public WebSocketMessgeResp WebSocketKpiMessage(MessgeRequst requst)
{
WebSocketMessgeResp webSocketMessgeResp = new WebSocketMessgeResp();
return webSocketMessgeResp;
}
#endregion
#region SendMemberJoinStore(脸部识别--会员进店)
///
/// 脸部识别--会员进店
///
///
[HttpGet]
[AllowAnonymous]
public ChatMemberInShopMesg SendMemberJoinStore()
{
ChatMemberInShopMesg result = new ChatMemberInShopMesg();
return result;
}
#endregion
#region SendMessageByFace(后端测试用,请勿对接)
///
/// 后端测试用,请勿对接
///
///
[HttpGet]
[AllowAnonymous]
public void SendMessageByFace(DateTime time)
{
_webSocketService.SendMessageByFace(time);
}
#endregion
#region SendMessageByFace(后端测试用,请勿对接)
/////
///// 后端测试用,请勿对接--新注册会员发送已成为会员通知
/////
//[HttpGet]
//[AllowAnonymous]
//public void SendMessageByNewRegistered()
//{
// string faceId = "f-vtn1608025655884";
// string faceImgUrl = "https://ylcloud.oss-cn-shenzhen.aliyuncs.com/upload/faceImg/2020/12/15/jfU1PXAO4H1G0000110.jpg";
// Guid memberId = Guid.Parse("43CEB536-CED3-48E8-A244-21D699E282E2");
// Guid shopId= Guid.Parse("B00922B3-A492-9C7C-E88D-39F0DA1FA384");
// _webSocketService.SendMessageByNewRegistered(shopId, memberId,faceId, faceImgUrl);
//}
#endregion
#region GetFaceInfoAmount 后端测试用,请勿对接
///
/// 后端测试用,请勿对接
///
/// 店铺主键 加盟商需传
[HttpGet]
public int GetFaceInfoAmount(Guid? shopId)
{
if (!shopId.HasValue)
shopId = this.CurrentLogin.ShopId;
return _webSocketService.GetFaceInfoAmount(shopId);
}
#endregion
#region SetWorker(标记为工作人员)
///
/// 标记为工作人员
///
/// 店铺主键
/// 人脸识别id
[HttpGet]
public void SetWorker(Guid shopId,string faceId)
{
_webSocketService.SetWorker(shopId, faceId);
}
#endregion
#region GetFaceInfoList 店铺人脸识别图片集合
///
/// 店铺人脸识别图片集合
///
/// 店铺主键 加盟商需传
[HttpGet]
public List GetFaceInfoList(Guid? shopId)
{
if (!shopId.HasValue)
shopId = this.CurrentLogin.ShopId;
return _webSocketService.GetFaceInfoList(shopId);
}
#endregion
#region SetMemberBindFaceId 会员绑定脸部识别id
///
/// 会员绑定脸部识别id
///
/// 会员主键
/// 人脸识别id
/// 人脸识别图片url
[HttpGet]
public void SetMemberBindFaceId(Guid memberId, string faceId,string faceImgUrl)
{
_webSocketService.SetMemberBindFaceId(memberId, faceId,faceImgUrl);
}
#endregion
#region SetMemberUnBindFaceId 会员解绑人脸识别id
///
/// 会员解绑人脸识别id
///
/// 会员主键
[HttpGet]
public void SetMemberUnBindFaceId(Guid memberId)
{
_webSocketService.SetMemberUnBindFaceId(memberId);
}
#endregion
#region GetMemberBindInfo 获取会员的人脸识别信息
///
/// 获取会员的人脸识别信息
///
/// 会员主键
[HttpGet]
public FaceInfoResp GetMemberBindInfo(Guid memberId)
{
return _webSocketService.GetMemberBindInfo(memberId);
}
#endregion
}
}