Merge branch 'release'
Showing
28 changed files
with
843 additions
and
20 deletions
... | @@ -49,4 +49,12 @@ class CacheKeyTools | ... | @@ -49,4 +49,12 @@ class CacheKeyTools |
49 | { | 49 | { |
50 | return config('cache.key')['districts']; | 50 | return config('cache.key')['districts']; |
51 | } | 51 | } |
52 | |||
53 | /** | ||
54 | * @return mixed | ||
55 | */ | ||
56 | public static function tmeAccessToken() | ||
57 | { | ||
58 | return config('cache.key')['tme_access_token']; | ||
59 | } | ||
52 | } | 60 | } | ... | ... |
... | @@ -12,7 +12,7 @@ class CosHelper | ... | @@ -12,7 +12,7 @@ class CosHelper |
12 | protected $client; | 12 | protected $client; |
13 | protected $bucket; | 13 | protected $bucket; |
14 | 14 | ||
15 | public function __construct() | 15 | public function __construct($bucket = null) |
16 | { | 16 | { |
17 | $secretId = env('COS_SECRET_ID'); //"云 API 密钥 SecretId"; | 17 | $secretId = env('COS_SECRET_ID'); //"云 API 密钥 SecretId"; |
18 | $secretKey = env('COS_SECRET_KEY'); //"云 API 密钥 SecretKey"; | 18 | $secretKey = env('COS_SECRET_KEY'); //"云 API 密钥 SecretKey"; |
... | @@ -26,7 +26,7 @@ class CosHelper | ... | @@ -26,7 +26,7 @@ class CosHelper |
26 | 'secretKey' => $secretKey))); | 26 | 'secretKey' => $secretKey))); |
27 | 27 | ||
28 | $this->client = $cosClient; | 28 | $this->client = $cosClient; |
29 | $this->bucket = env('COS_BUCKET'); | 29 | $this->bucket = $bucket ?? env('COS_BUCKET'); |
30 | } | 30 | } |
31 | 31 | ||
32 | /** | 32 | /** | ... | ... |
... | @@ -17,11 +17,12 @@ class Response | ... | @@ -17,11 +17,12 @@ class Response |
17 | * @param array $data | 17 | * @param array $data |
18 | * @return \Illuminate\Http\JsonResponse | 18 | * @return \Illuminate\Http\JsonResponse |
19 | */ | 19 | */ |
20 | public static function success($data = []) | 20 | public static function success($data = [], string $msg = '请求成功') |
21 | { | 21 | { |
22 | return response()->json([ | 22 | return response()->json([ |
23 | 'code' => ErrorCode::SERVER_OK, | 23 | 'code' => ErrorCode::SERVER_OK, |
24 | 'data' => $data instanceof LengthAwarePaginator ? self::paginator($data) : $data | 24 | 'data' => $data instanceof LengthAwarePaginator ? self::paginator($data) : $data, |
25 | 'msg' => $msg | ||
25 | ]); | 26 | ]); |
26 | } | 27 | } |
27 | 28 | ||
... | @@ -30,11 +31,12 @@ class Response | ... | @@ -30,11 +31,12 @@ class Response |
30 | * @param int $code | 31 | * @param int $code |
31 | * @return mixed | 32 | * @return mixed |
32 | */ | 33 | */ |
33 | public static function error($code = ErrorCode::SERVER_ERROR, string $msg = '') | 34 | public static function error($code = ErrorCode::SERVER_ERROR, string $msg = '',$data = []) |
34 | { | 35 | { |
35 | return response()->json([ | 36 | return response()->json([ |
36 | 'code' => $code, | 37 | 'code' => $code, |
37 | 'msg' => $msg ?: (ErrorCode::$messages[$code] ?? ErrorCode::$messages[ErrorCode::SERVER_ERROR]) | 38 | 'msg' => $msg ?: (ErrorCode::$messages[$code] ?? ErrorCode::$messages[ErrorCode::SERVER_ERROR]), |
39 | 'data' => $data | ||
38 | ]); | 40 | ]); |
39 | } | 41 | } |
40 | 42 | ... | ... |
1 | <?php | ||
2 | |||
3 | namespace App\Http\Controllers\Musician; | ||
4 | |||
5 | use App\Http\Controllers\Controller; | ||
6 | use App\Http\Requests\Musician\MusicianWithdrawBillConfirmRequest; | ||
7 | use App\Http\Requests\Musician\MusicianWithdrawReceiptByNameRequest; | ||
8 | use App\Http\Requests\Musician\MusicianWithdrawReceiptByNoRequest; | ||
9 | use App\Http\Requests\Musician\MusicianWithdrawReceiptRequest; | ||
10 | use App\Http\Requests\Musician\MusicianWithdrawStatusRequest; | ||
11 | use App\Services\IssueService; | ||
12 | use App\Services\MusicianWithdrawService; | ||
13 | use App\Services\WithdrawService; | ||
14 | |||
15 | /** | ||
16 | * Class IssueController | ||
17 | * @package App\Http\Controllers\Musician | ||
18 | */ | ||
19 | class IssueController extends Controller | ||
20 | { | ||
21 | /** | ||
22 | * @var | ||
23 | */ | ||
24 | private $issueService; | ||
25 | |||
26 | /** | ||
27 | * @param IssueService $issueService | ||
28 | */ | ||
29 | public function __construct(IssueService $issueService) | ||
30 | { | ||
31 | $this->issueService = $issueService; | ||
32 | } | ||
33 | |||
34 | /** | ||
35 | * @return \Illuminate\Http\JsonResponse | ||
36 | */ | ||
37 | public function index() | ||
38 | { | ||
39 | return $this->issueService->forward(); | ||
40 | } | ||
41 | |||
42 | /** | ||
43 | * 版权方 | ||
44 | * @return \Illuminate\Http\JsonResponse | ||
45 | */ | ||
46 | public function subCompany() | ||
47 | { | ||
48 | return $this->issueService->subCompany(); | ||
49 | } | ||
50 | |||
51 | } |
1 | <?php | ||
2 | |||
3 | namespace App\Http\Controllers\Release; | ||
4 | |||
5 | use App\Helper\CacheKeyTools; | ||
6 | use App\Helper\Response; | ||
7 | use App\Http\Controllers\Controller; | ||
8 | use GuzzleHttp\Client; | ||
9 | use Illuminate\Support\Facades\Cache; | ||
10 | use Illuminate\Support\Facades\Log; | ||
11 | |||
12 | |||
13 | class BaseController extends Controller | ||
14 | { | ||
15 | /** | ||
16 | * 基础变量 | ||
17 | * @var string | ||
18 | */ | ||
19 | protected $domain, $appId; | ||
20 | private $appSecret; | ||
21 | protected $client; | ||
22 | |||
23 | public function __construct() | ||
24 | { | ||
25 | $this->domain = env('TME_DOMAIN','https://openapi-sit.tencentmusic.com'); | ||
26 | $this->appId = env('TME_APPID','47820741'); | ||
27 | $this->appSecret = env('TME_APPSECRET','nPWFDDHKYCP4bUzoq9zyaJQx4ltQqMSs'); | ||
28 | $this->client = new Client(['verify'=>false]); | ||
29 | } | ||
30 | |||
31 | /**获取accessToken | ||
32 | */ | ||
33 | function getToken() | ||
34 | { | ||
35 | $url = rtrim($this->domain,'/').'/oauth2/token'; | ||
36 | $data = ['appId'=>$this->appId,'appSecret'=>$this->appSecret]; | ||
37 | try { | ||
38 | $response = $this->client->request('POST', $url, ['json' => $data]); | ||
39 | |||
40 | $respArr = json_decode($response->getBody()->getContents(), true); | ||
41 | Log::channel('api')->info(__METHOD__, $respArr); | ||
42 | if (0 !== (int)$respArr['code']) { | ||
43 | return null; | ||
44 | } else { | ||
45 | $res = $respArr['data']; | ||
46 | Cache::put(CacheKeyTools::tmeAccessToken(), $res['accessToken'], ($res['expire'] ?? 900) - 100); // 加入缓存 | ||
47 | return $res['accessToken']; | ||
48 | } | ||
49 | } catch (\Exception $e) { | ||
50 | Log::channel('api')->error(__METHOD__, ['msg'=>$e->getMessage()]); | ||
51 | return null; | ||
52 | } | ||
53 | } | ||
54 | |||
55 | /** | ||
56 | * 重组请求数据,返回headers | ||
57 | * @return array | ||
58 | */ | ||
59 | private function parseHeaders(array $params) | ||
60 | { | ||
61 | if (!$accessToken = Cache::get(CacheKeyTools::tmeAccessToken())) { | ||
62 | $accessToken = $this->getToken(); | ||
63 | } | ||
64 | $heaers['appId'] = $this->appId; | ||
65 | $heaers['accessToken'] = $accessToken; | ||
66 | $heaers['timestamp'] = (string)date('YmdHis'); | ||
67 | $heaers['traceId'] = 'hk_'.(string)time(); | ||
68 | $heaers['signMethod'] = 'md5'; | ||
69 | $heaers['sign'] = $this->getSign($heaers,$params); | ||
70 | return $heaers; | ||
71 | } | ||
72 | |||
73 | /** | ||
74 | * 请求接口 | ||
75 | * @throws \GuzzleHttp\Exception\GuzzleException | ||
76 | */ | ||
77 | protected function doApi(string $uri, array $reqData = [], string $method = 'POST', bool $isLocal = false) | ||
78 | { | ||
79 | $url = rtrim($this->domain,'/').'/'.ltrim($uri,'/'); | ||
80 | try { | ||
81 | if ($isLocal) { | ||
82 | $data_file = database_path('Release/'.last(explode("/",$uri)).'.query.php'); | ||
83 | $params = include("$data_file"); | ||
84 | } else { | ||
85 | $params = $reqData; | ||
86 | } | ||
87 | $params['tmeBrandId'] = $params['tmeBrandId'] ?? 8888888; | ||
88 | Log::channel('api')->info(__METHOD__, $params); | ||
89 | // var_dump(json_encode($params,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); //请求参数 | ||
90 | $headers = $this->parseHeaders($params); | ||
91 | switch (strtoupper($method)) { | ||
92 | case 'GET': | ||
93 | $response = $this->client->request('GET', $url, ['query' => $params,'headers'=>$headers]); | ||
94 | break; | ||
95 | case 'POST': | ||
96 | default: | ||
97 | $response = $this->client->request('POST', $url, ['json' => $params,'headers'=>$headers]); | ||
98 | break; | ||
99 | } | ||
100 | $respArr = json_decode($response->getBody()->getContents(), true); | ||
101 | |||
102 | Log::channel('api')->info(__METHOD__, $respArr); | ||
103 | if ($respArr['code'] == '0'){ | ||
104 | return [(int)$respArr['code'],$respArr['message'] ?? '操作失败',$respArr['data'] ?? []]; | ||
105 | } else { | ||
106 | return [(int)$respArr['code'],$respArr['message'] ?? '操作失败',[$respArr['traceId']]]; | ||
107 | } | ||
108 | } catch (\Exception $e) { | ||
109 | Log::channel('api')->error(__METHOD__, ['msg'=>$e->getMessage()]); | ||
110 | return [-1,'接口请求失败',[]]; | ||
111 | } | ||
112 | } | ||
113 | |||
114 | |||
115 | /** | ||
116 | * 获取签名和去空的参数 | ||
117 | * @param array $array | ||
118 | */ | ||
119 | protected function getSign($heaers,$params) | ||
120 | { | ||
121 | $common_params = array_merge($params,$heaers); | ||
122 | |||
123 | ksort($common_params); | ||
124 | $params = ''; | ||
125 | |||
126 | foreach ($common_params as $k=>$v) | ||
127 | { | ||
128 | if ('' === $v || null === $v || [] === $v) { | ||
129 | continue; | ||
130 | } | ||
131 | if (is_array($v)) { | ||
132 | $params .= $k . json_encode($this->handleSubArrayNumber($v), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); | ||
133 | } else { | ||
134 | $params .= $k . $v; | ||
135 | } | ||
136 | } | ||
137 | // Log::channel('api')->info($params); | ||
138 | return strtoupper(md5($this->appSecret . $params . $this->appSecret)); | ||
139 | } | ||
140 | |||
141 | /** | ||
142 | * 签名需要,递归处理子数组中Int型数字转换成字符串 | ||
143 | * @param array $array | ||
144 | * @return array | ||
145 | */ | ||
146 | private function handleSubArrayNumber(array $array) | ||
147 | { | ||
148 | foreach ($array as $k=>$v) { | ||
149 | if (is_array($v)) { | ||
150 | // ksort($v); | ||
151 | $array[$k] = $this->handleSubArrayNumber($v); | ||
152 | } else { | ||
153 | $array = array_filter($array, function ($item) { | ||
154 | if ($item === '' || $item === null) { | ||
155 | return false; | ||
156 | } else { | ||
157 | return true; | ||
158 | } | ||
159 | }); | ||
160 | } | ||
161 | } | ||
162 | return $array; | ||
163 | } | ||
164 | } |
1 | <?php | ||
2 | |||
3 | namespace App\Http\Controllers\Release; | ||
4 | |||
5 | use App\Helper\Response; | ||
6 | use Illuminate\Http\Request; | ||
7 | |||
8 | |||
9 | class WorkController extends BaseController | ||
10 | { | ||
11 | /** | ||
12 | * 上传文件 | ||
13 | * @param Request $request | ||
14 | */ | ||
15 | public function Upload(Request $request) | ||
16 | { | ||
17 | // dd(basename($request->getRequestUri())); | ||
18 | list($code,$msg,$data) = $this->doApi('/invests/content/upload',$request->all()); | ||
19 | if ($code === 0) { | ||
20 | return Response::success($data); | ||
21 | } else { | ||
22 | return Response::error($code,$msg,$data); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | /** 提交专辑 | ||
27 | * @param Request $request | ||
28 | */ | ||
29 | public function albumOnline(Request $request) | ||
30 | { | ||
31 | list($code,$msg,$data) = $this->doApi('/invests/content/commitContent',$request->all()); | ||
32 | if ($code === 0) { | ||
33 | return Response::success($data); | ||
34 | } else { | ||
35 | return Response::error($code,$msg,$data); | ||
36 | } | ||
37 | } | ||
38 | |||
39 | /**搜索歌手 | ||
40 | * @param Request $request | ||
41 | */ | ||
42 | public function searchSinger(Request $request) | ||
43 | { | ||
44 | list($code,$msg,$data) = $this->doApi('/invests/content/searchSinger',$request->all()); | ||
45 | if ($code === 0) { | ||
46 | return Response::success($data); | ||
47 | } else { | ||
48 | return Response::error($code,$msg,$data); | ||
49 | } | ||
50 | } | ||
51 | |||
52 | /** //创建艺人,直接机器审核 | ||
53 | * @param Request $request | ||
54 | */ | ||
55 | public function createSinger(Request $request) | ||
56 | { | ||
57 | //修改上传的图片url | ||
58 | $singer_param = $request->all(); | ||
59 | $file_name = trim(head(explode('?',$singer_param['singerPic']))); //去掉签名 | ||
60 | $param = [ | ||
61 | 'type' =>'0', | ||
62 | 'fileUrl' =>$singer_param['singerPic'] ?? '', | ||
63 | 'fileName' =>last(explode('/',$file_name)) ?? '艺人头像.jpg', | ||
64 | ]; | ||
65 | list($code,$msg,$data) = $this->doApi('/invests/content/upload',$param); | ||
66 | $pic_url = $data['fileUrl'] ?? ''; | ||
67 | if($pic_url){ | ||
68 | $singer_param['singerPic'] = $pic_url; | ||
69 | list($code,$msg,$data) = $this->doApi('/invests/content/createSinger',$singer_param); | ||
70 | if ($code === 0) { | ||
71 | return Response::success(array_merge($data,['singer_pic'=>$pic_url])); | ||
72 | } else { | ||
73 | return Response::error($code,$msg,$data); | ||
74 | } | ||
75 | } | ||
76 | return Response::error($code,$msg,$data); | ||
77 | } | ||
78 | |||
79 | /**该接口目前没有使用,艺人创建失败继续提交,不需要修改 | ||
80 | * @param Request $request | ||
81 | */ | ||
82 | public function modifySinger(Request $request) | ||
83 | { | ||
84 | list($code,$msg,$data) = $this->doApi('/invests/content/modifySinger',$request->all()); | ||
85 | if ($code === 0) { | ||
86 | return Response::success($data); | ||
87 | } else { | ||
88 | return Response::error($code,$msg,$data); | ||
89 | } | ||
90 | } | ||
91 | |||
92 | /** 原始版权方 | ||
93 | * @param Request $request | ||
94 | */ | ||
95 | public function originalCompanyQuery(Request $request) | ||
96 | { | ||
97 | list($code,$msg,$data) = $this->doApi('/invests/content/queryOriginalCopyrightCompanyList',$request->all()); | ||
98 | if ($code === 0) { | ||
99 | return Response::success($data); | ||
100 | } else { | ||
101 | return Response::error($code,$msg,$data); | ||
102 | } | ||
103 | } | ||
104 | |||
105 | /**查询发行的歌曲id接口 | ||
106 | * @param Request $request | ||
107 | */ | ||
108 | public function queryComitResult(Request $request) | ||
109 | { | ||
110 | list($code,$msg,$data) = $this->doApi('/invests/content/queryComitResult',$request->all()); | ||
111 | if ($code === 0) { | ||
112 | return Response::success($data); | ||
113 | } else { | ||
114 | return Response::error($code,$msg,$data); | ||
115 | } | ||
116 | } | ||
117 | |||
118 | |||
119 | |||
120 | |||
121 | } |
... | @@ -3,6 +3,7 @@ | ... | @@ -3,6 +3,7 @@ |
3 | namespace App\Http; | 3 | namespace App\Http; |
4 | 4 | ||
5 | use App\Http\Middleware\AuthIdentifier; | 5 | use App\Http\Middleware\AuthIdentifier; |
6 | use Fruitcake\Cors\HandleCors; | ||
6 | use Illuminate\Foundation\Http\Kernel as HttpKernel; | 7 | use Illuminate\Foundation\Http\Kernel as HttpKernel; |
7 | 8 | ||
8 | class Kernel extends HttpKernel | 9 | class Kernel extends HttpKernel |
... | @@ -17,7 +18,7 @@ class Kernel extends HttpKernel | ... | @@ -17,7 +18,7 @@ class Kernel extends HttpKernel |
17 | protected $middleware = [ | 18 | protected $middleware = [ |
18 | // \App\Http\Middleware\TrustHosts::class, | 19 | // \App\Http\Middleware\TrustHosts::class, |
19 | \App\Http\Middleware\TrustProxies::class, | 20 | \App\Http\Middleware\TrustProxies::class, |
20 | \Fruitcake\Cors\HandleCors::class, | 21 | HandleCors::class, |
21 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, | 22 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, |
22 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, | 23 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, |
23 | \App\Http\Middleware\TrimStrings::class, | 24 | \App\Http\Middleware\TrimStrings::class, | ... | ... |
... | @@ -6,7 +6,9 @@ use App\Helper\AesEncrypt; | ... | @@ -6,7 +6,9 @@ use App\Helper\AesEncrypt; |
6 | use App\Helper\ErrorCode; | 6 | use App\Helper\ErrorCode; |
7 | use App\Helper\Identifier; | 7 | use App\Helper\Identifier; |
8 | use App\Helper\Response; | 8 | use App\Helper\Response; |
9 | use App\Helper\Snowflake; | ||
9 | use App\Models\Legal\Stakeholder; | 10 | use App\Models\Legal\Stakeholder; |
11 | use App\Models\Musician\AppCompany; | ||
10 | use Closure; | 12 | use Closure; |
11 | use Illuminate\Http\Request; | 13 | use Illuminate\Http\Request; |
12 | use Illuminate\Support\Facades\Log; | 14 | use Illuminate\Support\Facades\Log; |
... | @@ -30,6 +32,9 @@ class AuthIdentifier | ... | @@ -30,6 +32,9 @@ class AuthIdentifier |
30 | */ | 32 | */ |
31 | public function handle(Request $request, Closure $next) | 33 | public function handle(Request $request, Closure $next) |
32 | { | 34 | { |
35 | //增加额外属性 | ||
36 | $request->attributes->add(['request_id' => Snowflake::gen(),]); | ||
37 | |||
33 | $prefix = current(explode('/', $request->path())); | 38 | $prefix = current(explode('/', $request->path())); |
34 | if (!in_array($prefix, $this->auth)) goto AUTH; | 39 | if (!in_array($prefix, $this->auth)) goto AUTH; |
35 | 40 | ||
... | @@ -55,8 +60,8 @@ class AuthIdentifier | ... | @@ -55,8 +60,8 @@ class AuthIdentifier |
55 | if (empty($stakeholder_ids)) return Response::error(ErrorCode::MATCH_IDENTIFIER_FAIL); | 60 | if (empty($stakeholder_ids)) return Response::error(ErrorCode::MATCH_IDENTIFIER_FAIL); |
56 | 61 | ||
57 | $request->attributes->add([ | 62 | $request->attributes->add([ |
58 | 'identifier' => $identifier, | 63 | 'identifier' => $identifier, |
59 | 'stakeholder_ids' => $stakeholder_ids, | 64 | 'stakeholder_ids' => $stakeholder_ids, |
60 | ]); | 65 | ]); |
61 | 66 | ||
62 | AUTH: | 67 | AUTH: | ... | ... |
... | @@ -33,7 +33,7 @@ class Stakeholder extends BaseModel | ... | @@ -33,7 +33,7 @@ class Stakeholder extends BaseModel |
33 | case 1: | 33 | case 1: |
34 | //个人 | 34 | //个人 |
35 | $stakeholder= Stakeholder::query()->join('stakeholder_detail as sd', 'stakeholders.id', '=', 'sd.stakeholder_id') | 35 | $stakeholder= Stakeholder::query()->join('stakeholder_detail as sd', 'stakeholders.id', '=', 'sd.stakeholder_id') |
36 | ->where(['stakeholders.card_no'=>$identifier->identifier])->pluck('stakeholders.id')->toArray(); | 36 | ->where(['stakeholders.card_no'=>$identifier->identifier, 'type'=>1])->pluck('stakeholders.id')->toArray(); |
37 | break; | 37 | break; |
38 | case 2: | 38 | case 2: |
39 | $stakeholder = Stakeholder::query()->where(['type' => 2, 'credit_code' => $identifier->identifier])->pluck('id')->toArray(); | 39 | $stakeholder = Stakeholder::query()->where(['type' => 2, 'credit_code' => $identifier->identifier])->pluck('id')->toArray(); | ... | ... |
app/Models/Musician/AppCompany.php
0 → 100644
1 | <?php | ||
2 | |||
3 | namespace App\Models\Musician; | ||
4 | |||
5 | use App\Models\BaseModel; | ||
6 | use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
7 | |||
8 | /** | ||
9 | * Class AppCompany | ||
10 | * @package App\Models\Musician | ||
11 | */ | ||
12 | class AppCompany extends BaseModel | ||
13 | { | ||
14 | use HasFactory; | ||
15 | |||
16 | /** | ||
17 | * @var string | ||
18 | */ | ||
19 | protected $connection = 'musician'; | ||
20 | |||
21 | /** | ||
22 | * @var string | ||
23 | */ | ||
24 | protected $table = 'app_company'; | ||
25 | |||
26 | |||
27 | } |
... | @@ -38,7 +38,8 @@ class RouteServiceProvider extends ServiceProvider | ... | @@ -38,7 +38,8 @@ class RouteServiceProvider extends ServiceProvider |
38 | $this->configureRateLimiting(); | 38 | $this->configureRateLimiting(); |
39 | 39 | ||
40 | $this->routes(function () { | 40 | $this->routes(function () { |
41 | //需授权 | 41 | |
42 | //音乐人 | ||
42 | Route::prefix('api') | 43 | Route::prefix('api') |
43 | ->middleware('api') | 44 | ->middleware('api') |
44 | ->namespace($this->namespace . '\Musician') | 45 | ->namespace($this->namespace . '\Musician') |
... | @@ -54,6 +55,11 @@ class RouteServiceProvider extends ServiceProvider | ... | @@ -54,6 +55,11 @@ class RouteServiceProvider extends ServiceProvider |
54 | Route::middleware('web') | 55 | Route::middleware('web') |
55 | ->namespace($this->namespace) | 56 | ->namespace($this->namespace) |
56 | ->group(base_path('routes/web.php')); | 57 | ->group(base_path('routes/web.php')); |
58 | |||
59 | //发行接口 - 对接生态平台 | ||
60 | Route::prefix('release') | ||
61 | ->namespace($this->namespace . '\Release') | ||
62 | ->group(base_path('routes/release.php')); | ||
57 | }); | 63 | }); |
58 | } | 64 | } |
59 | 65 | ... | ... |
app/Services/IssueService.php
0 → 100644
1 | <?php | ||
2 | |||
3 | namespace App\Services; | ||
4 | |||
5 | use App\Helper\AesEncrypt; | ||
6 | use App\Helper\ErrorCode; | ||
7 | use App\Helper\Response; | ||
8 | use App\Models\Legal\Stakeholder; | ||
9 | use App\Models\Legal\Subject; | ||
10 | use Illuminate\Support\Facades\Log; | ||
11 | |||
12 | /** | ||
13 | * Class IssueService | ||
14 | * @package App\Services | ||
15 | */ | ||
16 | class IssueService extends Service | ||
17 | { | ||
18 | /** | ||
19 | * 转发 | ||
20 | * @return \Illuminate\Http\JsonResponse | ||
21 | */ | ||
22 | public function forward() | ||
23 | { | ||
24 | $client = new \GuzzleHttp\Client([ | ||
25 | 'base_uri' => env('resource_url'), | ||
26 | 'timeout' => 3.0, | ||
27 | ]); | ||
28 | |||
29 | try { | ||
30 | |||
31 | $params['data'] = $this->request->all(); | ||
32 | $params['ext'] = [ | ||
33 | 'user_id' => $this->identifier->company_id, | ||
34 | 'operator' => $this->identifier->user_id, | ||
35 | 'stakeholder_ids' => $this->stakeholder_ids, | ||
36 | ]; | ||
37 | |||
38 | $data = ['params' => AesEncrypt::encrypt(json_encode($params))]; | ||
39 | $response = $client->post($this->request->getRequestUri(), [ | ||
40 | 'json' => $data, | ||
41 | ]); | ||
42 | $respArr = json_decode($response->getBody()->getContents(), true); | ||
43 | |||
44 | $respArr['msg'] = $respArr['message']; | ||
45 | unset($respArr['message']); | ||
46 | |||
47 | Log::info(__METHOD__.':请求返回体', ['respArr'=>$respArr, 'data'=>$data, 'uri'=>$client->post($this->request->getRequestUri())]); | ||
48 | |||
49 | return response()->json($respArr, 200); | ||
50 | } catch (\Throwable $throwable) { | ||
51 | return Response::error(ErrorCode::SERVER_ERROR, $throwable->getMessage()); | ||
52 | } | ||
53 | } | ||
54 | |||
55 | /** | ||
56 | * 版权方 | ||
57 | * @return \Illuminate\Http\JsonResponse | ||
58 | */ | ||
59 | public function subCompany() | ||
60 | { | ||
61 | $company_ids = Stakeholder::query()->whereIn('id', $this->stakeholder_ids)->pluck('company_id')->toArray(); | ||
62 | $subject = Subject::query()->whereIn('company_id', $company_ids)->get(['no as value', 'name']); | ||
63 | |||
64 | return Response::success($subject); | ||
65 | |||
66 | } | ||
67 | |||
68 | |||
69 | } |
... | @@ -2,6 +2,7 @@ | ... | @@ -2,6 +2,7 @@ |
2 | 2 | ||
3 | namespace App\Services; | 3 | namespace App\Services; |
4 | 4 | ||
5 | use App\Helper\Snowflake; | ||
5 | use Carbon\Carbon; | 6 | use Carbon\Carbon; |
6 | use Illuminate\Http\Request; | 7 | use Illuminate\Http\Request; |
7 | 8 | ||
... | @@ -12,6 +13,16 @@ use Illuminate\Http\Request; | ... | @@ -12,6 +13,16 @@ use Illuminate\Http\Request; |
12 | class Service | 13 | class Service |
13 | { | 14 | { |
14 | /** | 15 | /** |
16 | * @var Request | ||
17 | */ | ||
18 | protected $request; | ||
19 | |||
20 | /** | ||
21 | * @var mixed | ||
22 | */ | ||
23 | protected $user_id; | ||
24 | |||
25 | /** | ||
15 | * @var mixed | 26 | * @var mixed |
16 | */ | 27 | */ |
17 | protected $identifier; | 28 | protected $identifier; | ... | ... |
This diff could not be displayed because it is too large.
... | @@ -114,6 +114,7 @@ return [ | ... | @@ -114,6 +114,7 @@ return [ |
114 | 'bills_confirm' => 'serial:#serial_no#', | 114 | 'bills_confirm' => 'serial:#serial_no#', |
115 | 'bills_settle_no' => 'bills:settle:no', | 115 | 'bills_settle_no' => 'bills:settle:no', |
116 | 'districts' => 'districts', | 116 | 'districts' => 'districts', |
117 | 'tme_access_token' => 'tme_access_token' | ||
117 | ] | 118 | ] |
118 | 119 | ||
119 | ]; | 120 | ]; | ... | ... |
... | @@ -4,31 +4,57 @@ return [ | ... | @@ -4,31 +4,57 @@ return [ |
4 | 4 | ||
5 | /* | 5 | /* |
6 | |-------------------------------------------------------------------------- | 6 | |-------------------------------------------------------------------------- |
7 | | Cross-Origin Resource Sharing (CORS) Configuration | 7 | | Laravel CORS Options |
8 | |-------------------------------------------------------------------------- | 8 | |-------------------------------------------------------------------------- |
9 | | | 9 | | |
10 | | Here you may configure your settings for cross-origin resource sharing | 10 | | The allowed_methods and allowed_headers options are case-insensitive. |
11 | | or "CORS". This determines what cross-origin operations may execute | ||
12 | | in web browsers. You are free to adjust these settings as needed. | ||
13 | | | 11 | | |
14 | | To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS | 12 | | You don't need to provide both allowed_origins and allowed_origins_patterns. |
13 | | If one of the strings passed matches, it is considered a valid origin. | ||
14 | | | ||
15 | | If ['*'] is provided to allowed_methods, allowed_origins or allowed_headers | ||
16 | | all methods / origins / headers are allowed. | ||
15 | | | 17 | | |
16 | */ | 18 | */ |
17 | 19 | ||
18 | 'paths' => ['api/*', 'sanctum/csrf-cookie'], | 20 | /* |
21 | * You can enable CORS for 1 or multiple paths. | ||
22 | * Example: ['api/*'] | ||
23 | */ | ||
24 | 'paths' => ['api/*', 'release/*'], | ||
19 | 25 | ||
26 | /* | ||
27 | * Matches the request method. `['*']` allows all methods. | ||
28 | */ | ||
20 | 'allowed_methods' => ['*'], | 29 | 'allowed_methods' => ['*'], |
21 | 30 | ||
31 | /* | ||
32 | * Matches the request origin. `['*']` allows all origins. Wildcards can be used, eg `*.mydomain.com` | ||
33 | */ | ||
22 | 'allowed_origins' => ['*'], | 34 | 'allowed_origins' => ['*'], |
23 | 35 | ||
36 | /* | ||
37 | * Patterns that can be used with `preg_match` to match the origin. | ||
38 | */ | ||
24 | 'allowed_origins_patterns' => [], | 39 | 'allowed_origins_patterns' => [], |
25 | 40 | ||
41 | /* | ||
42 | * Sets the Access-Control-Allow-Headers response header. `['*']` allows all headers. | ||
43 | */ | ||
26 | 'allowed_headers' => ['*'], | 44 | 'allowed_headers' => ['*'], |
27 | 45 | ||
46 | /* | ||
47 | * Sets the Access-Control-Expose-Headers response header with these headers. | ||
48 | */ | ||
28 | 'exposed_headers' => [], | 49 | 'exposed_headers' => [], |
29 | 50 | ||
51 | /* | ||
52 | * Sets the Access-Control-Max-Age response header when > 0. | ||
53 | */ | ||
30 | 'max_age' => 0, | 54 | 'max_age' => 0, |
31 | 55 | ||
56 | /* | ||
57 | * Sets the Access-Control-Allow-Credentials header. | ||
58 | */ | ||
32 | 'supports_credentials' => false, | 59 | 'supports_credentials' => false, |
33 | |||
34 | ]; | 60 | ]; | ... | ... |
... | @@ -113,7 +113,13 @@ return [ | ... | @@ -113,7 +113,13 @@ return [ |
113 | 'driver' => 'daily', | 113 | 'driver' => 'daily', |
114 | 'path' => storage_path('logs/laravel-api.log'), | 114 | 'path' => storage_path('logs/laravel-api.log'), |
115 | 'level' => env('LOG_LEVEL', 'debug'), | 115 | 'level' => env('LOG_LEVEL', 'debug'), |
116 | ] | 116 | ], |
117 | |||
118 | 'issue' => [ | ||
119 | 'driver' => 'daily', | ||
120 | 'path' => storage_path('logs/issue/issue.log'), | ||
121 | 'level' => env('LOG_LEVEL', 'debug'), | ||
122 | ], | ||
117 | ], | 123 | ], |
118 | 124 | ||
119 | ]; | 125 | ]; | ... | ... |
database/release/commitContent.query.php
0 → 100644
1 | <?php | ||
2 | //注1:空值不能填null,会造成签名错误,填空字符串 | ||
3 | //注2:int格式为空时,key不传,不能填默认值0 | ||
4 | return | ||
5 | [ | ||
6 | 'cmsAlbumId'=>'379', | ||
7 | // 'albumId'=>75266, | ||
8 | 'albumName'=>'测试专辑9', | ||
9 | 'version'=>'0', | ||
10 | 'translationName'=>'', | ||
11 | 'albumPic'=>'/operations/imgs/cos_8f4730c6-88c0-4d94-a6fc-6695dfef134eimg.jpg', | ||
12 | 'albumPicName'=>'封面.jpg', | ||
13 | 'albumSingers'=>[ | ||
14 | [ | ||
15 | 'centralSingerId'=>16357449, | ||
16 | 'orderIndex'=>0, | ||
17 | 'singerName'=>'赵聪' | ||
18 | ], | ||
19 | [ | ||
20 | 'centralSingerId'=>186470, | ||
21 | 'singerName'=>'王琪', | ||
22 | 'orderIndex'=>1 | ||
23 | ] | ||
24 | ], | ||
25 | 'albumType'=>'0', | ||
26 | 'albumArea'=>'5', | ||
27 | 'language'=>'0', | ||
28 | 'albumUpc'=>'', | ||
29 | 'brandIdOut'=>10086, | ||
30 | 'brandShowName'=>'外显公司', | ||
31 | 'brandId'=>105737, | ||
32 | 'brandName'=>'冰曲文化', | ||
33 | 'issuedTime'=>'2023-02-11 18:00:00', | ||
34 | 'onlineTime'=>'2023-02-11 18:00:00', | ||
35 | 'introduction'=>'专辑简介', | ||
36 | 'genreList'=>[ | ||
37 | [ | ||
38 | 'firstGenre'=>'2', | ||
39 | 'secondGenre'=>'201' | ||
40 | ] | ||
41 | ], | ||
42 | 'firstGenre'=>'2', | ||
43 | 'secondGenre'=>'201', | ||
44 | 'authFiles'=>[ | ||
45 | [ | ||
46 | 'materialName'=>'pdf.pdf', //物料名称 | ||
47 | 'materialUrl'=>'/operations/imgs/cos_ea2db81e-bbc0-4cbe-bc53-5fe375b19827pdf.pdf', //物料播放地址 | ||
48 | 'materialPlayUrl'=>'/operations/imgs/cos_ea2db81e-bbc0-4cbe-bc53-5fe375b19827pdf.pdf', //物料播放地址 | ||
49 | 'materialType'=>'1', //物料类型 | ||
50 | 'fileType'=>'1', //物料类型 fileType | ||
51 | 'fileMD5'=>strtoupper(md5('/operations/imgs/cos_ea2db81e-bbc0-4cbe-bc53-5fe375b19827pdf.pdf')), //物料类型 | ||
52 | ] | ||
53 | ], | ||
54 | 'tracks'=>[ | ||
55 | [ | ||
56 | 'cmsTrackId'=>'123', | ||
57 | 'trackName'=>'新歌', | ||
58 | 'version'=>'', | ||
59 | 'trackTitle'=>'新歌', // 副标题 | ||
60 | 'translationName'=>'', | ||
61 | 'centralSingerId'=>16357449, | ||
62 | 'centralSingerName'=>'赵聪', | ||
63 | 'trackSingers'=>[ | ||
64 | [ | ||
65 | 'centralSingerId'=>16357449, | ||
66 | 'singerName'=>'赵聪', | ||
67 | 'orderIndex'=>0 | ||
68 | ], | ||
69 | [ | ||
70 | 'centralSingerId'=>186470, | ||
71 | 'singerName'=>'王琪', | ||
72 | 'orderIndex'=>1 | ||
73 | ] | ||
74 | ], | ||
75 | 'cdNo'=>'0', | ||
76 | 'language'=>'0', | ||
77 | 'firstGenre'=>'2', | ||
78 | 'secondGenre'=>'201', | ||
79 | 'trackExtend'=>[ | ||
80 | 'lyricsText'=>'张三', | ||
81 | 'lyricsIds'=>[ | ||
82 | [ | ||
83 | 'centralSingerId'=>1, | ||
84 | 'singerName'=>'张三' | ||
85 | ] | ||
86 | ], | ||
87 | 'composingText'=>'张三|王五', | ||
88 | 'composingIds'=>[], | ||
89 | 'arrangementText'=>'', | ||
90 | 'arrangementIds'=>[], | ||
91 | 'producerText'=>'', | ||
92 | 'producerIds'=>[] | ||
93 | ], | ||
94 | 'genreList'=>[ | ||
95 | [ | ||
96 | 'firstGenre'=>'2', | ||
97 | 'secondGenre'=>'201' | ||
98 | ] | ||
99 | ], | ||
100 | 'trackRepresent'=>[ | ||
101 | 'materialUrl'=>'111', | ||
102 | 'materialName'=>'授权书', | ||
103 | 'materialType'=>'1', | ||
104 | 'materialPlayUrl'=>'23444', | ||
105 | 'fileMD5'=>'12346789000888', | ||
106 | 'fileType'=>'1' | ||
107 | ], | ||
108 | 'recordingCopyright'=>[ | ||
109 | 'originalCopyrightId'=>5874, | ||
110 | 'originalCopyrightName'=>'武汉海酝文化有限公司', | ||
111 | 'copyrightStartTime'=>'2022-05-01 00:00:00', | ||
112 | 'copyrightEndTime'=>'2023-05-01 00:00:00', | ||
113 | 'authArea'=>'5', | ||
114 | 'authAreaList'=>['5'], | ||
115 | 'authForm'=>'3', | ||
116 | 'authRelationship'=>'1', | ||
117 | 'firstPeriod'=>'2022-05-17 00:00:00', | ||
118 | 'lyricsShare'=>100, | ||
119 | 'lyricsRightsFlag'=>'1', | ||
120 | 'wyyCopyrightEndTime'=>'', | ||
121 | 'copyrightStatus'=>'', | ||
122 | 'copyrightFileList'=>[ | ||
123 | [ | ||
124 | 'materialName'=>'pdf.pdf', | ||
125 | 'materialUrl'=>'/operations/imgs/cos_ea2db81e-bbc0-4cbe-bc53-5fe375b19827pdf.pdf', | ||
126 | 'materialType'=>'1', | ||
127 | 'materialPlayUrl'=>'/operations/imgs/cos_ea2db81e-bbc0-4cbe-bc53-5fe375b19827pdf.pdf', | ||
128 | 'fileType'=>'1', | ||
129 | 'fileMD5'=>strtoupper(md5('/operations/imgs/cos_ea2db81e-bbc0-4cbe-bc53-5fe375b19827pdf.pdf')) | ||
130 | ] | ||
131 | ], | ||
132 | 'originalContractNo'=>'', | ||
133 | 'contractNo'=>'', | ||
134 | ], | ||
135 | 'lyricsCopyright'=>[ | ||
136 | [ | ||
137 | 'originalCopyrightId'=>5874, | ||
138 | 'originalCopyrightName'=>'武汉海酝文化有限公司', | ||
139 | 'copyrightStartTime'=>'2022-05-01 00:00:00', | ||
140 | 'copyrightEndTime'=>'2023-05-01 00:00:00', | ||
141 | 'authArea'=>'5', | ||
142 | 'authAreaList'=>['5'], | ||
143 | 'authForm'=>'3', | ||
144 | 'authRelationship'=>'1', | ||
145 | 'firstPeriod'=>'', | ||
146 | 'lyricsShare'=>100, | ||
147 | 'lyricsRightsFlag'=>'1', | ||
148 | 'wyyCopyrightEndTime'=>'', | ||
149 | 'copyrightStatus'=>'', | ||
150 | 'copyrightFileList'=>[ | ||
151 | [ | ||
152 | 'materialName'=>'pdf.pdf', | ||
153 | 'materialUrl'=>'/operations/imgs/cos_ea2db81e-bbc0-4cbe-bc53-5fe375b19827pdf.pdf', | ||
154 | 'materialType'=>'1', | ||
155 | 'materialPlayUrl'=>'/operations/imgs/cos_ea2db81e-bbc0-4cbe-bc53-5fe375b19827pdf.pdf', | ||
156 | 'fileType'=>'1', | ||
157 | 'fileMD5'=>'123009988' | ||
158 | ] | ||
159 | ], | ||
160 | 'canCover'=>1, | ||
161 | 'originalContractNo'=>'', | ||
162 | 'contractNo'=>'', | ||
163 | 'canCoverConditions'=>1 | ||
164 | ] | ||
165 | ], | ||
166 | 'composingCopyright'=>[ | ||
167 | [ | ||
168 | 'originalCopyrightId'=>5874, | ||
169 | 'originalCopyrightName'=>'武汉海酝文化有限公司', | ||
170 | 'copyrightStartTime'=>'2022-05-01 00:00:00', | ||
171 | 'copyrightEndTime'=>'2023-05-01 00:00:00', | ||
172 | 'authArea'=>'5', | ||
173 | 'authAreaList'=>['5'], | ||
174 | 'authForm'=>'3', | ||
175 | 'authRelationship'=>'1', | ||
176 | 'firstPeriod'=>'', | ||
177 | 'lyricsShare'=>100, | ||
178 | 'lyricsRightsFlag'=>'1', | ||
179 | 'wyyCopyrightEndTime'=>'', | ||
180 | 'copyrightStatus'=>'', | ||
181 | 'copyrightFileList'=>[ | ||
182 | [ | ||
183 | 'materialName'=>'pdf.pdf', | ||
184 | 'materialUrl'=>'/operations/imgs/cos_ea2db81e-bbc0-4cbe-bc53-5fe375b19827pdf.pdf', | ||
185 | 'materialType'=>'1', | ||
186 | 'materialPlayUrl'=>'/operations/imgs/cos_ea2db81e-bbc0-4cbe-bc53-5fe375b19827pdf.pdf', | ||
187 | 'fileType'=>'1', | ||
188 | 'fileMD5'=>'123009988' | ||
189 | ] | ||
190 | ], | ||
191 | 'canCover'=>1, | ||
192 | 'originalContractNo'=>'', | ||
193 | 'contractNo'=>'', | ||
194 | 'canCoverConditions'=>1 | ||
195 | ] | ||
196 | ], | ||
197 | 'instruments'=>[], | ||
198 | 'isrc'=>'', | ||
199 | 'iswc'=>'', | ||
200 | 'issuedTime'=>'2023-02-11 18:00:00', | ||
201 | 'onlineTime'=>'2023-02-11 18:00:00', | ||
202 | 'adFlag'=>1, | ||
203 | 'lyric'=>'----歌词内容---', | ||
204 | 'haveLyric'=>1, | ||
205 | 'lyricHead'=>'歌词头内容', | ||
206 | 'dynamicLyricsFlag'=>'0', | ||
207 | 'payPattern'=>'2', | ||
208 | 'payMode'=>'2', | ||
209 | 'orderIndex'=>0, | ||
210 | ] | ||
211 | ] | ||
212 | ]; |
database/release/createSinger.query.php
0 → 100644
1 | <?php | ||
2 | return [ | ||
3 | 'singerName' =>'柚火梓XP',//艺人名' | ||
4 | // 'singerName' =>'柚木梓SR',//艺人名R | ||
5 | 'brandId' =>123456, | ||
6 | 'brandName' =>'测试公司', | ||
7 | // 'singerPic' => 'https://tupian.qqw21.com/article/UploadPic/2019-10/2019101520442288760.jpg', | ||
8 | 'singerPic' => 'https://uploadfile.huiyi8.com/up/4e/ed/95/4eed95bc3f7daa8f55c71cd73abe2f8e.png', | ||
9 | 'singerDesc' =>'歌手描述1', | ||
10 | 'singerType' =>1, //0男,1女,2组合,3其他,4影视,5虚拟,6综艺,7团体 | ||
11 | 'singerRole' =>[ | ||
12 | 0,1,2 | ||
13 | ], //0歌手,1音乐人,2DJ,3声优,4曲艺家,5主播,6UGC,7演奏家,8指挥家,9作词,10作曲,11编曲,12制作人,13演员,14主持人,15其他,16混音师,17歌唱家,18乐团,19录音,20母带,21吉他,22贝斯,23键盘/合成器,24鼓,25小提琴,26大提琴 | ||
14 | 'area' =>'1', //0港台,1内地,2日韩,3欧美,4其他,5东南亚,6未知 | ||
15 | 'translateName' =>'', | ||
16 | 'creator' =>'11' | ||
17 | ]; |
database/release/modifySinger.query.php
0 → 100644
1 | <?php | ||
2 | return [ | ||
3 | 'singerId' =>15836187, | ||
4 | 'singerName' =>'柚木梓XP',//艺人名' | ||
5 | 'brandId' =>1223, | ||
6 | 'brandName' =>'测试公司', | ||
7 | 'singerPic' =>'https://tupian.qqw21.com/article/UploadPic/2019-10/2019101520442288760.jpg', | ||
8 | 'singerDesc' =>'我改变下我的描述', | ||
9 | 'singerType' =>0, //0男,1女,2组合,3其他,4影视,5虚拟,6综艺,7团体 | ||
10 | 'singerRole' =>[ | ||
11 | 0,1,2 | ||
12 | ], //0歌手,1音乐人,2DJ,3声优,4曲艺家,5主播,6UGC,7演奏家,8指挥家,9作词,10作曲,11编曲,12制作人,13演员,14主持人,15其他,16混音师,17歌唱家,18乐团,19录音,20母带,21吉他,22贝斯,23键盘/合成器,24鼓,25小提琴,26大提琴 | ||
13 | 'area' =>'1', //0港台,1内地,2日韩,3欧美,4其他,5东南亚,6未知 | ||
14 | 'translateName' =>'', | ||
15 | 'creator' =>'11' | ||
16 | ]; | ||
17 |
database/release/queryComitResult.query.php
0 → 100644
database/release/searchSinger.query.php
0 → 100644
database/release/upload.query.php
0 → 100644
1 | <?php | ||
2 | return [ | ||
3 | 'fileUrl' => 'https://legal-1305250541.cos.ap-shanghai.myqcloud.com/material_test/tme/pdf.pdf?q-sign-algorithm=sha1&q-ak=AKIDsWu1tUr7JI1TlqgFXaNt87pFOGtFK8gx&q-sign-time=1652769055%3B1652812315&q-key-time=1652769055%3B1652812315&q-header-list=&q-url-param-list=&q-signature=06f94750474880cb5ae8d8a2728791a30639863e', | ||
4 | 'type' => '1', //文件类型: 0:图片 1:授权文件 2:音频 3:歌词 4:视频 | ||
5 | 'fileName' => 'pdf.pdf', | ||
6 | ]; | ||
7 | |||
8 | |||
9 | # 图1 material_test/tme/img.jpg | ||
10 | |||
11 | # 文件2 material_test/tme/pdf.pdf | ||
12 | |||
13 | # 音频 material_test/tme/audio.wav | ||
14 | |||
15 | # txt material_test/tme/lyric.txt | ||
16 | |||
17 | # MP4 material_test/tme/video.mp4 | ||
18 |
... | @@ -50,7 +50,17 @@ Route::group([], function (){ | ... | @@ -50,7 +50,17 @@ Route::group([], function (){ |
50 | 50 | ||
51 | }); | 51 | }); |
52 | 52 | ||
53 | //发行 | ||
54 | Route::group(["prefix"=>"issue"], function (){ | ||
55 | Route::post('/album/subCompany', 'IssueController@subCompany'); | ||
56 | Route::post('{uri}', 'IssueController@index')->where(['uri'=>'.*+']); | ||
57 | }); | ||
58 | |||
59 | |||
53 | //api-v2 | 60 | //api-v2 |
54 | Route::group(["prefix"=>"v2", "namespace"=>"V2"], function (){ | 61 | Route::group(["prefix"=>"v2", "namespace"=>"V2"], function (){ |
55 | Route::get('musician_song', 'MusicianSongController@list'); | 62 | Route::get('musician_song', 'MusicianSongController@list'); |
56 | }); | 63 | }); |
64 | |||
65 | |||
66 | ... | ... |
routes/release.php
0 → 100644
1 | <?php | ||
2 | |||
3 | use Illuminate\Support\Facades\Route; | ||
4 | |||
5 | /* | ||
6 | |-------------------------------------------------------------------------- | ||
7 | | API Routes | ||
8 | |-------------------------------------------------------------------------- | ||
9 | | | ||
10 | | Here is where you can register API routes for your application. These | ||
11 | | routes are loaded by the RouteServiceProvider within a group which | ||
12 | | is assigned the "api" middleware group. Enjoy building your API! | ||
13 | | | ||
14 | */ | ||
15 | Route::get('/',function(){ | ||
16 | return 'Welcome To Release Api !!!'; | ||
17 | }); | ||
18 | |||
19 | /** | ||
20 | * Tme接口 | ||
21 | */ | ||
22 | Route::group(['middleware'=>'throttle:60,1','prefix'=> 'tme'], function (){ | ||
23 | |||
24 | // 提交发行接口 | ||
25 | Route::post('upload','WorkController@Upload'); //上传接口 | ||
26 | Route::post('album_online','WorkController@albumOnline'); //提交发行接口 | ||
27 | |||
28 | Route::post('singer_query','WorkController@searchSinger'); //搜索歌手接口 | ||
29 | Route::post('singer_create','WorkController@createSinger'); //创建歌手接口 | ||
30 | Route::post('singer_modify','WorkController@modifySinger'); //修改歌手接口 | ||
31 | Route::post('original_company_query','WorkController@originalCompanyQuery'); //查询原始版权方接口 | ||
32 | |||
33 | // 发行后接口 | ||
34 | Route::post('issue_album_query','WorkController@queryComitResult'); //查询发行的歌曲tmeId列表接口 | ||
35 | |||
36 | }); |
-
Please register or sign in to post a comment