diff --git a/dao/src/main/java/cn/bunny/entity/order/Order.java b/dao/src/main/java/cn/bunny/entity/order/Order.java new file mode 100644 index 0000000..4afc904 --- /dev/null +++ b/dao/src/main/java/cn/bunny/entity/order/Order.java @@ -0,0 +1,41 @@ +package cn.bunny.entity.order; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + *
+ * + *
+ * + * @author order + * @since 2024-07-29 + */ +@Getter +@Setter +@Accessors(chain = true) +@TableName("t_order") +@ApiModel(value = "Order对象", description = "") +public class Order implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private String orderNo; + + private Long userId; + + private BigDecimal amount; +} diff --git a/service/src/main/java/cn/bunny/service/controller/OrderController.java b/service/src/main/java/cn/bunny/service/controller/OrderController.java new file mode 100644 index 0000000..910b923 --- /dev/null +++ b/service/src/main/java/cn/bunny/service/controller/OrderController.java @@ -0,0 +1,38 @@ +package cn.bunny.service.controller; + +import cn.bunny.entity.order.Order; +import cn.bunny.pojo.result.Result; +import cn.bunny.service.service.OrderService; +import cn.bunny.vo.page.PageResult; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *+ * 前端控制器 + *
+ * + * @author order + * @since 2024-07-29 + */ +@Tag(name = "订单表") +@RestController +@RequestMapping("/api/order") +public class OrderController { + @Autowired + private OrderService orderService; + + @Operation(summary = "分页查询订单", description = "分页查询订单") + @GetMapping("queryPage/{page}/{limit}") + public Result+ * Mapper 接口 + *
+ * + * @author order + * @since 2024-07-29 + */ +@Mapper +public interface OrderMapper extends BaseMapper+ * 服务类 + *
+ * + * @author order + * @since 2024-07-29 + */ +public interface OrderService extends IService+ * 服务实现类 + *
+ * + * @author order + * @since 2024-07-29 + */ +@Service +public class OrderServiceImpl extends ServiceImpl