WX
2023-12-09 94d1c6424f3a2f14f45db9298f4744c2c41db575
问财接口对接
1个文件已修改
1个文件已添加
36 ■■■■■ 已修改文件
GasolineBlend/Controllers/WenCaiController.cs 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/GasolineBlend.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/WenCaiController.cs
New file
@@ -0,0 +1,35 @@
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web.Mvc;
using CommonHelper.Redis;
using Flurl.Http;
namespace GasolineBlend.Controllers
{
    /// <summary>
    /// 问财
    /// </summary>
    public class WenCaiController : BaseController
    {
        private readonly CustomerRedis _customerRedis = new CustomerRedis();
        [HttpPost]
        public async Task<ActionResult> GetWenCaiAnswerList(string question, int pageSize, int pageNo)
        {
            var v = _customerRedis.Get("wencai_v");
            var url = "https://www.iwencai.com/unifiedwap/unified-wap/v2/result/get-robot-data";
            var param = new
            {
                question=question,
                perpage=pageSize,
                page=pageNo,
                source= "ths_mobile_iwencai",
                add_info="{\"urp\":{\"scene\":3,\"company\":1,\"business\":1,\"is_lowcode\":1},\"contentType\":\"json\"}"
            };
            var res = await url.WithHeader("hexin-v", v).PostUrlEncodedAsync(param).ReceiveString();
            string strCov = Regex.Unescape(res);
            return SuccessNoShow(data: strCov);
        }
    }
}
GasolineBlend/GasolineBlend.csproj
@@ -391,6 +391,7 @@
    <Compile Include="Controllers\WaterfallInnerController.cs" />
    <Compile Include="Controllers\WaterfallTableController.cs" />
    <Compile Include="Controllers\WeChatController.cs" />
    <Compile Include="Controllers\WenCaiController.cs" />
    <Compile Include="Filter\LoginCheckedAttribute.cs" />
    <Compile Include="Global.asax.cs">
      <DependentUpon>Global.asax</DependentUpon>