Skip to content

Commit 165bc20

Browse files
committed
UnaBoot v1.2.0
1 parent 1a5e0eb commit 165bc20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1561
-82
lines changed

src/main/java/com/ramostear/unaboot/UnaBootProApplication.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
package com.ramostear.unaboot;
22

3+
import com.ramostear.unaboot.repository.support.UnaBootRepositoryImpl;
34
import lombok.extern.slf4j.Slf4j;
45
import org.springframework.boot.SpringApplication;
56
import org.springframework.boot.autoconfigure.SpringBootApplication;
67
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
78
import org.springframework.boot.builder.SpringApplicationBuilder;
89
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
10+
import org.springframework.cache.annotation.EnableCaching;
11+
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
12+
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
913

1014

1115
@Slf4j
16+
@EnableCaching
17+
@EnableJpaAuditing
1218
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
1319
public class UnaBootProApplication extends SpringBootServletInitializer {
1420

src/main/java/com/ramostear/unaboot/common/UnaBootConst.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,7 @@ public class UnaBootConst {
107107
public static final int USER_NEW = 0;
108108
public static final int USER_DEFAULT = 1;
109109

110+
public static final int BLOG = 0;
111+
public static final int DOC = 1;
112+
110113
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.ramostear.unaboot.common.exception;
2+
3+
import org.springframework.http.HttpStatus;
4+
5+
/**
6+
* @ClassName BlogNotFoundException
7+
* @Description 博客404异常类
8+
* @Author 树下魅狐
9+
* @Date 2020/3/18 0018 6:50
10+
* @Version since UnaBoot-1.0
11+
**/
12+
public class BlogNotFoundException extends UnaBootException {
13+
14+
public BlogNotFoundException(String message) {
15+
super(message);
16+
}
17+
18+
@Override
19+
public HttpStatus getStatus() {
20+
return HttpStatus.NOT_FOUND;
21+
}
22+
}

src/main/java/com/ramostear/unaboot/common/util/HTMLUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static List<String> matchImgAddr(String html){
3737
String address = srcMatcher.group(3);
3838
addressList.add(address);
3939
}
40+
isFound = imgMatcher.find();
4041
}
4142
}
4243
return addressList;

src/main/java/com/ramostear/unaboot/configuration/ShiroConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public EhCacheManager ehCacheManager(){
4141
@Bean
4242
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean(){
4343
EhCacheManagerFactoryBean factoryBean = new EhCacheManagerFactoryBean();
44+
factoryBean.setShared(true);
4445
return factoryBean;
4546
}
4647

src/main/java/com/ramostear/unaboot/configuration/UnaBootLauncher.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public void run(ApplicationArguments args) {
6666
settingService.create(theme);
6767
try {
6868
themeService.initDefaultTheme();
69+
servletContext.setAttribute("theme",theme.getValue());
6970
} catch (IOException e) {
7071
e.printStackTrace();
7172
}

src/main/java/com/ramostear/unaboot/domain/dto/PostMinDto.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ public class PostMinDto implements ObjectOutputConverter<PostMinDto, Post> {
3333
private Date updateTime;
3434

3535
private Long visits;
36+
37+
private String thumb;
38+
39+
private Integer style;
3640
}

src/main/java/com/ramostear/unaboot/domain/entity/Category.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public class Category extends UnaBootPO implements Serializable {
5050
@Column(name = "theme")
5151
private String theme;
5252

53+
@Column(name = "thumb")
54+
private String thumb;
55+
5356
@Column(name = "is_show",columnDefinition = "int default 0")
5457
private Integer show;
5558

src/main/java/com/ramostear/unaboot/domain/entity/Post.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.ramostear.unaboot.domain.entity;
22

3+
import com.ramostear.unaboot.common.UnaBootConst;
34
import com.ramostear.unaboot.domain.UnaBootPO;
45
import lombok.*;
56
import org.apache.commons.lang3.StringUtils;
@@ -61,6 +62,9 @@ public class Post extends UnaBootPO implements Serializable {
6162
@Column(name = "comment",columnDefinition = "int default 0")
6263
private Boolean comment; //评论
6364

65+
@Column(name = "style",columnDefinition = "int default 0")
66+
private Integer style;//文章类型
67+
6468
@Column(name = "author",columnDefinition = "varchar(32) default ''")
6569
private String author;
6670

src/main/java/com/ramostear/unaboot/domain/param/PostParam.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@
2424
@AllArgsConstructor
2525
public class PostParam implements ObjectInputConverter<Post> {
2626

27-
@Size(max = 64,min = 8,message = "Slug长度必须在{min}到{max}之间")
27+
@Size(max = 64,min = 6,message = "Slug长度必须在{min}到{max}之间")
2828
private String slug;
2929

3030
@NotBlank(message = "文章标题不能为空")
31-
@Size(max = 64,min = 8,message = "标题长度必须在{min}到{max}之间")
31+
@Size(max = 64,min = 2,message = "标题长度必须在{min}到{max}之间")
3232
private String title;
3333

3434
private Integer status = 0;
3535

36+
private Integer style = 0;
37+
3638
@NotBlank(message = "文章摘要不能为空")
3739
@Size(max = 128,message = "摘要长度不能超过{max}")
3840
private String summary;

0 commit comments

Comments
 (0)