实体类

This commit is contained in:
石皮幼鸟 2024-07-10 11:17:34 +08:00
parent 5b20bb97ad
commit 5e762f2067
12 changed files with 194 additions and 48 deletions

View File

@ -10,5 +10,5 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@Api(tags = "商家模块")
public class BusinessController {
public class ShopController {
}

View File

@ -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 {
}

View File

@ -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 {
}

View File

@ -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;
}

View File

@ -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 {
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}