You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.shanzhu.flower.service;
import com.shanzhu.flower.entity.Cart;
import com.shanzhu.flower.entity.Order;
import java.util.List;
/**
* 订单 服务层
* 定义了订单相关的业务逻辑接口,包括添加订单、删除订单、更新订单状态,以及查询订单。
*
* @author: ShanZhu
* @date: 2024-01-24
*/
public interface OrderService {
//
// 添加订单
// 将购物车中的商品转换为订单并插入到数据库中。
// 如果购物车中的商品已存在订单中,则更新订单数量。
//
// @param cart 购物车对象,包含商品信息和用户账号
// @return 添加结果成功返回1失败返回0
//
int add(Cart cart);
//
// 删除订单
// 根据用户ID删除所有订单。
//
// @param uid 用户ID
// @return 删除结果成功返回1失败返回0
//
int delete(int uid);
//
// 更新订单
// 更新订单的状态或其他信息。
//
// @param order 订单对象,包含需要更新的订单信息
// @return 更新结果成功返回1失败返回0
//
int update(Order order);
//
// 根据搜索关键词和用户账号查询订单
// 查询订单中商品名称包含指定搜索关键词的记录,并且属于指定用户账号。
//
// @param searchKey 搜索关键词
// @param account 用户账号
// @return 订单记录列表
//
List<Order> find(String searchKey, String account);
//
// 根据搜索关键词查询所有订单
// 查询所有订单中商品名称包含指定搜索关键词的记录。
//
// @param searchKey 搜索关键词
// @return 订单记录列表
//
List<Order> findAll(String searchKey);
// /**
// 根据用户账号查询订单
// 查询指定用户账号的所有订单。
//
// @param account 用户账号
// @return 订单记录列表
//
List<Order> queryByAccount(String account);
}