Skip to content

Commit

Permalink
Merge pull request #174 from halo-dev/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ruibaby authored Jun 1, 2019
2 parents d6bfa07 + 7c8fb07 commit 1ef1095
Show file tree
Hide file tree
Showing 83 changed files with 205 additions and 138 deletions.
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,56 @@
> Halo 是一款现代化的个人独立博客系统,给习惯写博客的同学一个更好的选择。
<p align="center">
<a href="https://ryanc.cc"><img alt="Author" src="https://img.shields.io/badge/author-ruibaby-red.svg?style=flat-square"/></a>
<a href="#"><img alt="JDK" src="https://img.shields.io/badge/JDK-1.8-yellow.svg?style=flat-square"/></a>
<a href="https://github.com/halo-dev/halo/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/halo-dev/halo.svg?style=flat-square"/></a>
<a href="https://github.com/halo-dev/halo/releases"><img alt="GitHub All Releases" src="https://img.shields.io/github/downloads/halo-dev/halo/total.svg?style=flat-square"></a>
<a href="https://github.com/halo-dev/halo/commits"><img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/w/halo-dev/halo.svg?style=flat-square"></a>
<a href="https://github.com/halo-dev/halo/commits"><img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/halo-dev/halo.svg?style=flat-square"></a>
<a href="https://travis-ci.org/halo-dev/halo"><img alt="Travis CI" src="https://img.shields.io/travis/halo-dev/halo.svg?style=flat-square"/></a>
</p>

------------------------------

## 新版本说明

**老版本已不提供维护,请不要再使用老版本进行部署了,当前分支为新版本,正在内测中,将于近期发布版本**

## 简介

**Halo** [ˈheɪloʊ],意为光环。当然,你也可以当成拼音读(哈喽)。

轻快,简洁,功能强大,使用 Java 开发的博客系统。

> QQ 交流群: 162747721 | Telegram 交流群[https://t.me/HaloBlog](https://t.me/HaloBlog) | Telegram 频道[https://t.me/halo_dev](https://t.me/halo_dev) | [WeHalo 小程序](https://github.com/aquanlerou/WeHalo)
> [官网论坛](https://bbs.halo.run) | [QQ 交流群](https://jq.qq.com/?_wv=1027&k=5tnr930) | [Telegram 交流群](https://t.me/HaloBlog) | [Telegram 频道](https://t.me/halo_dev) | [WeHalo 小程序](https://github.com/aquanlerou/WeHalo)
## 快速开始

老版本下载地址:[https://github.com/halo-dev/halo/releases/tag/v0.4.4](https://github.com/halo-dev/halo/releases/tag/v0.4.4)
### 下载最新的 Halo 安装包

```bash
curl -L https://github.com/halo-dev/halo/releases/download/v1.0.0-beta.9/halo-1.0.0-beta.9.jar --output halo-latest.jar
```

或者

```bash
wget https://github.com/halo-dev/halo/releases/download/v1.0.0-beta.9/halo-1.0.0-beta.9.jar -O halo-latest.jar
```

### 启动 Halo

```bash
nohup java -jar halo-latest.jar &
```

新版本正在内测中。
详细文档请移步:<https://halo.run/docs>

## 博客示例

请看 <[https://github.com/halo-dev/halo/issues/26](https://github.com/halo-dev/halo/issues/26)>。
请移步: <https://github.com/halo-dev/halo/issues/26>

## 周边

- 后台管理(halo-admin):<[https://github.com/halo-dev/halo-admin](https://github.com/halo-dev/halo-admin)>
- 独立评论模块(halo-comment):<[https://github.com/halo-dev/halo-comment](https://github.com/halo-dev/halo-comment)>
- 管理 APP(halo-app):<[https://github.com/halo-dev/halo-app](https://github.com/halo-dev/halo-app)>
- 主题仓库:<[https://halo.run/theme](https://halo.run/theme)>
- 后台管理(halo-admin):<https://github.com/halo-dev/halo-admin>
- 独立评论模块(halo-comment):<https://github.com/halo-dev/halo-comment>
- 管理 APP(halo-app):<https://github.com/halo-dev/halo-app>
- 主题仓库:<https://halo.run/theme>

## 许可证

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ apply plugin: 'io.spring.dependency-management'

group = 'run.halo.app'
archivesBaseName = 'halo'
version = '1.0.0-beta.8'
version = '1.0.0'
sourceCompatibility = '1.8'
description = 'Halo, personal blog system developed in Java.'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public String version() {

@GetMapping("/avatar")
public void avatar(HttpServletResponse response) throws IOException {
User user = userService.getCurrentUser().orElseThrow(() -> new ServiceException("Can not find blog owner"));
User user = userService.getCurrentUser().orElseThrow(() -> new ServiceException("找不到博主信息"));
if (StringUtils.isNotEmpty(user.getAvatar())) {
response.sendRedirect(user.getAvatar());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void handleCommentNewEvent(CommentNewEvent newEvent) {
return;
}

User user = userService.getCurrentUser().orElseThrow(() -> new ServiceException("Can not find blog owner"));
User user = userService.getCurrentUser().orElseThrow(() -> new ServiceException("找不到博主信息"));


Map<String, Object> data = new HashMap<>();
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/run/halo/app/model/params/UserParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@
@Data
public class UserParam implements InputConverter<User> {

@NotBlank(message = "用户名不能为空", groups = {AllCheck.class})
@Size(max = 50, message = "用户名的字符长度不能超过 {max}", groups = {AllCheck.class})
@NotBlank(message = "用户名不能为空", groups = {CreateCheck.class, UpdateCheck.class})
@Size(max = 50, message = "用户名的字符长度不能超过 {max}", groups = {CreateCheck.class, UpdateCheck.class})
private String username;

@NotBlank(message = "用户昵称不能为空", groups = {AllCheck.class})
@Size(max = 255, message = "用户昵称的字符长度不能超过 {max}", groups = {AllCheck.class})
@NotBlank(message = "用户昵称不能为空", groups = {CreateCheck.class, UpdateCheck.class})
@Size(max = 255, message = "用户昵称的字符长度不能超过 {max}", groups = {CreateCheck.class, UpdateCheck.class})
private String nickname;

@Email(message = "电子邮件地址的格式不正确", groups = {AllCheck.class})
@NotBlank(message = "电子邮件地址不能为空", groups = {AllCheck.class})
@Size(max = 127, message = "电子邮件的字符长度不能超过 {max}", groups = {AllCheck.class})
@Email(message = "电子邮件地址的格式不正确", groups = {CreateCheck.class, UpdateCheck.class})
@NotBlank(message = "电子邮件地址不能为空", groups = {CreateCheck.class, UpdateCheck.class})
@Size(max = 127, message = "电子邮件的字符长度不能超过 {max}", groups = {CreateCheck.class, UpdateCheck.class})
private String email;

@Null(groups = UpdateCheck.class)
@Size(min = 8, max = 100, message = "密码的字符长度必须在 {min} - {max} 之间", groups = {CreateCheck.class})
private String password;

@Size(max = 1023, message = "头像链接地址的字符长度不能超过 {max}", groups = {AllCheck.class})
@Size(max = 1023, message = "头像链接地址的字符长度不能超过 {max}", groups = {CreateCheck.class, UpdateCheck.class})
private String avatar;

@Size(max = 1023, message = "用户描述的字符长度不能超过 {max}", groups = {AllCheck.class})
@Size(max = 1023, message = "用户描述的字符长度不能超过 {max}", groups = {CreateCheck.class, UpdateCheck.class})
private String description;

}
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse

if (!isInstalled) {
// If not installed
getFailureHandler().onFailure(request, response, new NotInstallException("The blog has not been initialized yet!"));
getFailureHandler().onFailure(request, response, new NotInstallException("当前博客还没有初始化"));
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected void doAuthenticate(HttpServletRequest request, HttpServletResponse re
Optional<Integer> optionalUserId = cacheStore.getAny(SecurityUtils.buildTokenAccessKey(token), Integer.class);

if (!optionalUserId.isPresent()) {
getFailureHandler().onFailure(request, response, new AuthenticationException("The token has been expired or not exist").setErrorData(token));
getFailureHandler().onFailure(request, response, new AuthenticationException("Token 已过期或不存在").setErrorData(token));
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public long countByStatus(PostStatus status) {
public POST getByUrl(String url) {
Assert.hasText(url, "Url must not be blank");

return basePostRepository.getByUrl(url).orElseThrow(() -> new NotFoundException("The post does not exist").setErrorData(url));
return basePostRepository.getByUrl(url).orElseThrow(() -> new NotFoundException("该文章不存在").setErrorData(url));
}

@Override
Expand All @@ -87,7 +87,7 @@ public POST getBy(PostStatus status, String url) {

Optional<POST> postOptional = basePostRepository.getByUrlAndStatus(url, status);

return postOptional.orElseThrow(() -> new NotFoundException("The post with status " + status + " and url " + url + "was not existed").setErrorData(url));
return postOptional.orElseThrow(() -> new NotFoundException("The post with status " + status + " and url " + url + " was not existed").setErrorData(url));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private CategoryVO createTopLevelCategory() {
*/
@Override
public Category getBySlugName(String slugName) {
return categoryRepository.getBySlugName(slugName).orElseThrow(() -> new NotFoundException("The Category does not exist").setErrorData(slugName));
return categoryRepository.getBySlugName(slugName).orElseThrow(() -> new NotFoundException("该分类已存在").setErrorData(slugName));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Tag create(Tag tag) {
*/
@Override
public Tag getBySlugNameOfNonNull(String slugName) {
return tagRepository.getBySlugName(slugName).orElseThrow(() -> new NotFoundException("The tag does not exist").setErrorData(slugName));
return tagRepository.getBySlugName(slugName).orElseThrow(() -> new NotFoundException("该标签已存在").setErrorData(slugName));
}


Expand Down
10 changes: 5 additions & 5 deletions src/main/java/run/halo/app/service/impl/ThemeServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public String getTemplateContent(String absolutePath) {
try {
return new String(Files.readAllBytes(path), StandardCharsets.UTF_8);
} catch (IOException e) {
throw new ServiceException("Failed to read file " + absolutePath, e);
throw new ServiceException("读取模板内容失败 " + absolutePath, e);
}
}

Expand All @@ -237,7 +237,7 @@ public void saveTemplateContent(String absolutePath, String content) {
try {
Files.write(path, content.getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new ServiceException("Failed to write file " + absolutePath, e);
throw new ServiceException("保存模板内容失败 " + absolutePath, e);
}
}

Expand Down Expand Up @@ -418,7 +418,7 @@ public ThemeProperty add(Path themeTmpPath) throws IOException {
.anyMatch(themeProperty -> themeProperty.getId().equalsIgnoreCase(tmpThemeProperty.getId()));

if (isExist) {
throw new AlreadyExistsException("The theme with id " + tmpThemeProperty.getId() + " has already existed");
throw new AlreadyExistsException("当前安装的主题已存在");
}

// Copy the temporary path to current theme folder
Expand Down Expand Up @@ -722,7 +722,7 @@ private Optional<Path> getThemePropertyPathOfNullable(@NonNull Path themePath) {
*/
@NonNull
private Path getThemePropertyPath(@NonNull Path themePath) {
return getThemePropertyPathOfNullable(themePath).orElseThrow(() -> new ThemePropertyMissingException(themePath + " dose not exist any theme property file").setErrorData(themePath));
return getThemePropertyPathOfNullable(themePath).orElseThrow(() -> new ThemePropertyMissingException(themePath + " 没有说明文件").setErrorData(themePath));
}

private Optional<ThemeProperty> getPropertyOfNullable(Path themePath) {
Expand Down Expand Up @@ -773,7 +773,7 @@ private Optional<ThemeProperty> getPropertyOfNullable(Path themePath) {
*/
@NonNull
private ThemeProperty getProperty(@NonNull Path themePath) {
return getPropertyOfNullable(themePath).orElseThrow(() -> new ThemePropertyMissingException("Cannot resolve theme property").setErrorData(themePath));
return getPropertyOfNullable(themePath).orElseThrow(() -> new ThemePropertyMissingException("该主题没有说明文件").setErrorData(themePath));
}

/**
Expand Down

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/main/resources/admin/css/chunk-02f1697e.7cf84e9e.css

This file was deleted.

1 change: 1 addition & 0 deletions src/main/resources/admin/css/chunk-0337f7a6.4c6b622f.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.category-tree[data-v-0f333a36]{margin-top:1rem}
1 change: 0 additions & 1 deletion src/main/resources/admin/css/chunk-0aab7d1a.701a4459.css

This file was deleted.

1 change: 1 addition & 0 deletions src/main/resources/admin/css/chunk-14e0b302.32f796a8.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/main/resources/admin/css/chunk-1ea08528.db89d50a.css

This file was deleted.

1 change: 1 addition & 0 deletions src/main/resources/admin/css/chunk-2a007c18.45475c5a.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/main/resources/admin/css/chunk-31829c73.f3153164.css

This file was deleted.

1 change: 1 addition & 0 deletions src/main/resources/admin/css/chunk-31c8ea42.4a090118.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/main/resources/admin/css/chunk-35e63e70.6a83ae7d.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1ef1095

Please sign in to comment.