WorkController.php
4.52 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?php
namespace App\Http\Controllers\Icms;
use App\Helper\Response;
use App\Jobs\HandleAlbumStatus;
use Illuminate\Http\Request;
class WorkController extends BaseController
{
/**
* 专辑列表
* @param Request $request
* @return \Illuminate\Http\JsonResponse|mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function albumList(Request $request)
{
//todo:参数验证
// dd(basename($request->getRequestUri()));
return $this->doApi('album-list');
}
/**
* 专辑提交上线库
* @param Request $request
* @return \Illuminate\Http\JsonResponse|mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function submitTme(Request $request)
{
//todo:参数验证
return $this->doApi('submit-tme');
}
/**
* 获取专辑详情
* @param Request $request
* @return \Illuminate\Http\JsonResponse|mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function getAlbum(Request $request)
{
//todo:数据验证
return $this->doApi('get-album');
}
/**
* 删除专辑草稿(含批量)<草稿接口目前弃用,所以不存在删除了>
* @param Request $request
* @return \Illuminate\Http\JsonResponse|mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
// public function delAlbum(Request $request)
// {
// return $this->doApi('del-album');
// }
/**
* 艺人查询
* @param Request $request
* @return \Illuminate\Http\JsonResponse|mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function showerList(Request $request)
{
//todo:参数验证
return $this->doApi('shower-list');
}
/**
* 创建艺人
* @param Request $request
* @return \Illuminate\Http\JsonResponse|mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function createShower(Request $request)
{
//todo: 待数据实现
return $this->doApi('create-shower');
}
/**
* 候选人列表
* @param Request $request
* @return \Illuminate\Http\JsonResponse|mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function getLeaders(Request $request)
{
//todo:参数验证
return $this->doApi('get-leaders');
}
/**
* 检查作品重复
* @param Request $request
* @return \Illuminate\Http\JsonResponse|mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function checkRepeat(Request $request)
{
//todo:参数验证
return $this->doApi('check-repeat');
}
/**
* 原始版权公司列表
* @param Request $request
* @return \Illuminate\Http\JsonResponse|mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function originalCompany(Request $request)
{
//todo:参数验证
return $this->doApi('original-company');
}
/**
* 作品录入文件上传
* @param Request $request
* @return \Illuminate\Http\JsonResponse|mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function workFile(Request $request)
{
//todo:参数验证
return $this->doApi('work-file');
}
/**
* 获取授权主体列表
* @param Request $request
* @return \Illuminate\Http\JsonResponse|mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function signSubject(Request $request)
{
//todo:参数验证
return $this->doApi('sign-subject');
}
/**
* 异步通知专辑上架信息
* @param Request $request
* @return \Illuminate\Http\JsonResponse
*/
public function albumStatus(Request $request)
{
$callData = $request->only(['album_id','tme_album_id','album_status','song_id','timestamp']);
$callSign = $request->post('sign');
$callCpId = $request->post('cp_id');
if ($callCpId !== $this->cp_id) {
return Response::error(40001,'没有请求权限!');
}
//验签
$signData = $this->signData($callData);
if ($callSign !== $signData['sign']) {
return Response::error(40003,'签名鉴权未通过!');
}
//入队批量处理业务(暂时只保存请求数据)
HandleAlbumStatus::dispatch($callData)->onQueue('handle-album-status');
return response()->json(['code' => 200,'data' => true,'message' => 'OK']);
}
}