using AutoMapper;
using LifePayment.Application.Contracts;
using LifePayment.Domain.LifePay;
using LifePayment.Domain.Shared;
using LifePayment.Domain;
using System.Collections.Generic;
using System.Threading.Tasks;
using System;
using Volo.Abp.AutoMapper;
using Volo.Abp.Users;
using ZeroD.Util;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using ZeroD.Util.Fadd;
using Volo.Abp.Uow;
using Nest;
using Volo.Abp;
namespace LifePayment.HttpApi
{
[Route("api/[controller]/[action]")]
[ApiController]
[Authorize]
public class PromoterController : AbpController
{
private readonly IPromoterService promoterService;
public PromoterController(IPromoterService promoterService)
{
this.promoterService = promoterService;
}
#region 查询
///
/// 获取推广员列表
///
///
///
[HttpPost]
public async Task> GetPromoters(GetPromotersInput input)
{
return await promoterService.GetPromoters(input);
}
///
/// 获取推广员信息
///
///
///
[HttpGet]
[AllowAnonymous]
public async Task GetPromoter(string phoneNumber)
{
return await promoterService.GetPromoter(phoneNumber);
}
///
/// 获取渠道咨询列表
///
///
///
[HttpPost]
public async Task> GetChannelConsultation(GetChannelConsultationsInput input)
{
return await promoterService.GetChannelConsultation(input);
}
///
/// 获取渠道咨询回访记录
///
/// 渠道咨询Id
///
[HttpGet]
public async Task> GetChannelConsultationFollowupList(Guid id)
{
return await promoterService.GetChannelConsultationFollowupList(id);
}
///
/// 获取渠道咨询Id
///
///
///
///
[HttpGet]
[AllowAnonymous]
public async Task GetChannelConsultationById(Guid id)
{
return await promoterService.GetChannelConsultationById(id);
}
#endregion
#region 写入
///
/// 创建或更新推广员
///
///
///
///
[HttpPost]
[AllowAnonymous]
public async Task CreateOrUpdatePromoter(CreateOrUpdatePromoterInput input)
{
return await promoterService.CreateOrUpdatePromoter(input);
}
///
/// 点击数+1
///
///
///
[HttpPost]
[AllowAnonymous]
public async Task SetClickCount(string idnumber)
{
await promoterService.SetClickCount(idnumber);
}
///
/// 申请渠道咨询
///
///
///
[HttpPost]
[UnitOfWork]
[AllowAnonymous]
public async Task CreateChannelConsultation(CreateChannelConsultationInput input)
{
return await promoterService.CreateChannelConsultation(input);
}
///
/// 新增回访
///
///
///
[HttpPost]
[UnitOfWork]
public async Task CreateChannelConsultationFollowup(CreateChannelConsultationFollowupInput input)
{
return await promoterService.CreateChannelConsultationFollowup(input);
}
#endregion
}
}