实体类实现

This commit is contained in:
myh 2023-10-06 23:31:42 +08:00
parent 8a7741c9f2
commit 6042dd1c44
5 changed files with 95 additions and 16 deletions

View File

@ -1,16 +0,0 @@
package com.example.springdemo.entities;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Business {
private String name;
private String tel;
private String address;
}

View File

@ -0,0 +1,24 @@
package com.example.springdemo.entities;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
//订单类
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Indent {
private Long id;//订单ID
private Float allPrice;//菜品总价
Date createdDate;//订单创建时间
private String message;//下单备注
private Users userID;//外键下单用户ID
private Merchants merchantsID;//外键餐厅ID
}

View File

@ -0,0 +1,22 @@
package com.example.springdemo.entities;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
//订单中的菜品
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class IndentItem {
private Long id;//主键菜品ID
private String name;//菜品名字
private Float initialPrice;//菜品原价
private Float discount;//折扣
private Float finalPrice;//最终价格
private String description;//菜品描述
private Indent indentID;//外键订单ID
}

View File

@ -0,0 +1,30 @@
package com.example.springdemo.entities;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.*;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "Merchants")
public class Merchants {
@Id
private Long id;//主键,商家编号
private String name;//店铺名字
private String address;//店铺地址
private String description;//店铺描述
@Column(name = "phoneNumber")
private String phoneNumber;//商家联系方式
}

View File

@ -0,0 +1,19 @@
package com.example.springdemo.entities;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
//用户类
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Users {
private Long id;//主键用户ID
private String name;//用户姓名
private String phoneNumber;//用户联系方式
private String address;//家庭住址
private String password;//用户密码
}