12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using EVCB_OCPP.Packet.Messages.SubTypes;
- namespace EVCB_OCPP.WSServer.BusinessService
- {
- public class FakeLocalBusinessService : IBusinessService
- {
- Dictionary<string, IdTagInfo> localAuthDic = new Dictionary<string, IdTagInfo>()
- {
- { "AC5CDC3D", new IdTagInfo(){ status= AuthorizationStatus.Invalid} },
- { "48C4CBD9257A", new IdTagInfo(){ status= AuthorizationStatus.Invalid} },
- { "3DDC5CAC", new IdTagInfo(){ status= AuthorizationStatus.Invalid} },
- { "3EFBDEAC", new IdTagInfo(){ status= AuthorizationStatus.Invalid} },
- };
- string customerId = string.Empty;
- public FakeLocalBusinessService(string customerId)
- {
- this.customerId = customerId;
- }
- public IdTagInfo Authorize(string idTag)
- {
- IdTagInfo result = new IdTagInfo() { status = AuthorizationStatus.Accepted };
- if (localAuthDic.ContainsKey(idTag))
- {
- result = localAuthDic[idTag];
- }
- return result;
- }
- }
- }
|