广州市慧合临时修改
This commit is contained in:
@@ -1876,7 +1876,24 @@ public class DataUtil {
|
||||
}
|
||||
|
||||
|
||||
public static int generateRandomNumber(String address) {
|
||||
// 使用地址的哈希值作为随机种子
|
||||
long seed = address.hashCode();
|
||||
Random random = new Random(seed);
|
||||
|
||||
// 生成一个初始随机数来决定范围
|
||||
int initialRandom = random.nextInt();
|
||||
|
||||
int result;
|
||||
if (initialRandom > 0) {
|
||||
// 生成2到10之间的随机数(包含2和10)
|
||||
result = random.nextInt(9) + 2; // nextInt(9) 生成 0-8,+2 后得到 2-10
|
||||
} else {
|
||||
// 生成-5到-2之间的随机数(包含-5和-2)
|
||||
result = random.nextInt(4) - 5; // nextInt(4) 生成 0-3,-5 后得到 -5到-2
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -318,7 +318,8 @@ public class GeoUtils {
|
||||
|
||||
private static String getGaodeKey(String endpoint) {
|
||||
// 实现获取高德 API key 的逻辑
|
||||
return "8796b9dfb3889b57c38e2fff1b7e51bd";
|
||||
// return "8796b9dfb3889b57c38e2fff1b7e51bd";
|
||||
return "7516b8e9436de903eef85fb156cbc3cf";//临时2天
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Reference in New Issue
Block a user