Skip to content

Commit f669506

Browse files
committed
update
1 parent b561b44 commit f669506

File tree

5 files changed

+63
-27
lines changed

5 files changed

+63
-27
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99

1010
如果发现了bug或者有好的建议,欢迎提issue,当然更欢迎 pr
1111

12-
## 捐赠&商用付费
12+
## 版权
1313

14-
- 个人学习使用永久免费
15-
- 商用授权一次性付费 **¥68.00** 永久使用
14+
本项目版权归本项目帐号所有
1615

17-
![alipay](https://images.gitee.com/uploads/images/2021/0223/115428_99d1cc7f_82603.png)
16+
开源协议:AGPL
17+
18+
二次开发或商用请遵守开源协议
1819

1920
[捐赠列表](https://github.com/atjiu/pybbs/wiki/%E6%8D%90%E8%B5%A0)
2021

docs/src/main/asciidoc/introduction.asciidoc

+3-16
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,17 @@
99
5. 强大的API接口,为学习编程的你提供服务端环境
1010
6. 更多功能,期待你去发现
1111

12-
== 使用朋也社区收费吗?
12+
== 开源协议
1313

1414
开源协议是 `GNU AGPLv3`
1515

1616
*完全免费* 源代码毫不保留的全部开源,怕留后门的,可以自行查看,不过要遵守开源协议哦
1717

18-
觉得好用(对你有帮助的话) 也可以请朋也喝杯茶
19-
20-
[TIP]
21-
====
22-
*如果你跟朋也一样, 囊中羞涩, 也可以考虑帮忙点点朋也博客上的广告, 先行谢过!* 博客地址: https://atjiu.github.io
23-
24-
*如果你想二次开发,咱们关上门好商量* Email: [email protected]
25-
====
26-
27-
image:https://cloud.githubusercontent.com/assets/6915570/18000010/9283d530-6bae-11e6-8c34-cd27060b9074.png[]
28-
image:https://cloud.githubusercontent.com/assets/6915570/17999995/7c2a4db4-6bae-11e6-891c-4b6bc4f00f4b.png[]
29-
3018
== 使用过程中碰到问题怎么办?
3119

32-
1. 一定要仔细看文档,基本上能碰到的问题我都在文档中说明了
20+
1. 一定要仔细看文档,基本上能碰到的问题在文档中都能找到解决办法
3321
2. 往下翻, 仔细查看Q&A
34-
3. 去Github Issue上提问,我每天都会打开Github,看到有消息立即就会回复
22+
3. 去Github Issue上提问
3523
4. QQ群 1048094312 https://jq.qq.com/?_wv=1027&k=nGLY4QmH[点击链接加入群聊【朋也社区 - 问与答】]
36-
5. 去 https://17dev.club[开发俱乐部] 上提问,这个网站是朋也自行搭建的,目的是提供一个无嘲讽的学习编程的环境
3724

3825

pom.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,10 @@
243243
<groupId>org.apache.maven.plugins</groupId>
244244
<artifactId>maven-surefire-plugin</artifactId>
245245
<configuration>
246-
<skipTests>true</skipTests>
246+
<includes>
247+
<include>**/*.java</include>
248+
</includes>
249+
<!-- <skipTests>true</skipTests>-->
247250
</configuration>
248251
</plugin>
249252
</plugins>
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
11
package co.yiiu.pybbs;
22

3+
import co.yiiu.pybbs.plugin.ElasticSearchService;
4+
import co.yiiu.pybbs.util.MyPage;
35
import org.junit.Test;
6+
import org.junit.runner.RunWith;
7+
import org.springframework.boot.test.context.SpringBootTest;
8+
import org.springframework.test.context.junit4.SpringRunner;
49

5-
//@RunWith(SpringRunner.class)
6-
//@SpringBootTest
10+
import javax.annotation.Resource;
11+
import java.util.Map;
12+
13+
@RunWith(SpringRunner.class)
14+
@SpringBootTest
715
public class PybbsApplicationTests {
816

17+
@Resource
18+
ElasticSearchService elasticSearchService;
19+
920
@Test
1021
public void contextLoads() {
22+
MyPage<Map<String, Object>> mapMyPage = elasticSearchService.searchDocument(1, 20, "你好", "title");
23+
for (Map<String, Object> record : mapMyPage.getRecords()) {
24+
System.out.println(record.toString());
25+
}
1126
}
1227

1328
}
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,48 @@
11
package co.yiiu.pybbs.util;
22

3-
import co.yiiu.pybbs.util.bcrypt.BCryptPasswordEncoder;
43
import org.junit.Test;
54

5+
import java.util.regex.Matcher;
6+
import java.util.regex.Pattern;
7+
68
/**
79
* Created by tomoya at 2019/5/24
810
*/
911
public class StringUtilTest {
1012

1113
@Test
1214
public void check() {
13-
String username = "[email protected]";
14-
System.out.println(StringUtil.check(username, StringUtil.USERNAMEREGEX));
15+
String url = "https://www.97560.com/topic/538825475611426816/?aa=dasd&asd=123123123";
16+
String atRegex = "/topic/(\\d+)";
17+
Pattern regex = Pattern.compile(atRegex);
18+
Matcher regexMatcher = regex.matcher(url);
19+
while (regexMatcher.find()) {
20+
System.out.println(regexMatcher.group(1));
21+
}
22+
}
23+
24+
@Test
25+
public void test() {
26+
String s = "PAYPALISHIRING";
27+
convert(s, 3);
28+
}
1529

16-
System.out.println(new BCryptPasswordEncoder().encode("123123"));
30+
public void convert(String s, int numRows) {
31+
int x = s.length() / numRows + numRows;
32+
char[][] c = new char[x][numRows];
33+
char[] schar = s.toCharArray();
34+
int offset = 0;
35+
int index = s.length() - 1;
36+
for (int i = 0; i < c.length; i++) {
37+
for (int j = 0; j < c[i].length; j++) {
38+
if (offset > 0 && offset != j) {
39+
continue;
40+
}
41+
c[i][j] = schar[index];
42+
index++;
43+
}
44+
offset++;
45+
if (offset == numRows - 1) offset = 0;
46+
}
1747
}
1848
}

0 commit comments

Comments
 (0)