# assignment2 **Repository Path**: tumsJ/assignment2 ## Basic Information - **Project Name**: assignment2 - **Description**: springboot分布式框架作业二 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-28 - **Last Updated**: 2025-04-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 银行账户微服务(Accounts Service) 这是一个基于Spring Boot的银行账户微服务应用程序,实现了账户管理和交易记录功能。 ## 功能特点 - 账户管理:创建和查询银行账户 - 交易记录:支持存款、取款、转账和付款等多种交易类型 - 按条件查询:根据手机号和交易类型查询当日交易记录 ## 技术栈 - Spring Boot 3.x - Spring Data JPA - H2内存数据库 - Lombok - Maven ## 如何运行 1. 确保您已安装JDK 17及以上版本 2. 克隆本仓库 3. 执行以下命令: ```bash mvn spring-boot:run ``` 4. 应用程序将在 http://localhost:8080 上运行 5. H2数据库控制台可通过 http://localhost:8080/h2-console 访问 ## API端点 ### 查询交易记录 ``` GET /api/transactions/search?phoneNumber={phoneNumber}&type={type}&date={date} ``` - `phoneNumber`: 客户手机号 - `type`: 交易类型(DEPOSIT, WITHDRAWAL, TRANSFER, PAYMENT) - `date`: 查询日期,格式为ISO日期格式 (例如: 2023-06-01) ### 创建交易记录 ``` POST /api/transactions ``` 请求体示例: ```json { "accountNumber": "ACC001", "amount": 1000.00, "description": "工资存入", "type": "DEPOSIT" } ``` ## 数据库架构 应用程序包含以下主要实体: - `Customer`: 客户信息 - `Account`: 银行账户 - `Transaction`: 交易记录,包含交易类型、金额、日期等信息 os