DsiableChargeAuthProcedure.cs 1.2 KB

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