增加付费片单,修复种子列表搜索排序
Change-Id: Ib645906c0f240f954676790daf2ff0e5f16f6e0a
diff --git a/src/main/java/com/example/myproject/entity/LoginLog.java b/src/main/java/com/example/myproject/entity/LoginLog.java
new file mode 100644
index 0000000..482c399
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/LoginLog.java
@@ -0,0 +1,26 @@
+package com.example.myproject.entity;
+
+import java.time.LocalDateTime;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import lombok.Data;
+
+@Entity
+@Table(name = "login_log")
+@Data
+public class LoginLog {
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ private Long userId;
+
+ @Column(columnDefinition = "datetime default now()", name = "login_time")
+ private LocalDateTime loginTime;
+
+}
diff --git a/src/main/java/com/example/myproject/entity/PaidPlaylistEntity.java b/src/main/java/com/example/myproject/entity/PaidPlaylistEntity.java
new file mode 100644
index 0000000..ae212aa
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/PaidPlaylistEntity.java
@@ -0,0 +1,42 @@
+package com.example.myproject.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.*;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+@Table(name="paid_playlists")
+@Entity
+@ApiModel("付费片单实体类")
+public class PaidPlaylistEntity {
+
+ @ApiModelProperty(value = "片单ID", example = "1")
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @ApiModelProperty(value = "片单标题", example = "热门电影合集")
+ private String title;
+
+ @ApiModelProperty(value = "封面图片URL", example = "/uploads/PlaylistCoverUrl/1.jpg")
+ private String coverUrl;
+
+ @ApiModelProperty(value = "价格,单位元", example = "1")
+ private BigDecimal price;
+
+ @ApiModelProperty(value = "片单描述", example = "包含多部热门电影的合集")
+ private String description;
+
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "创建时间", example = "2024-01-01 12:00:00")
+ private LocalDateTime createdAt;
+
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ @ApiModelProperty(value = "更新时间", example = "2024-01-02 12:00:00")
+ private LocalDateTime updatedAt;
+}
diff --git a/src/main/java/com/example/myproject/entity/PaidPlaylistSeedEntity.java b/src/main/java/com/example/myproject/entity/PaidPlaylistSeedEntity.java
new file mode 100644
index 0000000..d721ce8
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/PaidPlaylistSeedEntity.java
@@ -0,0 +1,34 @@
+package com.example.myproject.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.*;
+import java.time.LocalDateTime;
+
+@Data
+@TableName("paid_playlist_seeds")
+@Entity
+@Table(name = "paid_playlist_seeds")
+@ApiModel("付费片单与种子关联实体类")
+public class PaidPlaylistSeedEntity {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @ApiModelProperty(value = "关联ID", example = "1")
+ private Long id;
+
+ @ApiModelProperty(value = "付费片单ID", example = "1")
+ @Column(name = "playlist_id")
+ private Long playlistId;
+
+ @ApiModelProperty(value = "种子ID", example = "123")
+ @Column(name = "seed_id")
+ private Long seedId;
+
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "创建时间", example = "2024-01-01 12:00:00")
+ private LocalDateTime createdAt;
+}
diff --git a/src/main/java/com/example/myproject/entity/UserPaidPlaylistEntity.java b/src/main/java/com/example/myproject/entity/UserPaidPlaylistEntity.java
new file mode 100644
index 0000000..6ea5037
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/UserPaidPlaylistEntity.java
@@ -0,0 +1,33 @@
+package com.example.myproject.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.*;
+import java.time.LocalDateTime;
+
+@Data
+@Entity
+@Table(name = "user_paid_playlists")
+@ApiModel("用户付费片单记录实体类")
+public class UserPaidPlaylistEntity {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @ApiModelProperty(value = "记录ID", example = "1")
+ private Long id;
+
+ @ApiModelProperty(value = "用户ID", example = "1001")
+ @Column(name = "user_id")
+ private Long userId;
+
+ @ApiModelProperty(value = "付费片单ID", example = "1")
+ @Column(name = "playlist_id")
+ private Long playlistId;
+
+ @TableField(fill = FieldFill.INSERT)
+ @ApiModelProperty(value = "付费时间", example = "2024-01-01 12:00:00")
+ private LocalDateTime paidAt;
+}
diff --git a/src/main/java/com/example/myproject/entity/Users.java b/src/main/java/com/example/myproject/entity/Users.java
index a9398cf..2a0e946 100644
--- a/src/main/java/com/example/myproject/entity/Users.java
+++ b/src/main/java/com/example/myproject/entity/Users.java
@@ -1,6 +1,7 @@
package com.example.myproject.entity;
import javax.persistence.*;
+import java.math.BigDecimal;
import java.util.Date;
@Entity
@@ -34,10 +35,10 @@
private Long level;
@Column(name = "upload_count")
- private Float uploadCount;
+ private Float uploadCount= 0f;
@Column(name = "download_count")
- private Float downloadCount;
+ private Float downloadCount= 0f;
@Column(name = "share_rate")
private Float shareRate;
@@ -77,14 +78,16 @@
@Column(name = "lastupdatetime")
private Date lastupdatetime;
- @Column(name = "money", nullable = false)
- private Integer money;
+ @Column(nullable = false,precision = 10, scale = 2)
+ private BigDecimal money;
+ @Column(name = "status")
+ private Integer status;// 用户状态,0: 正常 1 封禁 2 怀疑用户
// Getters and Setters
- public Integer getMoney() {
+ public BigDecimal getMoney() {
return money;
}
- public void setMoney(Integer money) {
+ public void setMoney(BigDecimal money) {
this.money = money;
}
@@ -264,4 +267,14 @@
public void setLastupdatetime(Date lastupdatetime) {
this.lastupdatetime = lastupdatetime;
}
+
+ public String getLevelRole() {
+ return switch (this.level.intValue()) {
+ case 1 -> "candy";
+ case 2 -> "cookie";
+ case 3 -> "chocolate";
+ case 4 -> "ice-cream";
+ default -> null;
+ };
+ }
}
\ No newline at end of file