初始化

main
gzydong 2020-11-14 18:10:28 +08:00
parent 0f934312c2
commit 7dafc96462
9 changed files with 146 additions and 71 deletions

View File

@ -5,12 +5,12 @@ declare (strict_types=1);
namespace App\Model;
/**
* Class Emoticon
* 表情包分组数据表模型
*
* @property int $id
* @property string $name
* @property string $url
* @property \Carbon\Carbon $created_at
* @property int $id 分组ID
* @property string $name 分组名称
* @property string $url 默认表情
* @property string $created_at 创建时间
*
* @package App\Model
*/

View File

@ -5,14 +5,18 @@ declare (strict_types=1);
namespace App\Model;
/**
* @property int $id
* @property int $emoticon_id
* @property int $user_id
* @property string $describe
* @property string $url
* @property string $file_suffix
* @property int $file_size
* @property \Carbon\Carbon $created_at
* 表情包数据表模型
*
* @property int $id 表情包ID
* @property int $emoticon_id 分组ID
* @property int $user_id 用户ID
* @property string $describe 表情描述
* @property string $url 表情链接
* @property string $file_suffix 文件前缀
* @property int $file_size 表情包文件大小
* @property string $created_at 创建时间
*
* @package App\Model
*/
class EmoticonDetail extends BaseModel
{
@ -22,16 +26,32 @@ class EmoticonDetail extends BaseModel
* @var string
*/
protected $table = 'emoticon_details';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [];
protected $fillable = [
'emoticon_id',
'user_id',
'describe',
'url',
'file_suffix',
'file_size',
'created_at',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = ['id' => 'integer', 'emoticon_id' => 'integer', 'user_id' => 'integer', 'file_size' => 'integer', 'created_at' => 'datetime'];
protected $casts = [
'id' => 'integer',
'emoticon_id' => 'integer',
'user_id' => 'integer',
'file_size' => 'integer',
'created_at' => 'datetime'
];
}

View File

@ -5,18 +5,22 @@ declare (strict_types=1);
namespace App\Model;
/**
* @property int $id
* @property int $file_type
* @property int $user_id
* @property string $hash_name
* @property string $original_name
* @property int $split_index
* @property int $split_num
* @property string $save_dir
* @property string $file_ext
* @property int $file_size
* @property int $is_delete
* @property int $upload_at
* 文件拆分上传数据表模型
*
* @property int $id 临时文件ID
* @property int $file_type 上传类型[1:合并文件;2:拆分文件]
* @property int $user_id 上传的用户ID
* @property string $hash_name 临时文件hash名
* @property string $original_name 原文件名
* @property int $split_index 当前索引块
* @property int $split_num 总上传索引块
* @property string $save_dir 文件的临时保存路径
* @property string $file_ext 文件后缀名
* @property int $file_size 临时文件大小
* @property int $is_delete 文件是否已被删除[1:;0:;]
* @property int $upload_at 文件上传时间
*
* @package App\Model
*/
class FileSplitUpload extends BaseModel
{
@ -26,16 +30,29 @@ class FileSplitUpload extends BaseModel
* @var string
*/
protected $table = 'file_split_upload';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [];
protected $fillable = [
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = ['id' => 'integer', 'file_type' => 'integer', 'user_id' => 'integer', 'split_index' => 'integer', 'split_num' => 'integer', 'file_size' => 'integer', 'is_delete' => 'integer', 'upload_at' => 'integer'];
protected $casts = [
'id' => 'integer',
'file_type' => 'integer',
'user_id' => 'integer',
'split_index' => 'integer',
'split_num' => 'integer',
'file_size' => 'integer',
'is_delete' => 'integer',
'upload_at' => 'integer'
];
}

View File

@ -1,6 +1,7 @@
<?php
declare (strict_types=1);
namespace App\Model;
/**

View File

@ -1,19 +1,24 @@
<?php
declare (strict_types=1);
namespace App\Model;
/**
* @property int $id
* @property int $type
* @property int $uid
* @property int $friend_id
* @property int $group_id
* @property int $status
* @property int $is_top
* @property int $not_disturb
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* 聊天列表组数据表模型
*
* @property int $id 聊天列表ID
* @property int $type 聊天类型[1:好友;2:群聊;]
* @property int $uid 用户ID
* @property int $friend_id 好友ID
* @property int $group_id 群组ID
* @property int $status 列表状态
* @property int $is_top 是否置顶
* @property int $not_disturb 是否消息免打扰
* @property string $created_at 创建时间
* @property string $updated_at 更新时间
*
* @package App\Model
*/
class UsersChatList extends BaseModel
{

View File

@ -1,12 +1,17 @@
<?php
declare (strict_types=1);
namespace App\Model;
/**
* @property int $id
* @property int $user_id
* @property string $emoticon_ids
* 表情包收藏数据表模型
*
* @property int $id 收藏ID
* @property int $user_id 用户ID
* @property string $emoticon_ids 表情包ID多个用英文逗号拼接
*
* @package App\Model
*/
class UsersEmoticon extends BaseModel
{
@ -22,12 +27,18 @@ class UsersEmoticon extends BaseModel
*
* @var array
*/
protected $fillable = [];
protected $fillable = [
'user_id',
'emoticon_ids'
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = ['id' => 'integer', 'user_id' => 'integer'];
protected $casts = [
'id' => 'integer',
'user_id' => 'integer'
];
}

View File

@ -7,15 +7,19 @@ namespace App\Model;
use Hyperf\DbConnection\Db;
/**
* 表情包收藏数据表模型
*
* @property int $id
* @property int $user1
* @property int $user2
* @property string $user1_remark
* @property string $user2_remark
* @property int $active
* @property int $status
* @property string $agree_time
* @property \Carbon\Carbon $created_at
* @property int $user1 用户1ID
* @property int $user2 用户2ID
* @property string $user1_remark 用户1好友备注
* @property string $user2_remark 用户2好友备注
* @property int $active 主动邀请方[1:user1;2:user2;]
* @property int $status 好友状态[1:好友状态;0:已解除好友关系]
* @property string $agree_time 成为好友时间
* @property string $created_at 创建时间
*
* @package App\Model
*/
class UsersFriend extends BaseModel
{
@ -38,7 +42,14 @@ class UsersFriend extends BaseModel
*
* @var array
*/
protected $casts = ['id' => 'integer', 'user1' => 'integer', 'user2' => 'integer', 'active' => 'integer', 'status' => 'integer', 'created_at' => 'datetime'];
protected $casts = [
'id' => 'integer',
'user1' => 'integer',
'user2' => 'integer',
'active' => 'integer',
'status' => 'integer',
'created_at' => 'datetime'
];
/**
* 获取用户所有好友

View File

@ -5,13 +5,17 @@ declare (strict_types=1);
namespace App\Model;
/**
* @property int $id
* @property int $user_id
* @property int $friend_id
* @property int $status
* @property string $remarks
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* 好友添加申请数据表模型
*
* @property int $id 申请ID
* @property int $user_id 用户ID
* @property int $friend_id 朋友ID
* @property int $status 申请状态
* @property string $remarks 备注说明
* @property string $created_at 创建时间
* @property string $updated_at 更新时间
*
* @package App\Model
*/
class UsersFriendsApply extends BaseModel
{
@ -41,5 +45,12 @@ class UsersFriendsApply extends BaseModel
*
* @var array
*/
protected $casts = ['id' => 'integer', 'user_id' => 'integer', 'friend_id' => 'integer', 'status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected $casts = [
'id' => 'integer',
'user_id' => 'integer',
'friend_id' => 'integer',
'status' => 'integer',
'created_at' => 'datetime',
'updated_at' => 'datetime'
];
}

View File

@ -13,7 +13,6 @@ class FriendService extends BaseService
{
use PagingTrait;
/**
* 创建好友的申请
*