修改
This commit is contained in:
28
ConsoleApp2/SimulationService/DataHelper.cs
Normal file
28
ConsoleApp2/SimulationService/DataHelper.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ConsoleApp2.SimulationService
|
||||
{
|
||||
public static partial class DataHelper
|
||||
{
|
||||
public static short[] shareKeys = {23000, 23040, 23070, 23100, 24000, 24040, 24070, 24100, 25000, 25040, 25070, 25100 };
|
||||
public static int[] companyIds = { 1, 2, 3, 4 };
|
||||
private static T getArrayValue<T>(int index, T[] array)//按index取数据,超过数组长度,index从0开始再取
|
||||
{
|
||||
return array[index % array.Length];
|
||||
}
|
||||
public static short GetShareKey(int index)
|
||||
{
|
||||
return getArrayValue(index, shareKeys);
|
||||
}
|
||||
public static int GetCompanyId(int index)
|
||||
{
|
||||
return getArrayValue(index, companyIds);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user