156 lines
4.9 KiB
C#
156 lines
4.9 KiB
C#
using MyCode.Project.Domain.Message.Request.CouponActivity;
|
|
using MyCode.Project.Domain.Message.Response.Activity;
|
|
using MyCode.Project.Domain.Message.Response.CouponActivity;
|
|
using MyCode.Project.Infrastructure.Exceptions;
|
|
using MyCode.Project.Services;
|
|
using System;
|
|
using System.Web.Http;
|
|
|
|
namespace MyCode.Project.WebApi.Areas.Wechat.Controllers
|
|
{
|
|
/// <summary>
|
|
///优惠券活动 相关
|
|
/// </summary>
|
|
public class CouponActivityController : BaseWechatController
|
|
{
|
|
private ICouponActivityService _couponActivityService;
|
|
|
|
|
|
/// <summary>
|
|
/// 初始化一个<see cref="ActivityController"/>类型的实例
|
|
/// </summary>
|
|
public CouponActivityController(ICouponActivityService couponActivityService
|
|
)
|
|
{
|
|
_couponActivityService = couponActivityService;
|
|
|
|
}
|
|
|
|
#region 加盟商、店长或店员获取店铺活动列表
|
|
/// <summary>
|
|
/// 加盟商、店长或店员获取店铺活动列表
|
|
/// </summary>
|
|
/// <param name="ShopID">店铺ID</param>
|
|
[HttpGet]
|
|
public CouponActivityResp GetActivityList(Guid ShopID)
|
|
{
|
|
return _couponActivityService.GetCouponActivityList(ShopID, this.CurrentLogin);
|
|
}
|
|
#endregion
|
|
|
|
#region 门店获取优惠券活动详情
|
|
/// <summary>
|
|
/// 门店获取优惠券活动详情
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public CouponActivityDetail GetDetailForShop(GetCouponActivityDetail req)
|
|
{
|
|
|
|
return _couponActivityService.GetDetailForShop(req);
|
|
}
|
|
#endregion
|
|
|
|
#region GetGoodsString(获取优惠券的商品范围规则文本)
|
|
/// <summary>
|
|
/// 获取优惠券的商品范围规则文本
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public string GetGoodsString(Guid id)
|
|
{
|
|
|
|
return _couponActivityService.GetGoodsString(id);
|
|
}
|
|
#endregion
|
|
|
|
#region JoinCouponActivity(门店点击参加优惠券活动)
|
|
/// <summary>
|
|
/// 门店点击参加优惠券活动
|
|
/// </summary>
|
|
/// <param name="act"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public void JoinCouponActivity(CouponActivityJoinAct act)
|
|
{
|
|
|
|
_couponActivityService.JoinCouponActivity(act,this.CurrentLogin);
|
|
}
|
|
#endregion
|
|
|
|
#region GetCustomerSharePic(门店端获取拼接海报的多个图片)
|
|
/// <summary>
|
|
/// 门店端获取拼接海报的多个图片
|
|
/// </summary>
|
|
/// <param name="shopActivityId"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public CustomerSharePicResp GetCustomerSharePic(Guid shopActivityId)
|
|
{
|
|
return _couponActivityService.GetCustomerSharePicNew(shopActivityId, CurrentLogin, true);
|
|
}
|
|
#endregion
|
|
|
|
|
|
#region GetMiniCodeUrl(获取1280小程序码)
|
|
/// <summary>
|
|
/// 获取1280小程序码
|
|
/// </summary>
|
|
/// <param name="shopActivityId"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public string Get1280MiniCodeUrl(Guid shopActivityId)
|
|
{
|
|
return _couponActivityService.Get1280MiniCodeUrl(shopActivityId, CurrentLogin, true);
|
|
}
|
|
#endregion
|
|
|
|
#region Finish(加盟商手动结束活动)
|
|
/// <summary>
|
|
/// 加盟商手动结束活动
|
|
/// </summary>
|
|
/// <param name="act"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public void Finish(CouponActivityJoinAct act)
|
|
{
|
|
|
|
_couponActivityService.Finish(act, this.CurrentLogin);
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
#region GetCouponActivityReport 某门店某个优惠券活动的统计
|
|
/// <summary>
|
|
/// 某门店某个优惠券活动的统计
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public CouponActivityReport GetCouponActivityReport(GetCouponActivityDetail req)
|
|
{
|
|
|
|
return _couponActivityService.GetCouponActivityReport(req, this.CurrentLogin);
|
|
}
|
|
#endregion
|
|
|
|
|
|
//#region GetCustomerSharePic(门店端获取拼接海报的多个图片)
|
|
///// <summary>
|
|
///// 门店端获取拼接海报的多个图片
|
|
///// </summary>
|
|
///// <param name="shopActivityId"></param>
|
|
///// <returns></returns>
|
|
//[HttpGet]
|
|
//public CustomerSharePicResp GetCustomerSharePicTest(Guid shopActivityId)
|
|
//{
|
|
// return _couponActivityService.GetCustomerSharePicNew(shopActivityId, CurrentLogin, true);
|
|
//}
|
|
//#endregion
|
|
}
|
|
}
|
|
|