public SearchNewDevicesResponse SearchNewDevices(SearchNewDevicesRequest request) { return(PersistenceOperation.Process(request, () => { var op = new DeviceOp(); var newDeviceIds = op.SearchNewDevices(); return new SearchNewDevicesResponse() { ResultType = ResultTypes.Ok, NewDeviceCodes = newDeviceIds }; })); }
public SyncDevicesResponse SyncDevices(SyncDevicesRequest request) { return(PersistenceOperation.Process(request, () => { var newDeviceControllers = new List <DeviceController>(); var op = new DeviceOp(); var newDeviceIds = op.SearchNewDevices(); newDeviceIds.ForEach(x => { Log.InfoFormat("sync device id={0} to system", x); newDeviceControllers.Add(op.SyncDeviceToSystem(x)); Log.Info("sync device to system successfully"); }); return new SyncDevicesResponse() { ResultType = ResultTypes.Ok, NewDeviceControllers = newDeviceControllers }; })); }