Skip to content

Commit 62efecb

Browse files
author
yindz
authored
Merge pull request #65 from yindz/v1.0.18
V1.0.18
2 parents da45a39 + 6bf30f5 commit 62efecb

File tree

3 files changed

+4931
-1
lines changed

3 files changed

+4931
-1
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.apifan.common</groupId>
88
<artifactId>common-random</artifactId>
9-
<version>1.0.17</version>
9+
<version>1.0.18</version>
1010
<packaging>jar</packaging>
1111
<name>common-random</name>
1212
<description>An easy-to-use random data generator.</description>

src/main/java/com/apifan/common/random/source/FinancialSource.java

+15
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public class FinancialSource {
4848
*/
4949
private static List<String> stockBseList = Lists.newArrayList();
5050

51+
/**
52+
* 股票(纳斯达克)
53+
*/
54+
private static List<String> stockNasdaqList = Lists.newArrayList();
55+
5156
/**
5257
* 开放式基金
5358
*/
@@ -69,6 +74,7 @@ private FinancialSource() {
6974
stockBseList = ResourceUtils.base64DecodeLines(ResourceUtils.readLines("stock-bse.txt"));
7075
fundsList = ResourceUtils.readLines("fund.txt");
7176
currencyList = ResourceUtils.base64DecodeLines(ResourceUtils.readLines("currency.txt"));
77+
stockNasdaqList = ResourceUtils.readLines("stock-nasdaq.txt");
7278
}
7379

7480
/**
@@ -120,6 +126,15 @@ public String[] randomBseStock() {
120126
return StringUtils.isBlank(stock) ? null : stock.split(",");
121127
}
122128

129+
/**
130+
* 随机股票代码(纳斯达克)
131+
*
132+
* @return 股票代码
133+
*/
134+
public String randomNasdaqStock() {
135+
return ResourceUtils.getRandomString(stockNasdaqList, 1);
136+
}
137+
123138
/**
124139
* 随机基金
125140
*

0 commit comments

Comments
 (0)