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;
|
|
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 查询
|
|
/// <summary>
|
/// 获取推广员列表
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public async Task<PageOutput<PromoterDto>> GetPromoters(GetPromotersInput input)
|
{
|
return await promoterService.GetPromoters(input);
|
}
|
|
/// <summary>
|
/// 获取渠道咨询列表
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
public async Task<PageOutput<ChannelConsultationDto>> GetChannelConsultation(GetChannelConsultationsInput input)
|
{
|
return await promoterService.GetChannelConsultation(input);
|
}
|
|
/// <summary>
|
/// 获取渠道咨询回访记录
|
/// </summary>
|
/// <param name="id">渠道咨询Id</param>
|
/// <returns></returns>
|
[HttpGet]
|
public async Task<List<ChannelConsultationFollowupDto>> GetChannelConsultationFollowupList(Guid id)
|
{
|
return await promoterService.GetChannelConsultationFollowupList(id);
|
}
|
|
#endregion
|
|
#region 写入
|
|
/// <summary>
|
/// 创建或更新推广员
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
/// <exception cref="FormatException"></exception>
|
[HttpPost]
|
[AllowAnonymous]
|
public async Task<Guid> CreateOrUpdatePromoter(CreateOrUpdatePromoterInput input)
|
{
|
return await promoterService.CreateOrUpdatePromoter(input);
|
}
|
|
/// <summary>
|
/// 点击数+1
|
/// </summary>
|
/// <param name="idnumber"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[AllowAnonymous]
|
public async Task SetClickCount(string idnumber)
|
{
|
await promoterService.SetClickCount(idnumber);
|
}
|
|
/// <summary>
|
/// 申请渠道咨询
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[UnitOfWork]
|
[AllowAnonymous]
|
public async Task<Guid> CreateChannelConsultation(CreateChannelConsultationInput input)
|
{
|
return await promoterService.CreateChannelConsultation(input);
|
}
|
|
/// <summary>
|
/// 新增回访
|
/// </summary>
|
/// <param name="input"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[UnitOfWork]
|
public async Task<Guid> CreateChannelConsultationFollowup(CreateChannelConsultationFollowupInput input)
|
{
|
return await promoterService.CreateChannelConsultationFollowup(input);
|
}
|
|
#endregion
|
}
|
}
|