no message

This commit is contained in:
kuaifan 2021-06-25 18:52:39 +08:00
parent 497da96fda
commit a3916c71e8
23 changed files with 808 additions and 24 deletions

View File

@ -9,31 +9,32 @@
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.40",
"laravel/tinker": "^2.5",
"maatwebsite/excel": "^3.1.22",
"madnest/madzipper": "^v1.0.5",
"mews/captcha": "^3.2.0",
"predis/predis": "^1.1.6",
"ext-json": "*",
"ext-simplexml": "*",
"ext-libxml": "*",
"ext-curl": "*",
"ext-gd": "*",
"ext-curl": "*"
"ext-json": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"fideloper/proxy": "^4.4.1",
"fruitcake/laravel-cors": "^2.0.4",
"guzzlehttp/guzzle": "^7.3.0",
"laravel/framework": "^v8.48.1",
"laravel/tinker": "^v2.6.1",
"maatwebsite/excel": "^3.1.31",
"madnest/madzipper": "^v1.1.0",
"mews/captcha": "^3.2.6",
"orangehill/iseed": "^3.0.1",
"predis/predis": "^1.1.7"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^2.8.1",
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"hhxsv5/laravel-s": "^v3.7.17",
"kitloong/laravel-migrations-generator": "^4.4.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
"barryvdh/laravel-ide-helper": "^v2.10.0",
"facade/ignition": "^2.10.2",
"fakerphp/faker": "^v1.14.1",
"hhxsv5/laravel-s": "^v3.7.19",
"kitloong/laravel-migrations-generator": "^4.4.2",
"laravel/sail": "^v1.8.1",
"mockery/mockery": "^1.4.3",
"nunomaduro/collision": "^v5.5.0",
"phpunit/phpunit": "^9.5.6"
},
"autoload": {
"psr-4": {

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectColumnsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('project_columns', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID');
$table->string('name', 100)->nullable()->default('')->comment('列表名称');
$table->string('color', 20)->nullable()->default('')->comment('颜色');
$table->integer('sort')->nullable()->default(0)->comment('排序(ASC)');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('project_columns');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('project_logs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID');
$table->bigInteger('column_id')->nullable()->default(0)->comment('列表ID');
$table->bigInteger('task_id')->nullable()->default(0)->comment('项目ID');
$table->bigInteger('userid')->nullable()->default(0)->comment('会员ID');
$table->string('detail', 500)->nullable()->default('')->comment('详细信息');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('project_logs');
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectTaskContentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('project_task_contents', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID');
$table->bigInteger('task_id')->nullable()->default(0)->comment('任务ID');
$table->longText('content')->nullable()->comment('内容');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('project_task_contents');
}
}

View File

@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectTaskFilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('project_task_files', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID');
$table->bigInteger('task_id')->nullable()->default(0)->comment('任务ID');
$table->string('name', 100)->nullable()->default('')->comment('文件名称');
$table->bigInteger('size')->nullable()->default(0)->comment('文件大小(B)');
$table->string('ext', 20)->nullable()->default('')->comment('文件格式');
$table->string('path')->nullable()->default('')->comment('文件地址');
$table->string('thumb')->nullable()->default('')->comment('缩略图');
$table->bigInteger('userid')->nullable()->default(0)->comment('上传用户ID');
$table->integer('download')->nullable()->default(0)->comment('下载次数');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('project_task_files');
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectTaskTagsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('project_task_tags', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID');
$table->bigInteger('task_id')->nullable()->default(0)->comment('任务ID');
$table->string('name', 50)->nullable()->default('')->comment('标题');
$table->string('color', 10)->nullable()->default('')->comment('颜色');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('project_task_tags');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectTaskUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('project_task_users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID');
$table->bigInteger('task_id')->nullable()->default(0)->comment('任务ID');
$table->bigInteger('task_pid')->nullable()->default(0)->comment('任务ID如果是子任务则是父级任务ID');
$table->bigInteger('userid')->nullable()->default(0)->comment('成员ID');
$table->tinyInteger('owner')->nullable()->default(0)->comment('是否任务负责人');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('project_task_users');
}
}

View File

@ -0,0 +1,49 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectTasksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('project_tasks', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('parent_id')->nullable()->default(0)->comment('父级任务ID');
$table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID');
$table->bigInteger('column_id')->nullable()->default(0)->comment('列表ID');
$table->bigInteger('dialog_id')->nullable()->default(0)->comment('聊天会话ID');
$table->string('name')->nullable()->default('')->comment('标题');
$table->string('color', 20)->nullable()->default('')->comment('颜色');
$table->string('desc', 500)->nullable()->default('')->comment('描述');
$table->timestamp('start_at')->nullable()->comment('计划开始时间');
$table->timestamp('end_at')->nullable()->comment('计划结束时间');
$table->timestamp('archived_at')->nullable()->comment('归档时间');
$table->bigInteger('archived_userid')->nullable()->default(0)->comment('归档会员');
$table->timestamp('complete_at')->nullable()->comment('完成时间');
$table->bigInteger('userid')->nullable()->default(0)->comment('创建人');
$table->tinyInteger('p_level')->nullable()->default(0)->comment('优先级');
$table->string('p_name', 50)->nullable()->default('')->comment('优先级名称');
$table->string('p_color', 20)->nullable()->default('')->comment('优先级颜色');
$table->integer('sort')->nullable()->default(0)->comment('排序(ASC)');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('project_tasks');
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('project_users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('project_id')->nullable()->default(0)->comment('项目ID');
$table->bigInteger('userid')->nullable()->default(0)->comment('成员ID');
$table->tinyInteger('owner')->nullable()->default(0)->comment('是否负责人');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('project_users');
}
}

View File

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProjectsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('projects', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name')->nullable()->default('')->comment('名称');
$table->string('desc', 500)->nullable()->default('')->comment('描述、备注');
$table->bigInteger('userid')->nullable()->default(0)->comment('创建人');
$table->bigInteger('dialog_id')->nullable()->default(0)->comment('聊天会话ID');
$table->timestamp('archived_at')->nullable()->comment('归档时间');
$table->bigInteger('archived_userid')->nullable()->default(0)->comment('归档会员');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('projects');
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('settings', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name', 100)->nullable()->default('')->index('pre_setting_title_index');
$table->string('desc')->nullable()->default('')->comment('参数描述、备注');
$table->longText('setting')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('settings');
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTmpsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tmps', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name', 500)->nullable()->index('pre_tmp_title_index');
$table->string('value')->nullable();
$table->longText('content')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tmps');
}
}

View File

@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('userid');
$table->string('identity')->nullable()->default('')->comment('身份');
$table->string('az', 10)->nullable()->default('')->comment('A-Z');
$table->string('email', 100)->nullable()->default('')->unique()->comment('邮箱');
$table->string('nickname')->nullable()->comment('昵称');
$table->string('profession')->nullable()->default('')->comment('职位/职称');
$table->string('userimg')->nullable()->default('')->comment('头像');
$table->string('encrypt', 50)->nullable()->default('');
$table->string('password', 50)->nullable()->default('')->comment('登录密码');
$table->tinyInteger('changepass')->nullable()->default(0)->comment('登录需要修改密码');
$table->integer('login_num')->nullable()->default(0)->comment('累计登录次数');
$table->string('last_ip', 20)->nullable()->default('')->comment('最后登录IP');
$table->timestamp('last_at')->nullable()->comment('最后登录时间');
$table->string('line_ip', 20)->nullable()->default('')->comment('最后在线IP接口');
$table->timestamp('line_at')->nullable()->comment('最后在线时间(接口)');
$table->bigInteger('task_dialog_id')->nullable()->default(0)->comment('最后打开的任务会话ID');
$table->string('created_ip', 20)->nullable()->default('')->comment('注册IP');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWebSocketDialogMsgReadsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('web_socket_dialog_msg_reads', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('dialog_id')->nullable()->default(0)->comment('对话ID');
$table->bigInteger('msg_id')->nullable()->default(0)->comment('消息ID');
$table->bigInteger('userid')->nullable()->default(0)->comment('发送会员ID');
$table->tinyInteger('after')->nullable()->default(0)->comment('在阅读之后才添加的记录');
$table->timestamp('read_at')->nullable()->comment('阅读时间');
$table->unique(['msg_id', 'userid'], 'IDEX_msg_id_userid');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('web_socket_dialog_msg_reads');
}
}

View File

@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWebSocketDialogMsgsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('web_socket_dialog_msgs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('dialog_id')->nullable()->default(0)->comment('对话ID');
$table->bigInteger('userid')->nullable()->default(0)->comment('发送会员ID');
$table->string('type', 50)->nullable()->default('')->comment('消息类型');
$table->longText('msg')->nullable()->comment('详细消息');
$table->integer('read')->nullable()->default(0)->comment('已阅数量');
$table->integer('send')->nullable()->default(0)->comment('发送数量');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('web_socket_dialog_msgs');
}
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWebSocketDialogUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('web_socket_dialog_users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('dialog_id')->nullable()->default(0)->comment('对话ID');
$table->bigInteger('userid')->nullable()->default(0)->comment('会员ID');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('web_socket_dialog_users');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWebSocketDialogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('web_socket_dialogs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('type', 50)->nullable()->default('')->comment('对话类型');
$table->string('group_type', 50)->nullable()->default('')->comment('聊天室类型');
$table->string('name', 50)->nullable()->default('')->comment('对话名称');
$table->timestamp('last_at')->nullable()->comment('最后消息时间');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('web_socket_dialogs');
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWebSocketTmpMsgsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('web_socket_tmp_msgs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('md5', 50)->nullable()->default('')->unique('pre_ws_tmp_msgs_md5_unique')->comment('MD5(会员ID-消息)');
$table->longText('msg')->nullable()->comment('详细消息');
$table->tinyInteger('send')->nullable()->default(0)->index('pre_ws_tmp_msgs_send_index')->comment('是否已发送');
$table->bigInteger('create_id')->nullable()->default(0)->index('pre_ws_tmp_msgs_create_id_index')->comment('所属会员ID');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('web_socket_tmp_msgs');
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateWebSocketsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('web_sockets', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('key', 50)->default('')->unique('pre_ws_key_unique');
$table->string('fd', 50)->nullable()->default('');
$table->bigInteger('userid')->nullable()->default(0)->index('pre_ws_userid_index');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('web_sockets');
}
}

View File

@ -14,5 +14,7 @@ class DatabaseSeeder extends Seeder
public function run()
{
$this->call(SettingsTableSeeder::class);
$this->call(UsersTableSeeder::class);
}
}

View File

@ -0,0 +1,47 @@
<?php
namespace Database\Seeders;
use App\Models\Setting;
use Illuminate\Database\Seeder;
class SettingsTableSeeder extends Seeder
{
/**
* Auto generated seed file
*
* @return void
*/
public function run()
{
if (Setting::count() > 0) {
return;
}
\DB::table('settings')->insert(array (
0 =>
array (
'id' => 1,
'name' => 'system',
'desc' => '',
'setting' => '{"reg":"open","login_code":"auto"}',
'created_at' => '2021-05-31 11:05:06',
'updated_at' => '2021-06-03 07:27:12',
),
1 =>
array (
'id' => 2,
'name' => 'priority',
'desc' => '',
'setting' => '[{"name":"\\u91cd\\u8981\\u4e14\\u7d27\\u6025","color":"#ED4014","days":1,"priority":1},{"name":"\\u91cd\\u8981\\u4e0d\\u7d27\\u6025","color":"#F16B62","days":3,"priority":2},{"name":"\\u7d27\\u6025\\u4e0d\\u91cd\\u8981","color":"#19C919","days":5,"priority":3},{"name":"\\u4e0d\\u91cd\\u8981\\u4e0d\\u7d27\\u6025","color":"#2D8CF0","days":7,"priority":4}]',
'created_at' => '2021-06-03 08:04:30',
'updated_at' => '2021-06-24 09:20:26',
),
));
}
}

View File

@ -0,0 +1,70 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class UsersTableSeeder extends Seeder
{
/**
* Auto generated seed file
*
* @return void
*/
public function run()
{
\DB::table('users')->delete();
\DB::table('users')->insert(array (
0 =>
array (
'userid' => 1,
'identity' => ',admin,',
'az' => 'A',
'email' => 'admin@dootask.com',
'nickname' => '',
'profession' => '管理员',
'userimg' => '',
'encrypt' => 'AJnoOb',
'password' => '7d996ac317f1b9db564750ef3b8790fc',
'changepass' => 0,
'login_num' => 64,
'last_ip' => '10.22.22.1',
'last_at' => '2021-06-25 18:50:13',
'line_ip' => '10.22.22.1',
'line_at' => '2021-06-25 18:50:13',
'task_dialog_id' => 28,
'created_ip' => '',
'created_at' => '2021-06-02 11:01:14',
'updated_at' => '2021-06-25 18:50:28',
),
1 =>
array (
'userid' => 2,
'identity' => '',
'az' => 'z',
'email' => 'test@dootask.com',
'nickname' => '',
'profession' => '测试员',
'userimg' => '',
'encrypt' => '18cZzh',
'password' => '7eedd4cbf70da996d21f641bcc6cb412',
'changepass' => 0,
'login_num' => 58,
'last_ip' => '10.22.22.1',
'last_at' => '2021-06-25 18:50:51',
'line_ip' => '10.22.22.1',
'line_at' => '2021-06-25 18:50:51',
'task_dialog_id' => 28,
'created_ip' => '',
'created_at' => '2021-06-02 11:01:14',
'updated_at' => '2021-06-25 18:51:06',
),
));
}
}

View File

@ -2,10 +2,10 @@
directory=/var/www
# 生产环境
#command=php bin/laravels start -i
command=php bin/laravels start -i
# 开发环境
command=./bin/inotify ./app
#command=./bin/inotify ./app
numprocs=1
autostart=true