ChannelController.php 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Support\Facades\Log;
  5. use Illuminate\Support\Arr;
  6. use Illuminate\Support\Facades\DB;
  7. use App\Models\Channel;
  8. use App\Models\Sentence;
  9. use App\Models\DhammaTerm;
  10. use App\Models\WbwBlock;
  11. use App\Models\PaliSentence;
  12. use App\Models\CustomBook;
  13. use App\Http\Controllers\AuthController;
  14. use App\Http\Resources\ChannelResource;
  15. use App\Http\Api\AuthApi;
  16. use App\Http\Api\StudioApi;
  17. use App\Http\Api\ShareApi;
  18. use App\Http\Api\PaliTextApi;
  19. use App\Http\Api\ChannelApi;
  20. class ChannelController extends Controller
  21. {
  22. /**
  23. * Display a listing of the resource.
  24. *
  25. * @return \Illuminate\Http\Response
  26. */
  27. public function index(Request $request)
  28. {
  29. //
  30. $result=false;
  31. $indexCol = ['uid','name','summary',
  32. 'type','owner_uid','lang',
  33. 'status','is_system','updated_at','created_at'];
  34. switch ($request->get('view')) {
  35. case 'public':
  36. $table = Channel::select($indexCol)
  37. ->where('status',30);
  38. break;
  39. case 'studio':
  40. # 获取studio内所有channel
  41. $user = AuthApi::current($request);
  42. if(!$user){
  43. return $this->error(__('auth.failed'));
  44. }
  45. //判断当前用户是否有指定的studio的权限
  46. $studioId = StudioApi::getIdByName($request->get('name'));
  47. if($user['user_uid'] !== $studioId){
  48. return $this->error(__('auth.failed'));
  49. }
  50. $table = Channel::select($indexCol);
  51. if($request->get('view2','my')==='my'){
  52. $table = $table->where('owner_uid', $studioId);
  53. }else{
  54. //协作
  55. $resList = ShareApi::getResList($studioId,2);
  56. $resId=[];
  57. foreach ($resList as $res) {
  58. $resId[] = $res['res_id'];
  59. }
  60. $table = $table->whereIn('uid', $resId);
  61. if($request->get('collaborator','all') !== 'all'){
  62. $table = $table->where('owner_uid', $request->get('collaborator'));
  63. }else{
  64. $table = $table->where('owner_uid','<>', $studioId);
  65. }
  66. }
  67. break;
  68. case 'studio-all':
  69. /**
  70. * studio 的和协作的
  71. */
  72. #获取user所有有权限的channel列表
  73. $user = AuthApi::current($request);
  74. if(!$user){
  75. return $this->error(__('auth.failed'));
  76. }
  77. //判断当前用户是否有指定的studio的权限
  78. if($user['user_uid'] !== StudioApi::getIdByName($request->get('name'))){
  79. return $this->error(__('auth.failed'));
  80. }
  81. $channelById = [];
  82. $channelId = [];
  83. //获取共享channel
  84. $allSharedChannels = ShareApi::getResList($user['user_uid'],2);
  85. foreach ($allSharedChannels as $key => $value) {
  86. # code...
  87. $channelId[] = $value['res_id'];
  88. $channelById[$value['res_id']] = $value;
  89. }
  90. $table = Channel::select($indexCol)
  91. ->whereIn('uid', $channelId)
  92. ->orWhere('owner_uid',$user['user_uid']);
  93. break;
  94. case 'user-edit':
  95. /**
  96. * 某用户有编辑权限的
  97. */
  98. #获取user所有有权限的channel列表
  99. $user = AuthApi::current($request);
  100. if(!$user){
  101. return $this->error(__('auth.failed'));
  102. }
  103. $channelById = [];
  104. $channelId = [];
  105. //获取共享channel
  106. $allSharedChannels = ShareApi::getResList($user['user_uid'],2);
  107. foreach ($allSharedChannels as $key => $value) {
  108. # code...
  109. if($value['power']>=20){
  110. $channelId[] = $value['res_id'];
  111. $channelById[$value['res_id']] = $value;
  112. }
  113. }
  114. $table = Channel::select($indexCol)
  115. ->whereIn('uid', $channelId)
  116. ->orWhere('owner_uid',$user['user_uid']);
  117. break;
  118. case 'user-in-chapter':
  119. #获取user 在某章节 所有有权限的channel列表
  120. $user = AuthApi::current($request);
  121. if(!$user){
  122. return $this->error(__('auth.failed'));
  123. }
  124. $channelById = [];
  125. $channelId = [];
  126. //获取共享channel
  127. $allSharedChannels = ShareApi::getResList($user['user_uid'],2);
  128. foreach ($allSharedChannels as $key => $value) {
  129. # code...
  130. $channelId[] = $value['res_id'];
  131. $channelById[$value['res_id']] = $value;
  132. }
  133. //获取全网公开channel
  134. $chapter = PaliTextApi::getChapterStartEnd($request->get('book'),$request->get('para'));
  135. $publicChannelsWithContent = Sentence::where('book_id',$request->get('book'))
  136. ->whereBetween('paragraph',$chapter)
  137. ->where('strlen','>',0)
  138. ->where('status',30)
  139. ->groupBy('channel_uid')
  140. ->select('channel_uid')
  141. ->get();
  142. foreach ($publicChannelsWithContent as $key => $value) {
  143. # code...
  144. $value['res_id']=$value->channel_uid;
  145. $value['power'] = 10;
  146. $value['type'] = 2;
  147. if(!isset($channelById[$value['res_id']])){
  148. $channelId[] = $value['res_id'];
  149. $channelById[$value['res_id']] = $value;
  150. }
  151. }
  152. $table = Channel::select($indexCol)
  153. ->whereIn('uid', $channelId)
  154. ->orWhere('owner_uid',$user['user_uid']);
  155. break;
  156. case 'system':
  157. $table = Channel::select($indexCol)
  158. ->where('owner_uid',config("mint.admin.root_uuid"));
  159. break;
  160. }
  161. //处理搜索
  162. if($request->has("search")){
  163. $table = $table->where('name', 'like', "%".$request->get("search")."%");
  164. }
  165. if($request->has("type")){
  166. $table = $table->where('type', $request->get("type"));
  167. }
  168. //获取记录总条数
  169. $count = $table->count();
  170. //处理排序
  171. $table = $table->orderBy($request->get("order",'created_at'),
  172. $request->get("dir",'desc'));
  173. //处理分页
  174. $table = $table->skip($request->get("offset",0))
  175. ->take($request->get("limit",200));
  176. //获取数据
  177. $result = $table->get();
  178. //TODO 将下面代码转移到resource
  179. if($result){
  180. if($request->has('progress')){
  181. //获取进度
  182. //获取单句长度
  183. $sentLen = PaliSentence::where('book',$request->get('book'))
  184. ->whereBetween('paragraph',$chapter)
  185. ->orderBy('word_begin')
  186. ->select(['book','paragraph','word_begin','word_end','length'])
  187. ->get();
  188. }
  189. foreach ($result as $key => $value) {
  190. if($request->has('progress')){
  191. //获取进度
  192. $finalTable = Sentence::where('book_id',$request->get('book'))
  193. ->whereBetween('paragraph',$chapter)
  194. ->where('channel_uid',$value->uid)
  195. ->where('strlen','>',0)
  196. ->select(['strlen','book_id','paragraph','word_start','word_end']);
  197. if($finalTable->count()>0){
  198. $finished = $finalTable->get();
  199. $final=[];
  200. foreach ($sentLen as $sent) {
  201. # code...
  202. $first = Arr::first($finished, function ($value, $key) use($sent) {
  203. return ($value->book_id==$sent->book &&
  204. $value->paragraph==$sent->paragraph &&
  205. $value->word_start==$sent->word_begin &&
  206. $value->word_end==$sent->word_end);
  207. });
  208. $final[] = [$sent->length,$first?true:false];
  209. }
  210. $value['final'] = $final;
  211. }
  212. }
  213. //角色
  214. if(isset($user['user_uid'])){
  215. if($value->owner_uid===$user['user_uid']){
  216. $value['role'] = 'owner';
  217. }else{
  218. if(isset($channelById[$value->uid])){
  219. switch ($channelById[$value->uid]['power']) {
  220. case 10:
  221. # code...
  222. $value['role'] = 'member';
  223. break;
  224. case 20:
  225. $value['role'] = 'editor';
  226. break;
  227. case 30:
  228. $value['role'] = 'owner';
  229. break;
  230. default:
  231. # code...
  232. $value['role'] = $channelById[$value->uid]['power'];
  233. break;
  234. }
  235. }
  236. }
  237. }
  238. # 获取studio信息
  239. $value->studio = StudioApi::getById($value->owner_uid);
  240. }
  241. return $this->ok(["rows"=>$result,"count"=>$count]);
  242. }else{
  243. return $this->error("没有查询到数据");
  244. }
  245. }
  246. /**
  247. * 获取我的,和协作channel数量
  248. *
  249. * @return \Illuminate\Http\Response
  250. */
  251. public function showMyNumber(Request $request){
  252. $user = AuthApi::current($request);
  253. if(!$user){
  254. return $this->error(__('auth.failed'));
  255. }
  256. //判断当前用户是否有指定的studio的权限
  257. $studioId = StudioApi::getIdByName($request->get('studio'));
  258. if($user['user_uid'] !== $studioId){
  259. return $this->error(__('auth.failed'));
  260. }
  261. //我的
  262. $my = Channel::where('owner_uid', $studioId)->count();
  263. //协作
  264. $resList = ShareApi::getResList($studioId,2);
  265. $resId=[];
  266. foreach ($resList as $res) {
  267. $resId[] = $res['res_id'];
  268. }
  269. $collaboration = Channel::whereIn('uid', $resId)->where('owner_uid','<>', $studioId)->count();
  270. return $this->ok(['my'=>$my,'collaboration'=>$collaboration]);
  271. }
  272. /**
  273. * 获取章节的进度
  274. *
  275. * @param \Illuminate\Http\Request $request
  276. * @return \Illuminate\Http\Response
  277. */
  278. public function progress(Request $request){
  279. $indexCol = ['uid','name','summary','type','owner_uid','lang','status','updated_at','created_at'];
  280. $sent = $request->get('sentence') ;
  281. $query = [];
  282. $queryWithChannel = [];
  283. $sentContainer = [];
  284. $sentLenContainer = [];
  285. $paliChannel = ChannelApi::getSysChannel('_System_Pali_VRI_');
  286. $customBookChannel = array();
  287. foreach ($sent as $value) {
  288. $ids = explode('-',$value);
  289. $idWithChannel = $ids;
  290. if(count($ids)===4){
  291. if($ids[0] < 1000){
  292. $idWithChannel[] = $paliChannel;
  293. }else{
  294. if(!isset($customBookChannel[$ids[0]])){
  295. $cbChannel = CustomBook::where('book_id',$ids[0])->value('channel_id');
  296. if($cbChannel){
  297. $customBookChannel[$ids[0]] = $cbChannel;
  298. }else{
  299. $customBookChannel[$ids[0]] = $paliChannel;
  300. }
  301. }
  302. $idWithChannel[] = $customBookChannel[$ids[0]];
  303. }
  304. $sentContainer[$value] = false;
  305. $query[] = $ids;
  306. $queryWithChannel[] = $idWithChannel;
  307. }
  308. }
  309. //获取单句长度
  310. if(count($query)>0){
  311. $table = Sentence::whereIns(['book_id','paragraph','word_start','word_end','channel_uid'],$queryWithChannel)
  312. ->select(['book_id','paragraph','word_start','word_end','strlen']);
  313. $sentLen = $table->get();
  314. foreach ($sentLen as $value) {
  315. $strlen = $value->strlen;
  316. if(empty($strlen)){
  317. $strlen = 0;
  318. }
  319. $sentId = "{$value->book_id}-{$value->paragraph}-{$value->word_start}-{$value->word_end}";
  320. $sentLenContainer[$sentId] = $strlen;
  321. }
  322. }
  323. $channelById = [];
  324. $channelId = [];
  325. //获取全网公开的有译文的channel
  326. if($request->get('owner')==='all' || $request->get('owner')==='public'){
  327. if(count($query)>0){
  328. $publicChannelsWithContent = Sentence::whereIns(['book_id','paragraph','word_start','word_end'],$query)
  329. ->where('strlen','>',0)
  330. ->where('status',30)
  331. ->groupBy('channel_uid')
  332. ->select('channel_uid')
  333. ->get();
  334. foreach ($publicChannelsWithContent as $key => $value) {
  335. # code...
  336. $value['res_id']=$value->channel_uid;
  337. $value['power'] = 10;
  338. $value['type'] = 2;
  339. if(!isset($channelById[$value['res_id']])){
  340. $channelId[] = $value['res_id'];
  341. $channelById[$value['res_id']] = $value;
  342. }
  343. }
  344. }
  345. }
  346. #获取 user 在某章节 所有有权限的 channel 列表
  347. $user = AuthApi::current($request);
  348. if($user !== false){
  349. //我自己的
  350. if($request->get('owner')==='all' || $request->get('owner')==='my'){
  351. $my = Channel::select($indexCol)->where('owner_uid', $user['user_uid'])->get();
  352. foreach ($my as $key => $value) {
  353. $channelId[] = $value->uid;
  354. $channelById[$value->uid] = ['res_id'=>$value->uid,
  355. 'power'=>30,
  356. 'type'=>2,
  357. ];
  358. }
  359. }
  360. //获取共享channel
  361. if($request->get('owner')==='all' || $request->get('owner')==='collaborator'){
  362. $allSharedChannels = ShareApi::getResList($user['user_uid'],2);
  363. foreach ($allSharedChannels as $key => $value) {
  364. # code...
  365. if(!in_array($value['res_id'],$channelId)){
  366. $channelId[] = $value['res_id'];
  367. $channelById[$value['res_id']] = $value;
  368. }
  369. }
  370. }
  371. }
  372. //所有有这些句子译文的channel
  373. if(count($query) > 0){
  374. $allChannels = Sentence::whereIns(['book_id','paragraph','word_start','word_end'],$query)
  375. ->where('strlen','>',0)
  376. ->groupBy('channel_uid')
  377. ->select('channel_uid')
  378. ->get();
  379. }
  380. //所有需要查询的channel
  381. $table = Channel::select(['uid','name','summary','type','owner_uid','lang','status','updated_at','created_at'])
  382. ->whereIn('uid', $channelId);
  383. if($user !== false){
  384. $table->orWhere('owner_uid',$user['user_uid']);
  385. }
  386. $result = $table->get();
  387. foreach ($result as $key => $value) {
  388. //角色
  389. if($user!==false && $value->owner_uid===$user['user_uid']){
  390. $value['role'] = 'owner';
  391. }else{
  392. if(isset($channelById[$value->uid])){
  393. switch ($channelById[$value->uid]['power']) {
  394. case 10:
  395. # code...
  396. $value['role'] = 'member';
  397. break;
  398. case 20:
  399. $value['role'] = 'editor';
  400. break;
  401. case 30:
  402. $value['role'] = 'owner';
  403. break;
  404. default:
  405. # code...
  406. $value['role'] = $channelById[$value->uid]['power'];
  407. break;
  408. }
  409. }
  410. }
  411. # 获取studio信息
  412. $result[$key]["studio"] = \App\Http\Api\StudioApi::getById($value->owner_uid);
  413. //获取进度
  414. if(count($query) > 0){
  415. $currChannelId = $value->uid;
  416. $hasContent = Arr::first($allChannels, function ($value, $key) use($currChannelId) {
  417. return ($value->channel_uid===$currChannelId);
  418. });
  419. if($hasContent && count($query)>0){
  420. $finalTable = Sentence::whereIns(['book_id','paragraph','word_start','word_end'],$query)
  421. ->where('channel_uid',$currChannelId)
  422. ->where('strlen','>',0)
  423. ->select(['strlen','book_id','paragraph','word_start','word_end','created_at','updated_at']);
  424. $created_at = time();
  425. $edit_at = 0;
  426. if($finalTable->count()>0){
  427. $finished = $finalTable->get();
  428. $currChannel = [];
  429. foreach ($finished as $rowFinish) {
  430. $createTime = strtotime($rowFinish->created_at);
  431. $updateTime = strtotime($rowFinish->updated_at);
  432. if($createTime < $created_at){
  433. $created_at = $createTime;
  434. }
  435. if($updateTime > $edit_at){
  436. $edit_at = $updateTime;
  437. }
  438. $currChannel["{$rowFinish->book_id}-{$rowFinish->paragraph}-{$rowFinish->word_start}-{$rowFinish->word_end}"] = 1;
  439. }
  440. $final=[];
  441. foreach ($sentContainer as $sentId=>$rowSent) {
  442. # code...
  443. if(isset($currChannel[$sentId])){
  444. $final[] = [$sentLenContainer[$sentId],true];
  445. }else{
  446. $final[] = [$sentLenContainer[$sentId],false];
  447. }
  448. }
  449. $result[$key]['final'] = $final;
  450. $result[$key]['content_created_at'] = date('Y-m-d H:i:s',$created_at);
  451. $result[$key]['content_updated_at'] = date('Y-m-d H:i:s',$edit_at);
  452. }
  453. }
  454. }
  455. }
  456. return $this->ok(["rows"=>$result,count($result)]);
  457. }
  458. /**
  459. * Store a newly created resource in storage.
  460. *
  461. * @param \Illuminate\Http\Request $request
  462. * @return \Illuminate\Http\Response
  463. */
  464. public function store(Request $request)
  465. {
  466. //
  467. $user = AuthApi::current($request);
  468. if($user){
  469. return $this->error(__('auth.failed'),401,401);
  470. }
  471. //判断当前用户是否有指定的studio的权限
  472. if($user['user_uid'] === StudioApi::getIdByName($request->get('studio'))){
  473. return $this->error(__('auth.failed'),403,403);
  474. }
  475. //查询是否重复
  476. if(Channel::where('name',$request->get('name'))
  477. ->where('owner_uid',$user['user_uid'])
  478. ->exists()){
  479. return $this->error(__('validation.exists',['name']),200,200);
  480. }
  481. $channel = new Channel;
  482. $channel->id = app('snowflake')->id();
  483. $channel->name = $request->get('name');
  484. $channel->owner_uid = $user['user_uid'];
  485. $channel->type = $request->get('type');
  486. $channel->lang = $request->get('lang');
  487. $channel->editor_id = $user['user_id'];
  488. $channel->create_time = time()*1000;
  489. $channel->modify_time = time()*1000;
  490. $channel->save();
  491. return $this->ok($channel);
  492. }
  493. /**
  494. * Display the specified resource.
  495. *
  496. * @param int $id
  497. * @return \Illuminate\Http\Response
  498. */
  499. public function show($id)
  500. {
  501. //
  502. $indexCol = ['uid','name','summary','type','owner_uid','lang','is_system','status','updated_at','created_at'];
  503. $channel = Channel::where("uid",$id)->select($indexCol)->first();
  504. $studio = StudioApi::getById($channel->owner_uid);
  505. $channel->studio = $studio;
  506. $channel->owner_info = ['nickname'=>$studio['nickName'],'username'=>$studio['realName']];
  507. return $this->ok($channel);
  508. }
  509. /**
  510. * Display the specified resource.
  511. *
  512. * @param string $name
  513. * @return \Illuminate\Http\Response
  514. */
  515. public function showByName(string $name)
  516. {
  517. //
  518. $indexCol = ['uid','name','summary','type','owner_uid','lang','is_system','status','updated_at','created_at'];
  519. $channel = Channel::where("name",$name)->select($indexCol)->first();
  520. if($channel){
  521. return $this->ok(new ChannelResource($channel));
  522. }else{
  523. return $this->error('no channel');
  524. }
  525. }
  526. /**
  527. * Update the specified resource in storage.
  528. *
  529. * @param \Illuminate\Http\Request $request
  530. * @param \App\Models\Channel $channel
  531. * @return \Illuminate\Http\Response
  532. */
  533. public function update(Request $request, Channel $channel)
  534. {
  535. //鉴权
  536. $user = AuthApi::current($request);
  537. if(!$user){
  538. return $this->error(__('auth.failed'),401,401);
  539. }
  540. if($channel->is_system){
  541. return $this->error('system channel',403,403);
  542. }
  543. if($channel->owner_uid !== $user["user_uid"]){
  544. //判断是否为协作
  545. $power = ShareApi::getResPower($user["user_uid"],$request->get('id'));
  546. if($power < 30){
  547. return $this->error(__('auth.failed'),403,403);
  548. }
  549. }
  550. $channel->name = $request->get('name');
  551. $channel->type = $request->get('type');
  552. $channel->summary = $request->get('summary');
  553. $channel->lang = $request->get('lang');
  554. $channel->status = $request->get('status');
  555. $channel->save();
  556. return $this->ok($channel);
  557. }
  558. /**
  559. * patch the specified resource in storage.
  560. *
  561. * @param \Illuminate\Http\Request $request
  562. * @param \App\Models\Channel $channel
  563. * @return \Illuminate\Http\Response
  564. */
  565. public function patch(Request $request, Channel $channel)
  566. {
  567. //鉴权
  568. $user = AuthApi::current($request);
  569. if(!$user){
  570. return $this->error(__('auth.failed'),[],401);
  571. }
  572. if($channel->is_system){
  573. return $this->error('system channel',403,403);
  574. }
  575. if($channel->owner_uid !== $user["user_uid"]){
  576. //判断是否为协作
  577. $power = ShareApi::getResPower($user["user_uid"],$request->get('id'));
  578. if($power < 30){
  579. return $this->error(__('auth.failed'),[],403);
  580. }
  581. }
  582. if($request->has('name')){$channel->name = $request->get('name');}
  583. if($request->has('type')){$channel->type = $request->get('type');}
  584. if($request->has('summary')){$channel->summary = $request->get('summary');}
  585. if($request->has('lang')){$channel->lang = $request->get('lang');}
  586. if($request->has('status')){$channel->status = $request->get('status');}
  587. if($request->has('config')){$channel->status = $request->get('config');}
  588. $channel->save();
  589. return $this->ok($channel);
  590. }
  591. /**
  592. * Remove the specified resource from storage.
  593. * @param \Illuminate\Http\Request $request
  594. * @param \App\Models\Channel $channel
  595. * @return \Illuminate\Http\Response
  596. */
  597. public function destroy(Request $request,Channel $channel)
  598. {
  599. //
  600. $user = AuthApi::current($request);
  601. if(!$user){
  602. return $this->error(__('auth.failed'));
  603. }
  604. //判断当前用户是否有指定的studio的权限
  605. if($user['user_uid'] !== $channel->owner_uid){
  606. return $this->error(__('auth.failed'));
  607. }
  608. //查询其他资源
  609. if(Sentence::where("channel_uid",$channel->uid)->exists()){
  610. return $this->error("译文有数据无法删除");
  611. }
  612. if(DhammaTerm::where("channal",$channel->uid)->exists()){
  613. return $this->error("术语有数据无法删除");
  614. }
  615. if(WbwBlock::where("channel_uid",$channel->uid)->exists()){
  616. return $this->error("逐词解析有数据无法删除");
  617. }
  618. $delete = 0;
  619. DB::transaction(function() use($channel,$delete){
  620. //TODO 删除相关资源
  621. $delete = $channel->delete();
  622. });
  623. return $this->ok($delete);
  624. }
  625. }