using Microsoft.AspNetCore.Mvc;
using Ropin.Inspection.Service;
using System.Net.Http;
using Ropin.Inspection.Common.Helper;
using Microsoft.AspNetCore.Authorization;
using Ropin.Inspection.Api.Common;
using System.Threading.Tasks;
using Ropin.Inspection.Model;
using System.Collections.Generic;
using System;
using Newtonsoft.Json;
using Microsoft.Extensions.Configuration;
using Ropin.Inspection.Service.VMC.Interface;
using Newtonsoft.Json.Linq;
using System.IO;
namespace Ropin.Inspection.Api.Controllers.Base
{
public class AIController : BaseController
{
private readonly IHttpClientFactory _httpClientFactory;
private readonly AIProjectHelper aIHelper;
private readonly ITsysMessageService _TsysMessageService;
private readonly IPushMsgService _pushMsgService;
private readonly IVmcCameraService _vmcCameraService;
private string IsUpdateAI = "false";
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(AIController));
public AIController(IHttpClientFactory httpClientFactory, ITsysMessageService tsysMessageService, IPushMsgService pushMsgService, IConfiguration configuration, IVmcCameraService vmcCameraService)
{
aIHelper = new AIProjectHelper(httpClientFactory);
_TsysMessageService = tsysMessageService;
_pushMsgService = pushMsgService;
string IsUpdate = configuration.GetSection("AIIsUpdate")?.Value;
IsUpdateAI = !string.IsNullOrEmpty(IsUpdate) ? IsUpdate : "false";
_vmcCameraService = vmcCameraService;
}
///
/// AI会话
///
///
[HttpPost("AiConversation")]
[AllowAnonymous]
public async Task