KeywordVideoController.php
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/**
* @remark :
* @name :KeywordVideoController.php
* @author :lyh
* @method :post
* @time :2024/2/26 9:23
*/
namespace App\Http\Controllers\Aside\Com;
use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Models\Com\KeywordVideoTask;
use App\Models\Domain\DomainInfo;
class KeywordVideoController extends BaseController
{
/**
* @remark :任务列表
* @name :lists
* @author :lyh
* @method :post
* @time :2024/2/26 11:36
*/
public function lists(){
$keywordModel = new KeywordVideoTask();
$lists = $keywordModel->lists($this->map,$this->page,$this->row);
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :创建关键字任务池子
* @name :saveKeyword
* @author :lyh
* @method :post
* @time :2024/2/26 9:24
*/
public function createKeywordTask(){
$this->request->validate([
'project_id'=>'required',
'number'=>'required'
], [
'project_id.required' => '项目唯一标识不为空',
'number.required' => 'number不为空',
]);
//查看当前项目是否有正式域名
$domainModel = new DomainInfo();
$info = $domainModel->read(['project_id'=>$this->param['project_id']]);
if($info === false){
$this->response('请先设置域名',Code::SYSTEM_ERROR);
}
$keywordModel = new KeywordVideoTask();
$rs = $keywordModel->add($this->param);
if($rs === false){
$this->response('添加失败',Code::SYSTEM_ERROR);
}
$this->response('success');
}
/**
* @remark :修改项目
* @name :editSort
* @author :lyh
* @method :post
* @time :2024/2/26 11:35
*/
public function edit(){
$this->request->validate([
'id'=>'required'
], [
'id.required' => '主键标识不为空',
]);
$keywordModel = new KeywordVideoTask();
$rs = $keywordModel->edit(['sort'=>$this->param['sort']],['id'=>$this->param['id']]);
if($rs === false){
$this->response('编辑失败',Code::SYSTEM_ERROR);
}
$this->response('success');
}
}