自动查重
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\TurnitinService;
|
||||
use think\Db;
|
||||
use think\Response;
|
||||
use app\common\PlagiarismService;
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* 论文查重(Turnitin / Crossref Similarity Check)控制器。
|
||||
@@ -51,7 +53,6 @@ class Plagiarism extends Base
|
||||
$localPath = $fileUrl !== ''
|
||||
? $svc->resolveFileUrlToLocal($fileUrl)
|
||||
: $svc->locateArticleManuscript($articleId);
|
||||
echo $localPath;
|
||||
$checkId = $svc->submit($articleId, $localPath, $editorId, 'manual');
|
||||
return jsonSuccess(['check_id' => $checkId]);
|
||||
} catch (\Throwable $e) {
|
||||
@@ -60,12 +61,28 @@ class Plagiarism extends Base
|
||||
}
|
||||
|
||||
|
||||
public function testccone(){
|
||||
/**
|
||||
* 调试:与线上一致走队列链(upload → wait ingest → trigger → poll),需 worker 消费 plagiarism 队列。
|
||||
*/
|
||||
public function testccone()
|
||||
{
|
||||
$svc = new PlagiarismService();
|
||||
$checkId = 9;
|
||||
$filePath = "/home/wwwroot/api.tmrjournals.com/public/manuscirpt/20260509/6832a56e8ace38fe99df390ab5221deb.docx";
|
||||
$svc->runUploadAndTrigger($checkId,$filePath);
|
||||
$filePath = '/home/wwwroot/api.tmrjournals.com/public/manuscirpt/20260509/6832a56e8ace38fe99df390ab5221deb.docx';
|
||||
$svc->runUploadOnly($checkId, $filePath);
|
||||
}
|
||||
|
||||
public function testcconegetstatus(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$tii = new TurnitinService();
|
||||
$res = $tii->getSubmission($data['id']);
|
||||
return jsonSuccess($res);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user