-
Notifications
You must be signed in to change notification settings - Fork 716
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,30 +9,17 @@ | |
5. 强大的API接口,为学习编程的你提供服务端环境 | ||
6. 更多功能,期待你去发现 | ||
|
||
== 使用朋也社区收费吗? | ||
== 开源协议 | ||
|
||
开源协议是 `GNU AGPLv3` | ||
|
||
*完全免费* 源代码毫不保留的全部开源,怕留后门的,可以自行查看,不过要遵守开源协议哦 | ||
|
||
觉得好用(对你有帮助的话) 也可以请朋也喝杯茶 | ||
|
||
[TIP] | ||
==== | ||
*如果你跟朋也一样, 囊中羞涩, 也可以考虑帮忙点点朋也博客上的广告, 先行谢过!* 博客地址: https://atjiu.github.io | ||
*如果你想二次开发,咱们关上门好商量* Email: [email protected] | ||
==== | ||
|
||
image:https://cloud.githubusercontent.com/assets/6915570/18000010/9283d530-6bae-11e6-8c34-cd27060b9074.png[] | ||
image:https://cloud.githubusercontent.com/assets/6915570/17999995/7c2a4db4-6bae-11e6-891c-4b6bc4f00f4b.png[] | ||
|
||
== 使用过程中碰到问题怎么办? | ||
|
||
1. 一定要仔细看文档,基本上能碰到的问题我都在文档中说明了 | ||
1. 一定要仔细看文档,基本上能碰到的问题在文档中都能找到解决办法 | ||
2. 往下翻, 仔细查看Q&A | ||
3. 去Github Issue上提问,我每天都会打开Github,看到有消息立即就会回复 | ||
3. 去Github Issue上提问 | ||
4. QQ群 1048094312 https://jq.qq.com/?_wv=1027&k=nGLY4QmH[点击链接加入群聊【朋也社区 - 问与答】] | ||
5. 去 https://17dev.club[开发俱乐部] 上提问,这个网站是朋也自行搭建的,目的是提供一个无嘲讽的学习编程的环境 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
package co.yiiu.pybbs; | ||
|
||
import co.yiiu.pybbs.plugin.ElasticSearchService; | ||
import co.yiiu.pybbs.util.MyPage; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.junit4.SpringRunner; | ||
|
||
//@RunWith(SpringRunner.class) | ||
//@SpringBootTest | ||
import javax.annotation.Resource; | ||
import java.util.Map; | ||
|
||
@RunWith(SpringRunner.class) | ||
@SpringBootTest | ||
public class PybbsApplicationTests { | ||
|
||
@Resource | ||
ElasticSearchService elasticSearchService; | ||
|
||
@Test | ||
public void contextLoads() { | ||
MyPage<Map<String, Object>> mapMyPage = elasticSearchService.searchDocument(1, 20, "你好", "title"); | ||
for (Map<String, Object> record : mapMyPage.getRecords()) { | ||
System.out.println(record.toString()); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,48 @@ | ||
package co.yiiu.pybbs.util; | ||
|
||
import co.yiiu.pybbs.util.bcrypt.BCryptPasswordEncoder; | ||
import org.junit.Test; | ||
|
||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
/** | ||
* Created by tomoya at 2019/5/24 | ||
*/ | ||
public class StringUtilTest { | ||
|
||
@Test | ||
public void check() { | ||
String username = "[email protected]"; | ||
System.out.println(StringUtil.check(username, StringUtil.USERNAMEREGEX)); | ||
String url = "https://www.97560.com/topic/538825475611426816/?aa=dasd&asd=123123123"; | ||
String atRegex = "/topic/(\\d+)"; | ||
Pattern regex = Pattern.compile(atRegex); | ||
Matcher regexMatcher = regex.matcher(url); | ||
while (regexMatcher.find()) { | ||
System.out.println(regexMatcher.group(1)); | ||
} | ||
} | ||
|
||
@Test | ||
public void test() { | ||
String s = "PAYPALISHIRING"; | ||
convert(s, 3); | ||
} | ||
|
||
System.out.println(new BCryptPasswordEncoder().encode("123123")); | ||
public void convert(String s, int numRows) { | ||
int x = s.length() / numRows + numRows; | ||
char[][] c = new char[x][numRows]; | ||
char[] schar = s.toCharArray(); | ||
int offset = 0; | ||
int index = s.length() - 1; | ||
for (int i = 0; i < c.length; i++) { | ||
for (int j = 0; j < c[i].length; j++) { | ||
if (offset > 0 && offset != j) { | ||
continue; | ||
} | ||
c[i][j] = schar[index]; | ||
index++; | ||
} | ||
offset++; | ||
if (offset == numRows - 1) offset = 0; | ||
} | ||
} | ||
} |