Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新表结构,对象,适配spring security jdbc #186

Merged
merged 5 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions assets/src/main/java/io/leafage/basic/assets/bo/CategoryBO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright 2018-2024 little3201.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package io.leafage.basic.assets.bo;


import jakarta.validation.constraints.NotBlank;

/**
* bo class for category
*
* @author wilsonli 2022-12-10 22:28
**/
public abstract class CategoryBO {

/**
* 名称
*/
@NotBlank(message = "category name is blank.")
private String name;

/**
* 描述
*/
private String description;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,35 @@
*
*/

package io.leafage.basic.assets.dto;
package io.leafage.basic.assets.bo;


import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

/**
* dto class for posts statistics.
* bo class for comment
*
* @author wq li 2024-02-02 14:30
**/
public class PostStatisticsDTO {
* @author liwenqiang 2023-03-26 14:30
*/
public abstract class CommentBO {

/**
* 帖子ID
* 帖子
*/
@NotNull(message = "postId must not be null.")
private Long postId;

/**
* 浏览量
*/
private int viewed;

/**
* 点赞量
* 内容
*/
private int likes;
@NotBlank(message = "context must not be blank.")
private String context;

/**
* 评论量
* 回复者
*/
private int comments;
private Long replier;


public Long getPostId() {
Expand All @@ -53,27 +54,19 @@ public void setPostId(Long postId) {
this.postId = postId;
}

public int getViewed() {
return viewed;
}

public void setViewed(int viewed) {
this.viewed = viewed;
}

public int getLikes() {
return likes;
public String getContext() {
return context;
}

public void setLikes(int likes) {
this.likes = likes;
public void setContext(String context) {
this.context = context;
}

public int getComments() {
return comments;
public Long getReplier() {
return replier;
}

public void setComments(int comments) {
this.comments = comments;
public void setReplier(Long replier) {
this.replier = replier;
}
}
89 changes: 89 additions & 0 deletions assets/src/main/java/io/leafage/basic/assets/bo/PostBO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* Copyright 2018-2024 little3201.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package io.leafage.basic.assets.bo;


import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;

import java.util.Set;

/**
* bo class for post
*
* @author liwenqiang 2022-12-10 22:09
*/
public abstract class PostBO {

/**
* 标题
*/
@NotBlank(message = "title must not be blank.")
private String title;

/**
* 封面
*/
private String cover;

/**
* 内容
*/
@NotBlank(message = "context must not be blank.")
private String context;

/**
* 标签
*/
@NotEmpty(message = "tags must not be empty.")
private Set<String> tags;


public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getCover() {
return cover;
}

public void setCover(String cover) {
this.cover = cover;
}

public String getContext() {
return context;
}

public void setContext(String context) {
this.context = context;
}

public Set<String> getTags() {
return tags;
}

public void setTags(Set<String> tags) {
this.tags = tags;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2018-2024 little3201.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package io.leafage.basic.assets.constants;

/**
* statistics type enum
*
* @author liwenqiang 2022-05-31 09:03
**/
public enum StatisticsEnum {

VIEWED("viewed"),

LIKES("likes"),

COMMENTS("comments");

public final String value;

StatisticsEnum(String value) {
this.value = value;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class Category extends AuditMetadata {
/**
* 是否可用
*/
@Column(name = "is_enabled", nullable = false)
@Column(name = "enabled", nullable = false)
private boolean enabled = true;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public class Post extends AuditMetadata {
/**
* 是否可用
*/
@Column(name = "is_enabled")
private boolean enabled = true;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class PostContent extends AuditMetadata {
/**
* 内容
*/
private String content;
private String context;

public Long getPostId() {
return postId;
Expand All @@ -50,12 +50,11 @@ public void setPostId(Long postId) {
this.postId = postId;
}

public String getContent() {
return content;
public String getContext() {
return context;
}

public void setContent(String content) {
this.content = content;
public void setContext(String context) {
this.context = context;
}

}
Loading
Loading