zhengyiming
2025-06-09 d30353e38d24c06d93ce28bd15b36c24f41cfd0c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
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
    }
}