实体类实现
This commit is contained in:
parent
8a7741c9f2
commit
6042dd1c44
@ -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;
|
||||
}
|
24
src/main/java/com/example/springdemo/entities/Indent.java
Normal file
24
src/main/java/com/example/springdemo/entities/Indent.java
Normal 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
|
||||
}
|
@ -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
|
||||
}
|
30
src/main/java/com/example/springdemo/entities/Merchants.java
Normal file
30
src/main/java/com/example/springdemo/entities/Merchants.java
Normal 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;//商家联系方式
|
||||
|
||||
}
|
19
src/main/java/com/example/springdemo/entities/Users.java
Normal file
19
src/main/java/com/example/springdemo/entities/Users.java
Normal 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;//用户密码
|
||||
}
|
Loading…
Reference in New Issue
Block a user