findme-backend-merchant-java/src/main/java/com/xjhs/findmemerchant/entity/ReviewReply.java
2026-01-09 12:20:24 +08:00

78 lines
1.8 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.xjhs.findmemerchant.entity;
import com.xjhs.findmemerchant.adapter.id.SnowflakeGenerated;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Comment;
/**
* 商家对评价的回复
* 对应表review_replies
*/
@Getter
@Setter
@Entity
@Table(
name = "review_replies",
uniqueConstraints = {
@UniqueConstraint(name = "uk_review_replies_review_id", columnNames = "review_id")
},
indexes = {
@Index(name = "idx_review_replies_merchant_id", columnList = "merchant_id")
}
)
public class ReviewReply{
/**
* 主键雪花ID
*/
@Id
@GeneratedValue
@SnowflakeGenerated
@Column(nullable = false)
@Comment("主键ID")
private Long id;
/**
* 评价ID唯一一个评价一条回复
*/
@Column(name = "review_id", nullable = false)
@Comment("评价ID")
private Long reviewId;
/**
* 商户ID
*/
@Column(name = "merchant_id", nullable = false)
@Comment("商户ID")
private Long merchantId;
/**
* 回复内容
*/
@Column(name = "content", nullable = false, columnDefinition = "text")
@Comment("回复内容")
private String content;
/**
* 回复人ID商家或员工
*/
@Column(name = "replier_id", nullable = false)
@Comment("回复人ID商家或员工")
private Long replierId;
/**
* 回复人名称
*/
@Column(name = "replier_name", length = 50)
@Comment("回复人名称")
private String replierName;
/**
* 所属评价
*/
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "review_id", insertable = false, updatable = false)
private Review review;
}