1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-28 05:11:39 +08:00

清理无用文件

This commit is contained in:
xiaochong0302 2020-09-04 20:11:18 +08:00
parent 5d03891d4d
commit 0482e5df8a
11 changed files with 56 additions and 174 deletions

View File

@ -18,27 +18,33 @@ PS**系统后台已禁止提交并隐藏私人配置**
- 后台框架:[phalcon 3.4.5](https://phalcon.io)
- 前端框架:[layui 2.5.6](https://layui.com) [layim 3.9.5](https://www.layui.com/layim)(已授权)
- 全文检索:[xunsearch 1.4.9](http://www.xunsearch.com)
- 即时通讯:[workerman 3.5.22](https://workerman.net)
- 其它依赖:[php7.3](https://php.net) [mysql5.7](https://mysql.com) [redis5.0](https://redis.io)
#### 使用协议
虽然尝试了解开源协议,但是似乎不得要领,干脆用自己的协议吧,算不算开源我也不很清楚。
虽然尝试了解过开源协议,但是理解的模棱两可,干脆用自己的协议吧,算不算开源我也不很清楚。
1. 本系统属于强业务类型,非通用类库框架,不适合再次衍生发布。
2. 在保留我们版权标识的前提下,用户可以修改以满足自己的需求,可以用于商业用途。
3. 有限社区支持,用户对自己的行为负责。
#### 安装指南
- [运行环境搭建](https://gitee.com/koogua/course-tencent-cloud-docker)
- [腾讯服务配置](https://gitee.com/koogua/course-tencent-cloud-docker/wikis/腾讯服务配置)
#### 会推出商业服务吗?
- 如果不符合您对“开源”的认知,请移步其它同类产品,毕竟同类“免费”产品也很多。
- 如果“开源”版本不能满足您的需求,或者您更希望有更好的支持,商业服务是不错的选择。
我们目前提供的服务
我们为用户提供的服务包括
- 安装服务
- 会员服务
- 定制服务
- 系统安装
- 系统定制
- 企业会员
#### 会有阿里云版吗?
@ -50,11 +56,9 @@ PS**系统后台已禁止提交并隐藏私人配置**
#### 通过这个项目能学到什么?
把所有代码看完,希望对你有启发。把各个环节跑通,会引出很多知识。
1. 项目规划phalcon实战缓存JWTwebsocket即时通讯
2. docker操作docker服务编排
3. gitlinuxphpmysqlredisnginx ...
1. 项目规划phalcon实战缓存JWT即时通讯全文检索
2. docker操作docker服务编排supervisordevOps
3. gitlinuxphpmysqlredisnginx
#### 开发计划

View File

@ -49,13 +49,14 @@
</thead>
<tbody>
{% for item in pager.items %}
{% set preview_url = url({'for':'desktop.group.show','id':item.id}) %}
{% set edit_url = url({'for':'admin.group.edit','id':item.id}) %}
{% set update_url = url({'for':'admin.group.update','id':item.id}) %}
{% set delete_url = url({'for':'admin.group.delete','id':item.id}) %}
{% set restore_url = url({'for':'admin.group.restore','id':item.id}) %}
<tr>
<td>{{ item.id }}</td>
<td>{{ item.name }} {{ type_info(item.type) }}</td>
<td><a href="{{ edit_url }}">{{ item.name }}</a> {{ type_info(item.type) }}</td>
<td>{{ owner_info(item.owner) }}</td>
<td><span class="layui-badge layui-bg-gray">{{ item.user_count }}</span></td>
<td><input type="checkbox" name="published" value="1" lay-filter="published" lay-skin="switch" lay-text="是|否" data-url="{{ update_url }}" {% if item.published == 1 %}checked{% endif %}></td>
@ -63,6 +64,7 @@
<div class="layui-dropdown">
<button class="layui-btn layui-btn-sm">操作 <i class="layui-icon layui-icon-triangle-d"></i></button>
<ul>
<li><a href="{{ preview_url }}" target="_blank">预览</a></li>
<li><a href="{{ edit_url }}">编辑</a></li>
{% if item.deleted == 0 %}
<li><a href="javascript:" class="kg-delete" data-url="{{ delete_url }}">删除</a></li>

View File

@ -25,7 +25,8 @@
<div class="layui-input-block">
<input type="radio" name="source_type" value="1" title="免费课程">
<input type="radio" name="source_type" value="2" title="付费课程">
<input type="radio" name="source_type" value="3" title="后台导入">
<input type="radio" name="source_type" value="3" title="畅学课程">
<input type="radio" name="source_type" value="4" title="后台导入">
</div>
</div>
<div class="layui-form-item">

View File

@ -1,35 +0,0 @@
<?php
namespace App\Http\Desktop\Controllers;
/**
* @RoutePrefix("/im")
*/
class ImSummaryController extends Controller
{
/**
* @Get("/active/groups", name="desktop.im.active_groups")
*/
public function activeGroupsAction()
{
$this->seo->prependTitle('群组');
}
/**
* @Get("/active/users", name="desktop.im.active_users")
*/
public function activeUsersAction()
{
$this->seo->prependTitle('群组');
}
/**
* @Get("/online/users", name="desktop.im.online_users")
*/
public function onlineUsersAction()
{
$this->seo->prependTitle('群组');
}
}

View File

@ -7,6 +7,7 @@ use App\Builders\ImGroupUserList as ImGroupUserListBuilder;
use App\Caches\ImGroupActiveUserList as ImGroupActiveUserListCache;
use App\Library\Paginator\Query as PagerQuery;
use App\Models\ImGroup as ImGroupModel;
use App\Models\ImUser as ImUserModel;
use App\Repos\ImGroup as ImGroupRepo;
use App\Repos\ImGroupUser as ImGroupUserRepo;
use App\Repos\User as UserRepo;
@ -138,11 +139,17 @@ class ImGroup extends Service
$group = $validator->checkGroup($groupId);
$user = $validator->checkUser($userId);
$validator->checkOwner($loginUser->id, $group->owner_id);
$groupUser = $validator->checkGroupUser($groupId, $userId);
$groupUser->delete();
$this->decrGroupUserCount($group);
$this->decrUserGroupCount($user);
}
protected function handleGroupUsers($pager)
@ -207,4 +214,20 @@ class ImGroup extends Service
return $pager;
}
protected function decrGroupUserCount(ImGroupModel $group)
{
if ($group->user_count > 0) {
$group->user_count -= 1;
$group->update();
}
}
protected function decrUserGroupCount(ImUserModel $user)
{
if ($user->group_count > 0) {
$user->group_count -= 1;
$user->update();
}
}
}

View File

@ -45,7 +45,7 @@ Trait ImGroupTrait
$validator = new ImNoticeValidator();
$notice = $validator->checkNotice($noticeId, 'system');
$notice = $validator->checkNotice($noticeId);
if ($notice->item_type != ImNoticeModel::TYPE_GROUP_REQUEST) {
return;

View File

@ -5,7 +5,7 @@
{% set sender = item_info.sender %}
{% set sender_url = url({'for':'desktop.user.show','id':sender.id}) %}
{% if item_type == '1' %}
{% if item_type == 1 %}
{% set group = item_info.group %}
{% set remark = item_info.remark ? '附言:' ~ item_info.remark : '' %}
<li data-id="{{ item.id }}">
@ -26,7 +26,7 @@
{% endif %}
</p>
</li>
{% elseif item_type == '2' %}
{% elseif item_type == 2 %}
<li class="layim-msgbox-system">
<p>
<em>系统:</em>
@ -34,7 +34,7 @@
接受了你的好友申请<span>{{ item.create_time|time_ago }}</span>
</p>
</li>
{% elseif item_type == '3' %}
{% elseif item_type == 3 %}
<li class="layim-msgbox-system">
<p>
<em>系统:</em>
@ -42,7 +42,7 @@
拒绝了你的好友申请<span>{{ item.create_time|time_ago }}</span>
</p>
</li>
{% elseif item_type == '4' %}
{% elseif item_type == 4 %}
{% set remark = item_info.remark ? '附言:' ~ item_info.remark : '' %}
<li data-id="{{ item.id }}">
<a href="{{ sender_url }}" target="_blank"><img class="layui-circle layim-msgbox-avatar" alt="{{ sender.name }}" src="{{ sender.avatar }}"></a>
@ -62,7 +62,7 @@
{% endif %}
</p>
</li>
{% elseif item_type == '5' %}
{% elseif item_type == 5 %}
<li class="layim-msgbox-system">
<p>
<em>系统:</em>
@ -70,7 +70,7 @@
接受了你的入群申请<span>{{ item.create_time|time_ago }}</span>
</p>
</li>
{% elseif item_type == '6' %}
{% elseif item_type == 6 %}
<li class="layim-msgbox-system">
<p>
<em>系统:</em>

View File

@ -17,6 +17,13 @@ class ImNotice extends Model
const TYPE_GROUP_ACCEPTED = 5; // 入群被接受
const TYPE_GROUP_REFUSED = 6; // 入群被拒绝
/**
* 请求状态
*/
const REQUEST_PENDING = 'pending'; // 待定
const REQUEST_ACCEPTED = 'accepted'; // 接受
const REQUEST_REFUSED = 'refused'; // 拒绝
/**
* 主键编号
*

View File

@ -1,24 +0,0 @@
<?php
namespace App\Services\Frontend\Im;
use App\Services\Frontend\Service as FrontendService;
use App\Validators\ImFriendUser as ImFriendUserValidator;
class ImFriendDelete extends FrontendService
{
public function handle($id)
{
$user = $this->getLoginUser();
$validator = new ImFriendUserValidator();
$friend = $validator->checkFriend($id);
$friendUser = $validator->checkFriendUser($user->id, $friend->id);
$friendUser->delete();
}
}

View File

@ -1,44 +0,0 @@
<?php
namespace App\Services\Frontend\Im;
use App\Models\ImGroup as ImGroupModel;
use App\Models\ImUser as ImUserModel;
use App\Services\Frontend\Service as FrontendService;
use App\Validators\ImGroupUser as ImGroupUserValidator;
class ImGroupDelete extends FrontendService
{
public function handle($id)
{
$user = $this->getLoginUser();
$validator = new ImGroupUserValidator();
$group = $validator->checkGroup($id);
$groupUser = $validator->checkGroupUser($group->id, $user->id);
$groupUser->delete();
$this->decrGroupUserCount($group);
}
protected function decrGroupUserCount(ImGroupModel $group)
{
if ($group->user_count > 0) {
$group->user_count -= 1;
$group->update();
}
}
protected function decrUserGroupCount(ImUserModel $user)
{
if ($user->group_count > 0) {
$user->group_count -= 1;
$user->update();
}
}
}

View File

@ -1,52 +0,0 @@
<?php
namespace App\Services\Frontend\Im;
use App\Models\ImGroup as ImGroupModel;
use App\Models\ImUser as ImUserModel;
use App\Services\Frontend\Service as FrontendService;
use App\Validators\ImGroupUser as ImGroupUserValidator;
class ImGroupUserDelete extends FrontendService
{
public function handle()
{
$post = $this->request->getPost();
$loginUser = $this->getLoginUser();
$validator = new ImGroupUserValidator();
$group = $validator->checkGroup($post['group_id']);
$user = $validator->checkUser($post['user_id']);
$validator->checkOwner($group->owner_id, $loginUser->id);
$groupUser = $validator->checkGroupUser($group->id, $user->id);
$groupUser->delete();
$this->decrGroupUserCount($group);
$this->decrUserGroupCount($user);
}
protected function decrGroupUserCount(ImGroupModel $group)
{
if ($group->user_count > 0) {
$group->user_count -= 1;
$group->update();
}
}
protected function decrUserGroupCount(ImUserModel $user)
{
if ($user->group_count > 0) {
$user->group_count -= 1;
$user->update();
}
}
}