自动推广

This commit is contained in:
wangjinlei
2026-04-03 11:45:45 +08:00
parent 22947a56a4
commit a802b2e923
11 changed files with 2240 additions and 36 deletions

View File

@@ -8,6 +8,8 @@ use think\Queue;
use think\Validate;
use PhpOffice\PhpWord\IOFactory;
use app\common\OpenAi;
use app\common\CrossrefService;
use app\common\PubmedService;
/**
* @title 文章接口
@@ -17,9 +19,17 @@ class Article extends Base
{
/**
* @var CrossrefService
*/
private $crossService;
private $pubmedService;
public function __construct(\think\Request $request = null)
{
parent::__construct($request);
$this->crossService = new CrossrefService();
$this->pubmedService = new PubmedService();
}
@@ -169,16 +179,6 @@ class Article extends Base
return jsonSuccess($re);
}
public function myttt()
{
$res = $this->addProductionEx("3689");
echo "<pre>";
var_dump($res);
echo "</pre>";
die;
}
/**获取预接收内容状态
* @return void
*/
@@ -1053,6 +1053,36 @@ class Article extends Base
}
}
public function testCheckArticleCitation()
{
$data = $this->request->post();
$rule = new Validate([
"article_id"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$mains = $this->article_main_obj->where("article_id",$data['article_id'])->where("state",0)->select();
$production = $this->production_article_obj->where("article_id",$data['article_id'])->find();
$refers = $this->production_article_refer_obj->where("p_article_id",$production['p_article_id'])->where("state",0)->order("index asc")->select();
$res = $this->crossService->qcArticleCitations($mains,$refers);
return jsonSuccess(['res'=>$res]);
}
public function testCheckArticlePubmed()
{
$data = $this->request->post();
$rule = new Validate([
"doi"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$res = $this->pubmedService->fetchByDoi($data['doi']);
return jsonSuccess(['res'=>$res]);
}
/**
* @title 发送留言板消息
* @description 发送留言板消息
@@ -3940,7 +3970,14 @@ class Article extends Base
public function ffff(){
$data = $this->request->post();
$this->ai_scor($data['article_id']);
$rule = new Validate([
"doi"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$res = $this->crossService->fetchWorkSummary($data['doi']);
return jsonSuccess($res);
}