更换model目录
This commit is contained in:
@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Cache\Base;
|
||||
|
||||
use App\Models\Follow\FollowModel;
|
||||
|
||||
//用户缓存用户基础信息(等于数据表)primary_key为主键
|
||||
abstract class TableBaseCache extends BaseCache
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
namespace App\Cache\Struct;
|
||||
|
||||
use App\Cache\Base\StructBaseCache;
|
||||
use App\Models\Customer\CustomerUserExtendModel;
|
||||
use App\Models\Api\Customer\CustomerUserExtendModel;
|
||||
|
||||
//用户缓存用户基础信息(结构自己组装不完全等于数据表)primary_key为主键
|
||||
class StructUserCommonCacheUid extends StructBaseCache
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
namespace App\Cache\Table;
|
||||
|
||||
use App\Cache\Base\TableBaseCache;
|
||||
use App\Models\Customer\CustomerUserModel;
|
||||
use App\Models\Api\Customer\CustomerUserModel;
|
||||
|
||||
//用户缓存用户基础信息(结构自己组装不完全等于数据表)uid为主键
|
||||
class TableCustomerUserCache extends TableBaseCache
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Customer\CustomerUserExtendModel;
|
||||
use App\Models\Api\Customer\CustomerUserExtendModel;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class DailyCheckUserActiveStatus extends Command
|
||||
|
||||
@ -6,7 +6,7 @@ use App\Const\Im;
|
||||
use App\Const\VrCode;
|
||||
use App\Exceptions\AppException;
|
||||
use App\Http\Controllers\Base\CustomerBaseController;
|
||||
use App\Models\Customer\CustomerUserModel;
|
||||
use App\Models\Api\Customer\CustomerUserModel;
|
||||
use App\Service\AuthService;
|
||||
use App\Service\ImService;
|
||||
use App\Service\VrCodeService;
|
||||
|
||||
@ -5,8 +5,7 @@ namespace App\Http\Controllers\Follow;
|
||||
|
||||
use App\Exceptions\ModelException;
|
||||
use App\Http\Controllers\Base\BaseController;
|
||||
use App\Models\Follow\FollowHistoryModel;
|
||||
use App\Models\Follow\FollowModel;
|
||||
use App\Models\Api\Follow\FollowModel;
|
||||
use App\Service\AuthService;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
namespace App\Http\Controllers\Post;
|
||||
|
||||
use App\Http\Controllers\Base\BaseController;
|
||||
use App\Models\Post\PostModel;
|
||||
use App\Models\Post\PostPushBoxModel;
|
||||
use App\Service\AuthService;
|
||||
|
||||
class PostController extends BaseController
|
||||
@ -29,11 +27,11 @@ class PostController extends BaseController
|
||||
'content',
|
||||
'media',
|
||||
]);
|
||||
if (!in_array($aParams['type'], [PostModel::TYPE_POST, PostModel::TYPE_REPOST])) return $this->error('type params error');
|
||||
if (!in_array($aParams['type'], [\App\Models\Api\Post\PostModel::TYPE_POST, \App\Models\Api\Post\PostModel::TYPE_REPOST])) return $this->error('type params error');
|
||||
|
||||
$oAuthService = new AuthService();
|
||||
$aUser = $oAuthService->getCurrentUser();
|
||||
$oFollowModel = new PostModel();
|
||||
$oFollowModel = new \App\Models\Api\Post\PostModel();
|
||||
$aParams['uid'] = $aUser['id'];
|
||||
|
||||
$oFollowModel->addBatchPost([$aParams]);
|
||||
@ -49,7 +47,7 @@ class PostController extends BaseController
|
||||
]);
|
||||
$oAuthService = new AuthService();
|
||||
$aUser = $oAuthService->getCurrentUser();
|
||||
$oPostModel = new PostPushBoxModel();
|
||||
$oPostModel = new \App\Models\Api\Post\PostPushBoxModel();
|
||||
$aPostList = $oPostModel->getPushBoxList($aUser['id'],$aParams['lastId']??0,$aParams['limit']??15);
|
||||
return $this->success($aPostList);
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ namespace App\Http\Controllers\Sms;
|
||||
use App\Const\VrCode;
|
||||
use App\Exceptions\AppException;
|
||||
use App\Http\Controllers\Base\CustomerBaseController;
|
||||
use App\Models\Customer\CustomerUserModel;
|
||||
use App\Models\Api\Customer\CustomerUserModel;
|
||||
use App\Service\AuthService;
|
||||
use App\Service\VrCodeService;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
@ -3,11 +3,10 @@
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Const\Responses;
|
||||
use App\Models\Customer\CustomerUserModel;
|
||||
use App\Models\Api\Customer\CustomerUserModel;
|
||||
use App\Service\AuthService;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class AuthMiddleware
|
||||
|
||||
@ -3,9 +3,8 @@
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Exceptions\ModelException;
|
||||
use App\Models\Post\PostPushBoxModel;
|
||||
use App\Models\Api\Post\PostPushBoxModel;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
|
||||
@ -2,9 +2,8 @@
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\Customer\CustomerUserExtendModel;
|
||||
use App\Models\Api\Customer\CustomerUserExtendModel;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
|
||||
9
app/Models/Api/Base/ApiBaseModel.php
Normal file
9
app/Models/Api/Base/ApiBaseModel.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Api\Base;
|
||||
|
||||
use App\Models\Base\BaseModel;
|
||||
|
||||
class ApiBaseModel extends BaseModel {
|
||||
|
||||
}
|
||||
@ -1,11 +1,10 @@
|
||||
<?php
|
||||
namespace App\Models\Comment;
|
||||
namespace App\Models\Api\Comment;
|
||||
|
||||
use App\Exceptions\ModelException;
|
||||
use App\Models\Base\BaseModel;
|
||||
use App\Models\Api\Base\ApiBaseModel;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class PostCommentModel extends BaseModel
|
||||
class PostCommentModel extends ApiBaseModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $table = 'customer_post_comment';
|
||||
@ -1,14 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Customer;
|
||||
namespace App\Models\Api\Customer;
|
||||
|
||||
use App\Cache\Table\TableCustomerUserCache;
|
||||
use App\Models\Base\CustomerBaseModel;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use App\Models\Api\Base\ApiBaseModel;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class CustomerChangeInfoLogModel extends CustomerBaseModel
|
||||
class CustomerChangeInfoLogModel extends ApiBaseModel
|
||||
{
|
||||
protected $table = 'customer_change_info_log';
|
||||
protected $primaryKey = 'id';
|
||||
19
app/Models/Api/Customer/CustomerLoginHistoryModel.php
Normal file
19
app/Models/Api/Customer/CustomerLoginHistoryModel.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Api\Customer;
|
||||
|
||||
use App\Models\Api\Base\ApiBaseModel;
|
||||
|
||||
class CustomerLoginHistoryModel extends ApiBaseModel
|
||||
{
|
||||
protected $table = 'customer_login_history';
|
||||
protected $primaryKey = 'id';
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'status',
|
||||
'uid',
|
||||
'device',
|
||||
'created_at',
|
||||
];
|
||||
|
||||
}
|
||||
@ -1,19 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Customer;
|
||||
namespace App\Models\Api\Customer;
|
||||
|
||||
use App\Const\Queue;
|
||||
use App\Exceptions\ModelException;
|
||||
use App\Jobs\UserActiveStatusQueue;
|
||||
use App\Models\Base\CustomerBaseModel;
|
||||
use App\Models\Post\PostPushBoxModel;
|
||||
use App\Models\WebSocket\CustomerWsHistoryModel;
|
||||
use App\Models\Api\Post\PostPushBoxModel;
|
||||
use App\Models\Api\WebSocket\ApiWsHistoryModel;
|
||||
use App\Models\Api\Base\ApiBaseModel;
|
||||
use App\Structs\QueueUserActiveStatusStruct;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CustomerUserExtendModel extends CustomerBaseModel
|
||||
class CustomerUserExtendModel extends ApiBaseModel
|
||||
{
|
||||
|
||||
protected $table = 'customer_user_extend';
|
||||
@ -94,7 +93,7 @@ class CustomerUserExtendModel extends CustomerBaseModel
|
||||
{
|
||||
if (empty($date)) $date = Carbon::yesterday()->toDateString();
|
||||
|
||||
$oCustomerWsHistoryModel = new CustomerWsHistoryModel();
|
||||
$oCustomerWsHistoryModel = new ApiWsHistoryModel();
|
||||
$aActiveUserIdList = $oCustomerWsHistoryModel->getActiveUserIdList($date); //三日内活跃用户
|
||||
if (empty($aActiveUserIdList)) return;
|
||||
$oCustomerChangeInfoLogModel = new CustomerChangeInfoLogModel();
|
||||
@ -140,7 +139,7 @@ class CustomerUserExtendModel extends CustomerBaseModel
|
||||
{
|
||||
try{
|
||||
Db::beginTransaction();
|
||||
$oCustomerWsHistoryModel = new CustomerWsHistoryModel();
|
||||
$oCustomerWsHistoryModel = new ApiWsHistoryModel();
|
||||
$aActiveUserId = $oCustomerWsHistoryModel->findActiveUserId($uid, Carbon::yesterday()->toDateString()); //三日内活跃用户
|
||||
if(empty($aActiveUserId)) return;
|
||||
$oCustomerUserExtendModel = $this->newQuery()->where('uid', $uid)->first(['uid','is_active']);
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Customer;
|
||||
namespace App\Models\Api\Customer;
|
||||
|
||||
use App\Cache\Table\TableCustomerUserCache;
|
||||
use App\Models\Base\CustomerBaseModel;
|
||||
use App\Models\Api\Base\ApiBaseModel;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class CustomerUserModel extends CustomerBaseModel
|
||||
class CustomerUserModel extends ApiBaseModel
|
||||
{
|
||||
protected $table = 'customer_users';
|
||||
protected $primaryKey = 'id';
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
namespace App\Models\Follow;
|
||||
namespace App\Models\Api\Follow;
|
||||
|
||||
use App\Exceptions\ModelException;
|
||||
use App\Models\Base\BaseModel;
|
||||
use App\Models\Api\Base\ApiBaseModel;
|
||||
|
||||
class FollowHistoryModel extends BaseModel
|
||||
class FollowHistoryModel extends ApiBaseModel
|
||||
{
|
||||
protected $table = 'customer_follow_history';
|
||||
protected $primaryKey = 'id';
|
||||
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Follow;
|
||||
namespace App\Models\Api\Follow;
|
||||
|
||||
use App\Exceptions\ModelException;
|
||||
use App\Models\Base\BaseModel;
|
||||
use App\Models\Customer\CustomerUserExtendModel;
|
||||
use App\Models\Api\Base\ApiBaseModel;
|
||||
use App\Models\Api\Customer\CustomerUserExtendModel;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class FollowModel extends BaseModel
|
||||
class FollowModel extends ApiBaseModel
|
||||
{
|
||||
protected $table = 'customer_follow';
|
||||
protected $primaryKey = 'id';
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
namespace App\Models\Post;
|
||||
namespace App\Models\Api\Post;
|
||||
|
||||
use App\Exceptions\ModelException;
|
||||
use App\Models\Base\BaseModel;
|
||||
use App\Models\Api\Base\ApiBaseModel;
|
||||
|
||||
class PostHistoryModel extends BaseModel
|
||||
class PostHistoryModel extends ApiBaseModel
|
||||
{
|
||||
protected $table = 'customer_post_history';
|
||||
protected $primaryKey = 'id';
|
||||
@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Post;
|
||||
namespace App\Models\Api\Post;
|
||||
|
||||
use App\Exceptions\ModelException;
|
||||
use App\Models\Base\BaseModel;
|
||||
use App\Models\Post\Structs\PostParamsStruct;
|
||||
use App\Models\Api\Base\ApiBaseModel;
|
||||
use App\Models\Api\Post\Structs\PostParamsStruct;
|
||||
use App\Tools\Tools;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class PostModel extends BaseModel
|
||||
class PostModel extends ApiBaseModel
|
||||
{
|
||||
//软删除
|
||||
use SoftDeletes;
|
||||
@ -1,20 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Post;
|
||||
namespace App\Models\Api\Post;
|
||||
|
||||
use App\Exceptions\ModelException;
|
||||
use App\Jobs\AddPostQueue;
|
||||
use App\Models\Base\BaseModel;
|
||||
use App\Models\Comment\PostCommentModel;
|
||||
use App\Models\Customer\CustomerUserExtendModel;
|
||||
use App\Models\Follow\FollowModel;
|
||||
use App\Models\Post\Structs\PostParamsStruct;
|
||||
use App\Models\Api\Base\ApiBaseModel;
|
||||
use App\Models\Api\Comment\PostCommentModel;
|
||||
use App\Models\Api\Customer\CustomerUserExtendModel;
|
||||
use App\Models\Api\Follow\FollowModel;
|
||||
use App\Models\Api\Post\Structs\PostParamsStruct;
|
||||
use App\Structs\QueueAddPostStruct;
|
||||
use App\Tools\CollectOffsetLimit;
|
||||
use App\Tools\Tools;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
|
||||
class PostPushBoxModel extends BaseModel
|
||||
class PostPushBoxModel extends ApiBaseModel
|
||||
{
|
||||
|
||||
protected $table = 'customer_post_push_box';
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace App\Models\Post\Structs;
|
||||
namespace App\Models\Api\Post\Structs;
|
||||
class PostParamsStruct{
|
||||
const REPOST_ORG_USER_ID = 'repostOrgUserId';
|
||||
const REPOST_ORG_USERNAME = 'repostOrgUsername';
|
||||
@ -1,15 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\WebSocket;
|
||||
namespace App\Models\Api\WebSocket;
|
||||
|
||||
use App\Cache\Table\TableCustomerUserCache;
|
||||
use App\Models\Base\CustomerBaseModel;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use App\Models\Api\Base\ApiBaseModel;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class CustomerWsHistoryModel extends CustomerBaseModel
|
||||
class ApiWsHistoryModel extends ApiBaseModel
|
||||
{
|
||||
protected $table = 'customer_ws_history';
|
||||
protected $primaryKey = 'id';
|
||||
@ -2,9 +2,7 @@
|
||||
|
||||
namespace App\Models\Base;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class BaseModel extends Model
|
||||
{
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Base;
|
||||
|
||||
class CustomerBaseModel extends BaseModel {
|
||||
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Customer;
|
||||
|
||||
use App\Cache\Table\TableCustomerUserCache;
|
||||
use App\Models\Base\CustomerBaseModel;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class CustomerLoginHistoryModel extends CustomerBaseModel
|
||||
{
|
||||
protected $table = 'customer_login_history';
|
||||
protected $primaryKey = 'id';
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'status',
|
||||
'uid',
|
||||
'device',
|
||||
'created_at',
|
||||
];
|
||||
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
9
app/Models/Wallet/Base/WalletBaseModel.php
Normal file
9
app/Models/Wallet/Base/WalletBaseModel.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Wallet\Base;
|
||||
|
||||
use App\Models\Base\BaseModel;
|
||||
|
||||
class WalletBaseModel extends BaseModel {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user