Your Name 8 months ago
parent
commit
cf27a8dd2b

+ 0 - 14
app/Module/Fund/CoreService.php

@@ -1,14 +0,0 @@
-<?php
-
-namespace App\Module\Fund;
-
-
-class CoreService
-{
-
-    protected function getModuleName(): string
-    {
-        return 'Fund';
-    }
-
-}

+ 1 - 2
app/Module/Fund/Service/Circulation.php

@@ -3,7 +3,6 @@
 namespace App\Module\Fund\Service;
 
 
-use App\Module\Fund\CoreService;
 use App\Module\Fund\Models\FundCirculationModel;
 
 
@@ -12,7 +11,7 @@ use App\Module\Fund\Models\FundCirculationModel;
  *
  * @package logic\user\fund\Service
  */
-class Circulation extends CoreService
+class Circulation
 {
 
 

+ 1 - 2
app/Module/Fund/Service/Log.php

@@ -3,10 +3,9 @@
 namespace App\Module\Fund\Service;
 
 
-use App\Module\Fund\CoreService;
 use App\Module\Fund\Models\FundLogModel;
 
-class Log extends CoreService
+class Log
 {
 
     public function statistical($where)

+ 1 - 0
app/Module/Fund/Service/README.md

@@ -0,0 +1 @@
+# 逻辑层

+ 1 - 2
app/Module/Fund/Service/Transfer.php

@@ -3,7 +3,6 @@
 namespace App\Module\Fund\Service;
 
 
-use App\Module\Fund\CoreService;
 use App\Module\Fund\Models\FundTransferModel;
 use UCore\Trace;
 
@@ -12,7 +11,7 @@ use UCore\Trace;
  *
  * @package logic\user\fund\Service
  */
-class Transfer extends CoreService
+class Transfer
 {
 
     /**

+ 2 - 6
app/Module/Fund/Service/User.php

@@ -2,14 +2,10 @@
 
 namespace App\Module\Fund\Service;
 
-
-use App\Module\Fund\CoreService;
-use App\Module\Fund\Enums\FUND_TYPE;
 use App\Module\Fund\Enums\LOG_TYPE;
 use App\Module\Fund\Models\FundLogModel;
 use App\Module\Fund\Models\FundModel;
-use App\Module\Fund\Services\FundService;
-use App\Module\Ulogic\Model\WalletAddress;
+
 use UCore\Helper\Logger;
 
 /**
@@ -17,7 +13,7 @@ use UCore\Helper\Logger;
  *
  * @package App\Logic\Fund\Service
  */
-class User extends CoreService
+class User
 {
 
     /**

+ 1 - 3
app/Module/Fund/Services/CurrencyService.php

@@ -2,14 +2,12 @@
 
 namespace App\Module\Fund\Services;
 
-use App\Module\Fund\CoreService;
 use App\Module\Fund\Models\FundCurrencyModel;
-
 use App\Module\System\Services\ConfigService;
 
 
 
-class CurrencyService extends CoreService
+class CurrencyService
 {
 
 

+ 2 - 3
app/Module/Fund/Services/DtoService.php

@@ -3,17 +3,16 @@
 namespace App\Module\Fund\Services;
 
 
-use App\Module\Fund\CoreService;
 use App\Module\Fund\Dto\TransferDto;
 use App\Module\Fund\Service\User;
-use Fund\Fund;
+
 
 /**
  * Class Task
  *
  * @package App\Logic\Fund
  */
-class DtoService extends CoreService
+class DtoService
 {
 
 

+ 2 - 5
app/Module/Fund/Services/FundService.php

@@ -3,14 +3,11 @@
 namespace App\Module\Fund\Services;
 
 
-use App\Module\Fund\CoreService;
+
 use App\Module\Fund\Enums\FUND_TYPE;
 use App\Module\Fund\Enums\LOG_TYPE;
 use App\Module\Fund\Models\FundAdminModel;
-use App\Module\Fund\Models\FundLogModel;
 use App\Module\Fund\Models\FundModel;
-
-
 use App\Module\Fund\Service\Circulation;
 use App\Module\Fund\Service\Transfer;
 use App\Module\Fund\Service\User;
@@ -18,7 +15,7 @@ use Illuminate\Support\Facades\DB;
 use UCore\Db\Helper;
 
 
-class FundService extends CoreService
+class FundService
 {
 
     private int $userId;

+ 1 - 2
app/Module/Fund/Services/LogService.php

@@ -4,14 +4,13 @@
 namespace App\Module\Fund\Services;
 
 
-use App\Module\Fund\CoreService;
 use App\Module\Fund\Service\Log;
 
 /**
  * 日志服务
  *
  */
-class LogService extends CoreService
+class LogService
 {
 
 

+ 1 - 3
app/Module/Fund/Services/TaskService.php

@@ -2,8 +2,6 @@
 
 namespace App\Module\Fund\Services;
 
-
-use App\Module\Fund\CoreService;
 use App\Module\Fund\Service\User;
 
 /**
@@ -11,7 +9,7 @@ use App\Module\Fund\Service\User;
  *
  * @package App\Logic\Fund
  */
-class TaskService extends CoreService
+class TaskService
 {
 
 

+ 0 - 197
app/Module/Fund/迁移.md

@@ -1,197 +0,0 @@
-# Fund模块迁移文档
-
-## 目录结构迁移
-
-### 旧目录结构
-```
-app/Module/Fund1/
-├── ModelLaravel/          # 模型目录
-├── Enums/                 # 枚举目录
-├── Exception/             # 异常目录
-├── Item/                  # 数据项目录
-├── Model/                 # 模型目录
-├── Repositories/          # 仓库目录
-├── Service/               # 服务目录
-├── Validation/            # 验证规则目录
-├── Validator/             # 验证器目录
-├── constt/                # 常量目录
-└── 根目录文件
-```
-
-### 新目录结构
-```
-app/Module/Fund/
-├── Controllers/           # 控制器目录
-├── AdminControllers/      # 后台控制器目录
-├── Models/                # 模型目录
-├── Repositorys/           # 仓库目录
-├── Services/              # 服务目录
-├── Validators/            # 验证器目录
-├── Validations/           # 验证规则目录
-├── Enums/                 # 枚举目录
-├── Config/                # 配置目录
-├── Database/              # 数据库目录
-│   ├── Migrations/        # 迁移文件
-│   └── Seeders/          # 数据填充
-└── Tests/                 # 测试目录
-```
-
-## 命名空间迁移
-
-### 旧命名空间
-```php
-namespace Fund;
-namespace Fund\Enums;
-namespace Fund\Model;
-namespace Fund\ModelLaravel;
-namespace Fund\Repositories;
-namespace Fund\Service;
-namespace Fund\Validator;
-namespace Fund\Validation;
-namespace Fund\constt;
-```
-
-### 新命名空间
-```php
-namespace App\Module\Fund;
-namespace App\Module\Fund\Controllers;
-namespace App\Module\Fund\AdminControllers;
-namespace App\Module\Fund\Models;
-namespace App\Module\Fund\Repositorys;
-namespace App\Module\Fund\Services;
-namespace App\Module\Fund\Validators;
-namespace App\Module\Fund\Validations;
-namespace App\Module\Fund\Enums;
-```
-
-## 类名迁移
-
-### 核心类
-| 旧类名 | 新类名 | 说明 |
-|--------|--------|------|
-| `Fund\CoreService` | `App\Module\Fund\CoreService` | 核心服务基类 |
-| `Fund\CoreValidation` | 移除 | 功能合并到Validators |
-
-### 服务类
-| 旧类名 | 新类名 | 说明 |
-|--------|--------|------|
-| `Fund\Fund` | `App\Module\Fund\Services\FundService` | 资金服务 |
-| `Fund\Account` | `App\Module\Fund\Services\AccountService` | 账户服务 |
-| `Fund\Task` | `App\Module\Fund\Services\TaskService` | 任务服务 |
-| `Fund\Currency` | `App\Module\Fund\Services\CurrencyService` | 货币服务 |
-| `Fund\External` | `App\Module\Fund\Services\ExternalService` | 外部服务 |
-| `Fund\Order` | `App\Module\Fund\Services\OrderService` | 订单服务 |
-| `Fund\Rechange` | `App\Module\Fund\Services\RechangeService` | 充值服务 |
-| `Fund\Withdrawal` | `App\Module\Fund\Services\WithdrawalService` | 提现服务 |
-| `Fund\Settlement` | `App\Module\Fund\Services\SettlementService` | 结算服务 |
-
-### 模型类
-| 旧类名 | 新类名 | 说明 |
-|--------|--------|------|
-| `Fund\ModelLaravel\Fund` | `App\Module\Fund\Models\FundModel` | 资金模型 |
-| `Fund\ModelLaravel\FundLog` | `App\Module\Fund\Models\FundLogModel` | 资金日志模型 |
-| `Fund\ModelLaravel\FundOrder` | `App\Module\Fund\Models\FundOrderModel` | 资金订单模型 |
-| `Fund\ModelLaravel\FundAdmin` | `App\Module\Fund\Models\FundAdminModel` | 资金管理模型 |
-| `Fund\ModelLaravel\FundConfig` | `App\Module\Fund\Models\FundConfigModel` | 资金配置模型 |
-| `Fund\ModelLaravel\FundCurrency` | `App\Module\Fund\Models\FundCurrencyModel` | 货币模型 |
-| `Fund\ModelLaravel\FundExternal` | `App\Module\Fund\Models\FundExternalModel` | 外部资金模型 |
-
-### 验证器类
-| 旧类名 | 新类名 | 说明 |
-|--------|--------|------|
-| `Fund\Validator\UserFund1Check` | `App\Module\Fund\Validators\FundValidator::validateBalance` | 账户余额检查 |
-| `Fund\Validator\UserFundCheck1000` | `App\Module\Fund\Validators\FundValidator::validateBalance1000` | 1000倍数余额检查 |
-| `Fund\Validator\FundIdCheck` | `App\Module\Fund\Validators\FundValidator::validateFundId` | 资金ID检查 |
-
-### 枚举类
-| 旧类名 | 新类名 | 说明 |
-|--------|--------|------|
-| `Fund\Enums\Fund` | `App\Module\Fund\Enums\FundType` | 资金类型枚举 |
-| `Fund\Enums\FundCurrency` | `App\Module\Fund\Enums\FundCurrencyType` | 货币类型枚举 |
-| 新增 | `App\Module\Fund\Enums\ExternalStatus` | 外部状态枚举 |
-
-### 仓库类
-| 旧类名 | 新类名 | 说明 |
-|--------|--------|------|
-| `Fund\Repositories\Fund` | `App\Module\Fund\Repositorys\FundRepository` | 资金仓库 |
-| `Fund\Repositories\FundLog` | `App\Module\Fund\Repositorys\FundLogRepository` | 资金日志仓库 |
-| `Fund\Repositories\FundOrder` | `App\Module\Fund\Repositorys\FundOrderRepository` | 资金订单仓库 |
-
-## 数据库表
-
-保持不变的表:
-- `fund` - 资金表
-- `fund_log` - 资金日志表
-- `fund_order` - 资金订单表
-- `fund_admin` - 资金管理表
-- `fund_config` - 资金配置表
-- `fund_currency` - 货币表
-- `fund_external` - 外部资金表
-
-## 主要改进
-
-1. 规范化
-   - 统一命名空间为 `App\Module\Fund`
-   - 统一类名规范(添加Service/Model/Repository等后缀)
-   - 统一目录结构
-
-2. 功能优化
-   - 将验证器统一到 `FundValidator` 类
-   - 将服务类统一到 `Services` 目录
-   - 将模型类统一到 `Models` 目录
-   - 将仓库类统一到 `Repositorys` 目录
-
-3. 新增功能
-   - 添加事务管理 `TransactionManager`
-   - 完善外部资金处理
-   - 完善订单管理
-   - 添加缓存支持
-
-4. 文档完善
-   - 添加模块说明文档
-   - 添加迁移文档
-   - 完善代码注释 
-
-## 验证器类迁移
-旧命名空间:`namespace Fund\Validation;`
-新命名空间:`namespace App\Module\Fund\Validators;`
-
-| 旧类名 | 新类名 | 说明 |
-|--------|--------|------|
-| Circulation | CirculationValidator | 流转验证器 |
-| Transfer | TransferValidator | 转账验证器 |
-
-主要改进:
-1. 统一验证器命名规范,添加Validator后缀
-2. 完善验证逻辑,增加更多数据校验
-3. 添加查询参数验证方法
-4. 使用枚举类型进行资金类型验证 
-
-## 异常类迁移
-旧命名空间:`namespace Fund\Exception;`
-新命名空间:`namespace App\Module\Fund\Exceptions;`
-
-| 旧类名 | 新类名 | 说明 |
-|--------|--------|------|
-| DbException | DbException | 数据库操作异常类 |
-
-主要改进:
-1. 统一异常类命名空间
-2. 完善异常信息和文档注释
-3. 规范化异常处理机制
-
-## 数据传输对象(DTO)迁移
-旧命名空间:`namespace Fund\Item;`
-新命名空间:`namespace App\Module\Fund\Dto;`
-
-| 旧类名 | 新类名 | 说明 |
-|--------|--------|------|
-| Fund | FundDto | 资金数据传输对象 |
-| Tr | TransferDto | 转账数据传输对象 |
-| Withdrawal | WithdrawalDto | 提现数据传输对象 |
-
-主要改进:
-1. 将Item类重构为DTO类,更符合设计模式
-2. 添加类型声明和属性注释
-3. 统一数据转换方法
-4. 增加数据验证和默认值处理