DsiableChargeAuthProcedure.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using AwInitilizer.Assist;
  2. using InitializerModel;
  3. using Newtonsoft.Json;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Collections.Specialized;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Net;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. namespace AwInitilizer.Procedure.FactoryAssist
  13. {
  14. public class DsiableChargeAuthProcedure : ProcedureBase
  15. {
  16. public enum ErrorType
  17. {
  18. None,
  19. }
  20. public enum LogEvent
  21. {
  22. }
  23. public ErrorType Error { get; set; } = ErrorType.None;
  24. private ProcedureLog.LogWriter<DsiableChargeAuthProcedure, LogEvent> LogWriter;
  25. public DsiableChargeAuthProcedure() : base()
  26. {
  27. Name = "Disable Charging Auth";
  28. Content = "Disable Charging auth for factory test";
  29. LogWriter = new ProcedureLog.LogWriter<DsiableChargeAuthProcedure, LogEvent>(this);
  30. }
  31. internal override async Task<bool> Run()
  32. {
  33. if (!AppSettingConfig.Instance.IsDisableAuthRequired)
  34. {
  35. return false;
  36. }
  37. var result = await EvApi.SetAuthorisationMode(isAuthRequired: false);
  38. LogWriter.Log(result.Response);
  39. return result.Result;
  40. }
  41. }
  42. }