实体类
This commit is contained in:
parent
5b20bb97ad
commit
5e762f2067
|
@ -10,5 +10,5 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
*/
|
||||
@RestController
|
||||
@Api(tags = "商家模块")
|
||||
public class BusinessController {
|
||||
public class ShopController {
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package com.example.takeawaysystemserver.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author Ethereal
|
||||
* @date 2024/7/7
|
||||
* @description
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "购物车模块")
|
||||
public class ShoppingCartController {
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.example.takeawaysystemserver.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Ethereal
|
||||
* @date 2024/7/7
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Business {
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.example.takeawaysystemserver.entity;
|
||||
|
||||
import jakarta.annotation.Nullable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Ethereal
|
||||
* @date 2024/7/7
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Dish {
|
||||
private String id;
|
||||
private String shopId;
|
||||
/**
|
||||
* 分类名
|
||||
*/
|
||||
private String group;
|
||||
private String name;
|
||||
/**
|
||||
* 价格(分)
|
||||
*/
|
||||
private Integer price;
|
||||
private Integer sellCount;
|
||||
@Nullable
|
||||
private String image;
|
||||
/**
|
||||
* [key: 类型,如“辣度选择”] : [value: 子选项,如["微辣"]]
|
||||
*/
|
||||
@Nullable
|
||||
private Map<String, String[]> subOptions;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.example.takeawaysystemserver.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Ethereal
|
||||
* @date 2024/7/7
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Food {
|
||||
}
|
|
@ -4,6 +4,8 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Ethereal
|
||||
* @date 2024/7/7
|
||||
|
@ -13,4 +15,21 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Order {
|
||||
private String id;
|
||||
private String userId;
|
||||
private String shopId;
|
||||
private List<OrderItem> items;
|
||||
private Integer price;
|
||||
/**
|
||||
* - 0 已取消
|
||||
* - 1 配送中
|
||||
* - 2 已完成
|
||||
*/
|
||||
private Integer status;
|
||||
private String address;
|
||||
/**
|
||||
* Unix 时间戳
|
||||
*/
|
||||
private Long createTime;
|
||||
private Long updateTime;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package com.example.takeawaysystemserver.entity;
|
||||
|
||||
import jakarta.annotation.Nullable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author spyn
|
||||
* @date 2024/7/10
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrderItem {
|
||||
private String dishId;
|
||||
@Nullable
|
||||
private Dish dish;
|
||||
private String orderId;
|
||||
private Integer count;
|
||||
private Integer price;
|
||||
/**
|
||||
* [key: 类型,如“辣度选择”] : [value: 子选项,如"微辣"]
|
||||
* 注意这里value是String,而不是String[],和Dish中的subOptions不同
|
||||
*/
|
||||
@Nullable
|
||||
private Map<String, String> options;
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.example.takeawaysystemserver.entity;
|
||||
|
||||
import jakarta.annotation.Nullable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Ethereal
|
||||
* @date 2024/7/7
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Shop {
|
||||
private String id;
|
||||
private String name;
|
||||
private Float point;
|
||||
private Integer sellCount;
|
||||
/**
|
||||
* - 0 被删除
|
||||
* - 1 营业中
|
||||
* - 2 休息中
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 格式为HH:mm:ss
|
||||
*/
|
||||
private String openTime;
|
||||
private String closeTime;
|
||||
private String address;
|
||||
@Nullable
|
||||
private List<Dish> displayedDishes;
|
||||
@Nullable
|
||||
private String image;
|
||||
/**
|
||||
* [key: 分类名] : [value: 菜品列表]
|
||||
*/
|
||||
@Nullable
|
||||
private Map<String, Dish[]> groups;
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.example.takeawaysystemserver.entity;
|
||||
|
||||
import jakarta.annotation.Nullable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -13,5 +14,17 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class User {
|
||||
|
||||
private String id;
|
||||
private String username;
|
||||
@Nullable
|
||||
private String password;
|
||||
private String phone;
|
||||
@Nullable
|
||||
private String address;
|
||||
/**
|
||||
* - 0:被删除
|
||||
* - 1:正常
|
||||
* - 2:被封禁
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.example.takeawaysystemserver.model.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author spyn
|
||||
* @date 2024/7/10
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ShoppingCart {
|
||||
// 不需要用户ID,用户信息从token中获取
|
||||
private String shopId;
|
||||
private ShoppingCartItem[] dishes;
|
||||
// 用户地址,用户可能会修改地址,故以该字段为准
|
||||
private String address;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.example.takeawaysystemserver.model.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author spyn
|
||||
* @date 2024/7/10
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ShoppingCartItem {
|
||||
private String dishId;
|
||||
private Integer count;
|
||||
/**
|
||||
* [key: 类型,如“辣度选择”] : [value: 子选项,如"微辣"]
|
||||
* 注意这里value是String,而不是String[],和Dish中的subOptions不同
|
||||
*/
|
||||
private Map<String, String> subOptions;
|
||||
}
|
Loading…
Reference in New Issue