229 lines
7.6 KiB
C#
229 lines
7.6 KiB
C#
|
using MyCode.Project.Domain.Message.Act.User;
|
|||
|
using MyCode.Project.Domain.Message.Request.Member;
|
|||
|
using MyCode.Project.Domain.Message.Request.Shop;
|
|||
|
using MyCode.Project.Domain.Message.Request.User;
|
|||
|
using MyCode.Project.Domain.Message.Response.Activity;
|
|||
|
using MyCode.Project.Domain.Message.Response.Shop;
|
|||
|
using MyCode.Project.Domain.Message.Response.User;
|
|||
|
using MyCode.Project.Domain.Message.Response.Wechat;
|
|||
|
using MyCode.Project.Infrastructure.Common;
|
|||
|
using MyCode.Project.Services;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Web.Http;
|
|||
|
|
|||
|
namespace MyCode.Project.WebApi.Areas.Member.Controllers
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 会员用户登录相关
|
|||
|
/// </summary>
|
|||
|
public class UserController : BaseMemberController
|
|||
|
{
|
|||
|
|
|||
|
private IMemberMiniService _memberMiniService;
|
|||
|
private IClerkService _clerkService;
|
|||
|
|
|||
|
public UserController(IMemberMiniService memberMiniService
|
|||
|
, IClerkService clerkService)
|
|||
|
{
|
|||
|
_memberMiniService = memberMiniService;
|
|||
|
_clerkService = clerkService;
|
|||
|
}
|
|||
|
|
|||
|
//#region Registered(注册会员)
|
|||
|
///// <summary>
|
|||
|
///// 注册会员 返回值:是否需要去绑定门店和营销顾问 0 不需要 1 需要
|
|||
|
///// </summary>
|
|||
|
///// <param name="request"></param>
|
|||
|
///// <returns></returns>
|
|||
|
//[HttpPost]
|
|||
|
//[AllowAnonymous]
|
|||
|
//public int Registered(MemberGetTokenRequest request)
|
|||
|
//{
|
|||
|
// return _memberMiniService.Registered(request);
|
|||
|
//}
|
|||
|
//#endregion
|
|||
|
|
|||
|
//#region MemberGetToken(根据小程序的code获得用户的token等信息,如果获取不到,则调到注册页面)
|
|||
|
///// <summary>
|
|||
|
///// 根据小程序的code获得用户的token等信息,如果获取不到,则调到注册页面
|
|||
|
///// </summary>
|
|||
|
///// <param name="request"></param>
|
|||
|
///// <returns></returns>
|
|||
|
//[HttpPost]
|
|||
|
//[AllowAnonymous]
|
|||
|
//public GetMemberTokenResp MemberGetToken(FirstGetTokenRequest request)
|
|||
|
//{
|
|||
|
// return _memberMiniService.MemberGetToken(request);
|
|||
|
//}
|
|||
|
//#endregion
|
|||
|
|
|||
|
#region GetActivityId(会员根据店员小程序活动码参数获取店铺活动主键ID和活动类型)
|
|||
|
/// <summary>
|
|||
|
/// 会员根据店员小程序活动码参数获取店铺活动主键ID和活动类型
|
|||
|
/// </summary>
|
|||
|
/// <param name="scene"></param>
|
|||
|
[HttpGet]
|
|||
|
[AllowAnonymous]
|
|||
|
public ActivityByCodeResp GetActivityId(string scene)
|
|||
|
{
|
|||
|
return _memberMiniService.GetActivityId(scene);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region DecodeEncryptedData(获取小程序解密信息)
|
|||
|
/// <summary>
|
|||
|
/// 获取小程序解密信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="request"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
[AllowAnonymous]
|
|||
|
public string DecodeEncryptedData(GetWxPhoneRequest request)
|
|||
|
{
|
|||
|
return _memberMiniService.DecodeEncryptedData(request.JsCode, request.EncryptedData, request.Iv);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region GetClerkList 获取店员列表
|
|||
|
/// <summary>
|
|||
|
/// 获取店员列表
|
|||
|
/// </summary>
|
|||
|
/// <param name="ShopID">详细档案接口返回的店铺主键ShopID</param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpGet]
|
|||
|
[AllowAnonymous]
|
|||
|
public List<ClerkListResp> GetClerkList(Guid? ShopID)
|
|||
|
{
|
|||
|
if (!ShopID.HasValue)
|
|||
|
return new List<ClerkListResp>();
|
|||
|
return _clerkService.GetClerkList(ShopID.Value);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region GetAllShopList 获取所有的店铺列表
|
|||
|
/// <summary>
|
|||
|
/// 获取所有的店铺列表
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpGet]
|
|||
|
[AllowAnonymous]
|
|||
|
public List<ClerkListResp> GetAllShopList()
|
|||
|
{
|
|||
|
return _clerkService.GetAllShopList();
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region GetShopPageList(关键字查询店铺分页列表,根据距离排序)
|
|||
|
/// <summary>
|
|||
|
/// 关键字查询店铺分页列表,根据距离排序
|
|||
|
/// </summary>
|
|||
|
/// <param name="request"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
[AllowAnonymous]
|
|||
|
public PageResult<ShopCustomerListResp> GetShopPageList(PagedSearch<KeyWordsQuest> request)
|
|||
|
{
|
|||
|
return _memberMiniService.GetShopPageList(request);
|
|||
|
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region IfNeedSetBirthday(会员端首页是否弹出填写生日的框 1 弹 0 不弹)
|
|||
|
/// <summary>
|
|||
|
/// 会员端首页是否弹出填写生日的框 1 弹 0 不弹
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpGet]
|
|||
|
public int IfNeedSetBirthday()
|
|||
|
{
|
|||
|
return _memberMiniService.IfNeedSetBirthday(this.CurrentLogin);
|
|||
|
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region SetBirthday(会员端填写生日姓名)
|
|||
|
/// <summary>
|
|||
|
/// 会员端填写生日姓名
|
|||
|
/// </summary>
|
|||
|
/// <param name="act"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public void SetBirthday(SetMemberNameAct act)
|
|||
|
{
|
|||
|
_memberMiniService.SetBirthday(act,this.CurrentLogin);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region NewRegistered(新版本注册会员)
|
|||
|
/// <summary>
|
|||
|
/// 新版本注册会员 返回值:是否需要去绑定门店和营销顾问 0 不需要 1 需要
|
|||
|
/// </summary>
|
|||
|
/// <param name="request"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
[AllowAnonymous]
|
|||
|
public int NewRegistered(MemberGetTokenRequest request)
|
|||
|
{
|
|||
|
return _memberMiniService.NewRegistered(request);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region NewSetMemberConsultant(新版会员设置营销顾问)
|
|||
|
/// <summary>
|
|||
|
/// 新版会员设置营销顾问
|
|||
|
/// </summary>
|
|||
|
/// <param name="act"></param>
|
|||
|
[HttpPost]
|
|||
|
[AllowAnonymous]
|
|||
|
public void NewSetMemberConsultant(MemberGetTokenRequest act)
|
|||
|
{
|
|||
|
_memberMiniService.NewRegistered(act);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region NewMemberGetToken(新版根据小程序的code获得用户的token等信息,如果获取不到,则调到注册页面)
|
|||
|
/// <summary>
|
|||
|
/// 新版根据小程序的code获得用户的token等信息,如果获取不到,则调到注册页面
|
|||
|
/// </summary>
|
|||
|
/// <param name="request"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
[AllowAnonymous]
|
|||
|
public GetMemberTokenResp NewMemberGetToken(FirstGetTokenRequest request)
|
|||
|
{
|
|||
|
return _memberMiniService.NewMemberGetToken(request);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
#region AddMemberConsultant(老会员主动添加店铺营销顾问关系)
|
|||
|
/// <summary>
|
|||
|
/// 老会员主动添加店铺营销顾问关系
|
|||
|
/// </summary>
|
|||
|
/// <param name="request"></param>
|
|||
|
[HttpPost]
|
|||
|
public void AddMemberConsultant(AddMemberConsultant request)
|
|||
|
{
|
|||
|
_memberMiniService.AddMemberConsultant(request,this.CurrentLogin);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
//#region Testasds(测试获取注册事件的数据)
|
|||
|
///// <summary>
|
|||
|
///// 测试获取注册事件的数据
|
|||
|
///// </summary>
|
|||
|
///// <param name="shopId"></param>
|
|||
|
///// <returns></returns>
|
|||
|
//[HttpGet]
|
|||
|
//[AllowAnonymous]
|
|||
|
//public object Testasds(Guid shopId)
|
|||
|
//{
|
|||
|
// return _memberMiniService.Testasds(shopId);
|
|||
|
//}
|
|||
|
//#endregion
|
|||
|
|
|||
|
}
|
|||
|
}
|