29 lines
889 B
C#
29 lines
889 B
C#
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);
|
|
}
|
|
|
|
}
|
|
}
|