### GET /getGoodsDetail.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Retrieves detailed information for a specific product by its ID. ```APIDOC ## GET /getGoodsDetail.action ### Description Fetches full product details including name, description, attributes, images, and category info. ### Method GET ### Endpoint /OSS/getGoodsDetail.action ### Parameters #### Query Parameters - **goodsId** (string) - Required - Unique identifier for the product ### Response #### Success Response (200) - **goodsName** (string) - Name of the product - **goodsDescribe** (string) - Product description - **attributes** (array) - List of product variations - **images** (array) - List of image URLs #### Response Example { "goodsId": "123", "goodsName": "iPhone 13", "goodsDescribe": "Apple最新款智能手机", "attributes": [{"attributeId": "1", "attributeName": "颜色", "attributeValue": "黑色"}], "images": ["uploads/goods/123/1.jpg"] } ``` -------------------------------- ### GET /getShopInfo.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Retrieves detailed information for the currently logged-in seller's shop, including evaluation data and announcements. ```APIDOC ## GET /getShopInfo.action ### Description Retrieves detailed information for the currently logged-in seller's shop, including evaluation data and announcements. ### Method GET ### Endpoint /OSS/getShopInfo.action ### Response #### Success Response (200) - **shopId** (integer) - The ID of the shop. - **userId** (integer) - The ID of the user who owns the shop. - **shopName** (string) - The name of the shop. - **address** (string) - The address of the shop. - **phone** (string) - The contact phone number. - **shopDescribe** (string) - A description of the shop. - **announcement** (string) - The shop's announcement. - **applyStatus** (string) - The approval status of the shop (e.g., "approved"). - **evaluateSum** (integer) - The total sum of evaluations. - **evaluateNumber** (integer) - The total number of evaluations. #### Response Example ```json { "shopId": 30, "userId": 5, "shopName": "数码旗舰店", "address": "北京市海淀区", "phone": "13800138000", "shopDescribe": "专营正品数码产品", "announcement": "双十一全场8折!", "applyStatus": "approved", "evaluateSum": 4500, "evaluateNumber": 1000 } ``` ``` -------------------------------- ### GET /getShoppingCart.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Retrieves all items currently in the user's shopping cart, grouped by shop. ```APIDOC ## GET /getShoppingCart.action ### Description Fetches the contents of the shopping cart for the authenticated user, organized by shop. ### Method GET ### Endpoint /OSS/getShoppingCart.action ### Response #### Success Response (200) - **shopId** (string) - ID of the shop - **shopName** (string) - Name of the shop - **goodsInSC** (array) - List of items in the cart for this shop #### Response Example [ { "shopId": "30", "shopName": "数码旗舰店", "goodsInSC": [{"goodsName": "iPhone 13", "goodsNum": "2"}] } ] ``` -------------------------------- ### GET /getOrderByStatus.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Retrieves a paginated list of orders for the current user based on their status. ```APIDOC ## GET /getOrderByStatus.action ### Description Retrieves a paginated list of orders for the current user based on their status. ### Method GET ### Endpoint /OSS/getOrderByStatus.action ### Parameters #### Query Parameters - **orderStatus** (string) - Required - The status of the orders to query (e.g., "Pending Payment", "Pending Shipment", "Pending Receipt", "Completed"). - **maxNumInOnePage** (string) - Required - The number of items to display per page. - **pageNum** (string) - Required - The page number (starting from 0). ### Request Example ``` http://localhost:8080/OSS/getOrderByStatus.action?orderStatus=待发货&maxNumInOnePage=10&pageNum=0 ``` ### Response #### Success Response (200) - **orderId** (string) - The ID of the order. - **orderStatus** (string) - The status of the order. - **total** (string) - The total amount of the order. #### Response Example ```json [ { "orderId": "12345", "orderStatus": "待发货", "total": "199.99" } ] ``` ``` -------------------------------- ### GET /getHistoryOrder.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Enables merchants to retrieve a paginated list of completed historical orders for their shop. ```APIDOC ## GET /getHistoryOrder.action ### Description Retrieves a paginated list of historical completed orders for the merchant's shop. ### Method GET ### Endpoint /OSS/getHistoryOrder.action ### Parameters #### Query Parameters - **page** (integer) - Required - Page number starting from 0 ### Response #### Success Response (200) - **orders** (array) - List of order objects #### Response Example [ { "orderId": "0000000000000001", "userId": 10, "shopId": 30, "orderStatus": "已完成", "total": 5999.00 } ] ``` -------------------------------- ### GET /GetUnsolvedTransaction.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Retrieves a list of all unresolved user complaints and dispute transactions within the system. ```APIDOC ## GET /GetUnsolvedTransaction.action ### Description Fetches a list of all pending user complaints and disputes requiring administrative attention. ### Method GET ### Endpoint /OSS/GetUnsolvedTransaction.action ### Response #### Success Response (200) - **transactions** (array) - List of unresolved transaction objects #### Response Example [ { "transactionId": 1, "orderId": "0000000000000001", "comment": "商品与描述不符", "status": "pending" } ] ``` -------------------------------- ### Get Shop Information API Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Retrieves the detailed profile of the currently logged-in merchant's shop, including evaluation metrics and announcements. ```javascript $.ajax({ url: '/OSS/getShopInfo.action', type: 'GET', dataType: 'json', success: function(shop) { console.log('店铺ID:', shop.shopId); console.log('店铺名称:', shop.shopName); console.log('店铺描述:', shop.shopDescribe); console.log('店铺公告:', shop.announcement); console.log('评价总分:', shop.evaluateSum); console.log('评价数量:', shop.evaluateNumber); console.log('审核状态:', shop.applyStatus); } }); ``` ```bash curl "http://localhost:8080/OSS/getShopInfo.action" -b cookies.txt ``` -------------------------------- ### Get Pending Transactions (JavaScript/curl) Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Retrieves a list of all unresolved user complaints and dispute transactions within the system. The API returns transaction details in JSON format. ```javascript $.ajax({ url: '/OSS/GetUnsolvedTransaction.action', type: 'GET', dataType: 'json', success: function(transactions) { transactions.forEach(function(t) { console.log('事务ID:', t.transactionId); console.log('订单ID:', t.orderId); console.log('用户备注:', t.comment); console.log('状态:', t.status); }); } }); ``` ```curl curl "http://localhost:8080/OSS/GetUnsolvedTransaction.action" -b admin_cookies.txt ``` -------------------------------- ### Get Historical Orders (JavaScript/curl) Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Enables merchants to retrieve a paginated list of their historical completed orders. The API accepts a page number and returns order data in JSON format. ```javascript function loadHistoryOrders(pageNum) { $.ajax({ url: '/OSS/getHistoryOrder.action', type: 'GET', data: { page: pageNum }, dataType: 'json', success: function(orders) { orders.forEach(function(order) { console.log('订单ID:', order.orderId); console.log('用户ID:', order.userId); console.log('订单状态:', order.orderStatus); console.log('订单金额:', order.total); console.log('下单时间:', order.orderTime); }); } }); } ``` ```curl curl "http://localhost:8080/OSS/getHistoryOrder.action?page=0" -b cookies.txt ``` -------------------------------- ### Execute Database Queries with DBUtil Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Demonstrates how to use the DBUtil utility class to establish a connection and execute a PreparedStatement query. It includes proper resource management by closing the ResultSet, PreparedStatement, and Connection in a finally block. ```java import com.groupnine.oss.util.DBUtil; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; public class Example { public void queryExample() { Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; try { conn = DBUtil.getConnection(); String sql = "SELECT * FROM goods WHERE goods_id = ?"; pstmt = conn.prepareStatement(sql); pstmt.setInt(1, 123); rs = pstmt.executeQuery(); while (rs.next()) { System.out.println("商品名: " + rs.getString("goods_name")); } } catch (Exception e) { e.printStackTrace(); } finally { if (rs != null) try { rs.close(); } catch (Exception e) {} if (pstmt != null) try { pstmt.close(); } catch (Exception e) {} if (conn != null) try { conn.close(); } catch (Exception e) {} } } } ``` -------------------------------- ### POST /addNewUser.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Registers a new user account in the system. ```APIDOC ## POST /addNewUser.action ### Description Creates a new user account. Validates the uniqueness of the username and phone number. ### Method POST ### Endpoint /OSS/addNewUser.action ### Parameters #### Request Body - **username** (string) - Required - Unique username - **phone** (string) - Required - Unique phone number - **password** (string) - Required - User password ### Request Example { "username": "newuser", "phone": "13800138000", "password": "securepass123" } ### Response #### Success Response (200) - **result** (boolean) - Registration status ``` -------------------------------- ### POST /AdminLogin.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Authenticates system administrators and establishes a session for management access. ```APIDOC ## POST /AdminLogin.action ### Description Authenticates the system administrator and creates a session upon success. ### Method POST ### Endpoint /OSS/AdminLogin.action ### Parameters #### Request Body - **form-AdminId** (number) - Required - Administrator ID - **form-password** (string) - Required - Password ### Response #### Success Response (302) - Redirects to management dashboard ``` -------------------------------- ### POST /addGoods.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Allows merchants to add new products to their shop, including support for uploading multiple product images. ```APIDOC ## POST /addGoods.action ### Description Merchants add new products to the shop, supporting multiple image uploads via multipart/form-data. ### Method POST ### Endpoint /OSS/addGoods.action ### Parameters #### Request Body - **goodsName** (string) - Required - Name of the product - **goodsDescribe** (string) - Required - Description of the product - **firstCategory** (string) - Optional - Primary category - **secondCategory** (string) - Optional - Secondary category - **file** (file) - Optional - Product image files ### Request Example Content-Type: multipart/form-data ### Response #### Success Response (200) - **goodsId** (string) - The ID of the newly created product #### Response Example "1001" ``` -------------------------------- ### POST /checkUserLogin.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Validates user credentials and establishes a session for the authenticated user. ```APIDOC ## POST /checkUserLogin.action ### Description Validates the user's login credentials (username/phone and password). Upon success, it creates a session and stores user information. ### Method POST ### Endpoint /OSS/checkUserLogin.action ### Parameters #### Request Body - **username** (string) - Optional - Username (required if phone is not provided) - **phone** (string) - Optional - Phone number (required if username is not provided) - **password** (string) - Required - User password ### Request Example { "username": "zhangsan", "password": "password123" } ### Response #### Success Response (200) - **status** (string) - Login success status #### Response Example { "status": "success" } ``` -------------------------------- ### POST /registerShop.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Allows a regular user to apply for a shop registration by submitting basic shop information for review. ```APIDOC ## POST /registerShop.action ### Description Allows a regular user to apply for a shop registration by submitting basic shop information for review. ### Method POST ### Endpoint /OSS/registerShop.action ### Parameters #### Request Body - **shopName** (string) - Required - The name of the shop. - **address** (string) - Required - The address of the shop. - **phone** (string) - Required - The contact phone number. - **shopDescribe** (string) - Optional - A description of the shop. ### Request Example ```html
``` ### Response #### Success Response (200) Redirects to the seller registration result page. ``` -------------------------------- ### Retrieve Product Details Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Fetches comprehensive product information including attributes, images, and discount data based on a unique goodsId. ```javascript $.ajax({ url: '/OSS/getGoodsDetail.action', type: 'GET', data: { goodsId: '123' }, dataType: 'json', success: function(detail) { console.log('Product Name:', detail.goodsName); } }); ``` ```bash curl "http://localhost:8080/OSS/getGoodsDetail.action?goodsId=123" ``` -------------------------------- ### Add New Product with Images (Java/JavaScript/curl) Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Allows merchants to add new products to their store, including uploading product images. Supports multiple image uploads. The API expects multipart/form-data and returns the newly created product ID. ```javascript function addGoods() { var formData = new FormData(); formData.append('goodsName', 'iPhone 14 Pro'); formData.append('goodsDescribe', '最新款iPhone,搭载A16芯片'); formData.append('firstCategory', '电器'); formData.append('secondCategory', '手机'); var fileInput = document.getElementById('goodsImages'); for (var i = 0; i < fileInput.files.length; i++) { formData.append('file', fileInput.files[i]); } $.ajax({ url: '/OSS/addGoods.action', type: 'POST', data: formData, processData: false, contentType: false, success: function(goodsId) { console.log('新商品ID:', goodsId); window.location.href = '/OSS/pages/home/addGoodsAttr.jsp?goodsId=' + goodsId; } }); } ``` ```curl curl -X POST "http://localhost:8080/OSS/addGoods.action" \ -F "goodsName=iPhone 14 Pro" \ -F "goodsDescribe=最新款iPhone" \ -F "firstCategory=电器" \ -F "secondCategory=手机" \ -F "file=@/path/to/image1.jpg" \ -F "file=@/path/to/image2.jpg" \ -b cookies.txt ``` -------------------------------- ### POST /addToShoppingCart.action Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Adds a specific product variant to the user's shopping cart. ```APIDOC ## POST /addToShoppingCart.action ### Description Adds a product to the current user's shopping cart based on goods ID, attribute ID, and quantity. ### Method POST ### Endpoint /OSS/addToShoppingCart.action ### Parameters #### Request Body - **goodsId** (string) - Required - ID of the product - **attributeId** (string) - Required - ID of the specific product attribute - **goodsNum** (integer) - Required - Quantity to add ### Response #### Success Response (200) - **result** (boolean) - Success status ``` -------------------------------- ### User Registration Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Registers a new user by validating unique credentials. Successful registration automatically logs the user in and redirects to the homepage. ```html ``` ```bash curl -X POST "http://localhost:8080/OSS/addNewUser.action" \ -d "username=newuser&phone=13800138000&password=securepass123" \ -c cookies.txt -L ``` -------------------------------- ### Configure Database Connection via XML Source: https://context7.com/c-rainstorm/onlineshoppingsystem/llms.txt Defines the database connection parameters including driver, host, port, credentials, and schema name. This file is located at WebContent/config/database-config.xml and is used by the system to initialize the connection pool. ```xml