初始化

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; namespace App\Model;
/** /**
* Class Emoticon * 表情包分组数据表模型
* *
* @property int $id * @property int $id 分组ID
* @property string $name * @property string $name 分组名称
* @property string $url * @property string $url 默认表情
* @property \Carbon\Carbon $created_at * @property string $created_at 创建时间
* *
* @package App\Model * @package App\Model
*/ */

View File

@ -5,14 +5,18 @@ declare (strict_types=1);
namespace App\Model; namespace App\Model;
/** /**
* @property int $id * 表情包数据表模型
* @property int $emoticon_id *
* @property int $user_id * @property int $id 表情包ID
* @property string $describe * @property int $emoticon_id 分组ID
* @property string $url * @property int $user_id 用户ID
* @property string $file_suffix * @property string $describe 表情描述
* @property int $file_size * @property string $url 表情链接
* @property \Carbon\Carbon $created_at * @property string $file_suffix 文件前缀
* @property int $file_size 表情包文件大小
* @property string $created_at 创建时间
*
* @package App\Model
*/ */
class EmoticonDetail extends BaseModel class EmoticonDetail extends BaseModel
{ {
@ -22,16 +26,32 @@ class EmoticonDetail extends BaseModel
* @var string * @var string
*/ */
protected $table = 'emoticon_details'; protected $table = 'emoticon_details';
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
* *
* @var array * @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. * The attributes that should be cast to native types.
* *
* @var array * @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; namespace App\Model;
/** /**
* @property int $id * 文件拆分上传数据表模型
* @property int $file_type *
* @property int $user_id * @property int $id 临时文件ID
* @property string $hash_name * @property int $file_type 上传类型[1:合并文件;2:拆分文件]
* @property string $original_name * @property int $user_id 上传的用户ID
* @property int $split_index * @property string $hash_name 临时文件hash名
* @property int $split_num * @property string $original_name 原文件名
* @property string $save_dir * @property int $split_index 当前索引块
* @property string $file_ext * @property int $split_num 总上传索引块
* @property int $file_size * @property string $save_dir 文件的临时保存路径
* @property int $is_delete * @property string $file_ext 文件后缀名
* @property int $upload_at * @property int $file_size 临时文件大小
* @property int $is_delete 文件是否已被删除[1:;0:;]
* @property int $upload_at 文件上传时间
*
* @package App\Model
*/ */
class FileSplitUpload extends BaseModel class FileSplitUpload extends BaseModel
{ {
@ -26,16 +30,29 @@ class FileSplitUpload extends BaseModel
* @var string * @var string
*/ */
protected $table = 'file_split_upload'; protected $table = 'file_split_upload';
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
* *
* @var array * @var array
*/ */
protected $fillable = []; protected $fillable = [
];
/** /**
* The attributes that should be cast to native types. * The attributes that should be cast to native types.
* *
* @var array * @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 <?php
declare (strict_types=1); declare (strict_types=1);
namespace App\Model; namespace App\Model;
/** /**
@ -31,7 +32,7 @@ class User extends BaseModel
* @var array * @var array
*/ */
protected $fillable = [ protected $fillable = [
'mobile','nickname','avatar','gender','password','motto','email','created_at' 'mobile', 'nickname', 'avatar', 'gender', 'password', 'motto', 'email', 'created_at'
]; ];
/** /**

View File

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

View File

@ -1,12 +1,17 @@
<?php <?php
declare (strict_types=1); declare (strict_types=1);
namespace App\Model; 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 class UsersEmoticon extends BaseModel
{ {
@ -22,12 +27,18 @@ class UsersEmoticon extends BaseModel
* *
* @var array * @var array
*/ */
protected $fillable = []; protected $fillable = [
'user_id',
'emoticon_ids'
];
/** /**
* The attributes that should be cast to native types. * The attributes that should be cast to native types.
* *
* @var array * @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; use Hyperf\DbConnection\Db;
/** /**
* 表情包收藏数据表模型
*
* @property int $id * @property int $id
* @property int $user1 * @property int $user1 用户1ID
* @property int $user2 * @property int $user2 用户2ID
* @property string $user1_remark * @property string $user1_remark 用户1好友备注
* @property string $user2_remark * @property string $user2_remark 用户2好友备注
* @property int $active * @property int $active 主动邀请方[1:user1;2:user2;]
* @property int $status * @property int $status 好友状态[1:好友状态;0:已解除好友关系]
* @property string $agree_time * @property string $agree_time 成为好友时间
* @property \Carbon\Carbon $created_at * @property string $created_at 创建时间
*
* @package App\Model
*/ */
class UsersFriend extends BaseModel class UsersFriend extends BaseModel
{ {
@ -38,7 +42,14 @@ class UsersFriend extends BaseModel
* *
* @var array * @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; namespace App\Model;
/** /**
* @property int $id * 好友添加申请数据表模型
* @property int $user_id *
* @property int $friend_id * @property int $id 申请ID
* @property int $status * @property int $user_id 用户ID
* @property string $remarks * @property int $friend_id 朋友ID
* @property \Carbon\Carbon $created_at * @property int $status 申请状态
* @property \Carbon\Carbon $updated_at * @property string $remarks 备注说明
* @property string $created_at 创建时间
* @property string $updated_at 更新时间
*
* @package App\Model
*/ */
class UsersFriendsApply extends BaseModel class UsersFriendsApply extends BaseModel
{ {
@ -41,5 +45,12 @@ class UsersFriendsApply extends BaseModel
* *
* @var array * @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; use PagingTrait;
/** /**
* 创建好友的申请 * 创建好友的申请
* *