171 lines
5.4 KiB
C#
171 lines
5.4 KiB
C#
using MyCode.Project.Domain.Message.Request.Activity;
|
||
using MyCode.Project.Domain.Message.Response.Activity;
|
||
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 ActivityController : BaseMemberController
|
||
{
|
||
private IActivityService _activityService;
|
||
|
||
/// <summary>
|
||
/// 初始化一个<see cref="ActivityController"/>类型的实例
|
||
/// </summary>
|
||
/// <param name="activityService"></param>
|
||
public ActivityController(IActivityService activityService)
|
||
{
|
||
_activityService = activityService;
|
||
}
|
||
|
||
#region 首页轮播图
|
||
/// <summary>
|
||
/// 首页轮播图
|
||
/// </summary>
|
||
/// <param name="shopID">有登录,需传店铺ID</param>
|
||
/// <returns></returns>
|
||
[HttpGet]
|
||
[AllowAnonymous]
|
||
public List<HomePageResp> GetHomePageList(Guid? shopID)
|
||
{
|
||
return _activityService.GetHomePageList(shopID,0);
|
||
}
|
||
#endregion
|
||
|
||
#region 店铺参与的活动列表
|
||
/// <summary>
|
||
/// 店铺参与的活动列表
|
||
/// </summary>
|
||
/// <param name="shopID">店铺ID</param>
|
||
/// <returns></returns>
|
||
[HttpGet]
|
||
[AllowAnonymous]
|
||
public List<ShopActivityResp> ShopActivityList(Guid shopID)
|
||
{
|
||
return _activityService.ShopActivityList(shopID);
|
||
}
|
||
#endregion
|
||
|
||
#region 不需要登录-所有的活动列表
|
||
/// <summary>
|
||
/// 不需要登录-所有的活动列表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpGet]
|
||
[AllowAnonymous]
|
||
public List<ShopActivityResp> ActivityList()
|
||
{
|
||
return _activityService.ActivityList();
|
||
}
|
||
#endregion
|
||
|
||
#region 活动详情页面
|
||
/// <summary>
|
||
/// 活动详情页面
|
||
/// </summary>
|
||
/// <param name="request"></param>
|
||
[HttpPost]
|
||
[AllowAnonymous]
|
||
public ActivityDatail ActivityDetail(FitShopReq request)
|
||
{
|
||
return _activityService.ActivityDetail(request,this.CurrentLogin.UserId);
|
||
}
|
||
#endregion
|
||
|
||
#region 参与活动列表
|
||
/// <summary>
|
||
/// 参与活动列表
|
||
/// </summary>
|
||
/// <param name="shopId">个人中切换的店铺ID</param>
|
||
/// <returns></returns>
|
||
[HttpGet]
|
||
public List<MemberActivityResp> JoinActivityList(Guid shopId)
|
||
{
|
||
return _activityService.JoinActivityList(shopId,this.CurrentLogin);
|
||
}
|
||
#endregion
|
||
|
||
#region 通用活动-马上领取
|
||
/// <summary>
|
||
/// 通用活动-马上领取
|
||
/// </summary>
|
||
/// <param name="LogID">店铺活动记录主键ID</param>
|
||
/// <param name="Scene">小程序进入的参数,小程序码产生传参为scene</param>
|
||
[HttpGet]
|
||
public void JoinActivity(Guid LogID, string Scene)
|
||
{
|
||
_activityService.JoinActivity(LogID, Scene, this.CurrentLogin);
|
||
}
|
||
#endregion
|
||
|
||
#region 报名活动-获取报名字段信息
|
||
/// <summary>
|
||
/// 报名活动-获取报名字段信息
|
||
/// </summary>
|
||
/// <param name="LogID">店铺活动记录主键ID</param>
|
||
[HttpGet]
|
||
public ApplyInfoResp GetApplyActivity(Guid LogID)
|
||
{
|
||
return _activityService.GetApplyActivity(LogID);
|
||
}
|
||
#endregion
|
||
|
||
#region 报名活动-提交报名信息
|
||
/// <summary>
|
||
/// 报名活动-提交报名信息
|
||
/// </summary>
|
||
[HttpPost]
|
||
public void SaveApply(ApplyRequst act)
|
||
{
|
||
_activityService.SaveApply(act,this.CurrentLogin);
|
||
}
|
||
#endregion
|
||
|
||
#region GetShareCode(会员分享活动小程序的链接地址)
|
||
/// <summary>
|
||
/// 会员分享活动小程序的链接地址
|
||
/// </summary>
|
||
/// <param name="shopActivityId">店铺活动的主键</param>
|
||
/// <returns></returns>
|
||
[HttpGet]
|
||
[AllowAnonymous]
|
||
public string GetShareCode(Guid shopActivityId)
|
||
{
|
||
return _activityService.GetMemberShareCode(shopActivityId,CurrentLogin);
|
||
}
|
||
#endregion
|
||
|
||
#region GetMemberProfitTotal 活动数据-获取会员的获利来源
|
||
/// <summary>
|
||
/// 活动数据-获取会员的获利来源
|
||
/// </summary>
|
||
/// <param name="request"></param>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
public MemberProfitReq GetMemberProfitTotal(PagedSearch<UserProfitResp> request)
|
||
{
|
||
return _activityService.GetMemberProfitTotal(request,this.CurrentLogin);
|
||
}
|
||
#endregion
|
||
|
||
#region GetMemberProfitDetail 活动数据-获取会员的获利明细
|
||
/// <summary>
|
||
/// 活动数据-获取会员的获利明细
|
||
/// </summary>
|
||
/// <param name="request"></param>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
public PageResult<UserProfitDetailReq> GetMemberProfitDetail(PagedSearch<UserProfitResp> request)
|
||
{
|
||
return _activityService.GetUserProfitDetail(request, this.CurrentLogin);
|
||
}
|
||
#endregion
|
||
}
|
||
}
|