| New file |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |