feat(分类模块): 实现分类管理功能
新增分类模块相关代码,包括实体类、DTO、Repository、Service和Controller 添加分类数据初始化逻辑和日志记录 实现分类的增删改查及搜索功能
This commit is contained in:
68
src/main/java/com/qf/myafterprojecy/pojo/Category.java
Normal file
68
src/main/java/com/qf/myafterprojecy/pojo/Category.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package com.qf.myafterprojecy.pojo;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "category")
|
||||
public class Category {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "typeid")
|
||||
private Integer typeid;
|
||||
|
||||
@NotBlank(message = "分类名称不能为空")
|
||||
@Column(name = "typename")
|
||||
private String typename;
|
||||
|
||||
@Column(name = "description")
|
||||
private String description;
|
||||
|
||||
@Column(name = "created_at")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Column(name = "updated_at")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
// Getters and Setters
|
||||
public Integer getTypeid() {
|
||||
return typeid;
|
||||
}
|
||||
|
||||
public void setTypeid(Integer typeid) {
|
||||
this.typeid = typeid;
|
||||
}
|
||||
|
||||
public String getTypename() {
|
||||
return typename;
|
||||
}
|
||||
|
||||
public void setTypename(String typename) {
|
||||
this.typename = typename;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(LocalDateTime updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.qf.myafterprojecy.pojo.dto;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class CategoryDto {
|
||||
private Integer typeid;
|
||||
private String typename;
|
||||
private String description;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
// Getters and Setters
|
||||
public Integer getTypeid() {
|
||||
return typeid;
|
||||
}
|
||||
|
||||
public void setTypeid(Integer typeid) {
|
||||
this.typeid = typeid;
|
||||
}
|
||||
|
||||
public String getTypename() {
|
||||
return typename;
|
||||
}
|
||||
|
||||
public void setTypename(String typename) {
|
||||
this.typename = typename;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(LocalDateTime updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user