去掉背调多余代码

This commit is contained in:
wyn
2026-06-05 11:27:11 +08:00
parent 654d57c7ee
commit 752494dbdb
2 changed files with 12 additions and 113 deletions

View File

@@ -6,24 +6,19 @@ use app\common\service\AuthorBackgroundService;
use think\Controller;
/**
* 作者背调 API前后端分离返回 JSON
* 作者背调HTML 报告页 + JSON API
*
* 主接口background_report / due_diligenceORCID 必填)
* Scopus 相关接口委托 AuthorInfo 实现
* 主接口:index / background_report / due_diligence
*/
class Author extends Controller
{
/** @var AuthorBackgroundService */
private $bgService;
/** @var AuthorInfo */
private $authorInfo;
public function __construct(\think\Request $request = null)
{
parent::__construct($request);
$this->bgService = new AuthorBackgroundService();
$this->authorInfo = new AuthorInfo();
$this->bgService = new AuthorBackgroundService();
}
/**
@@ -123,99 +118,12 @@ class Author extends Controller
]);
}
/** camelCase 别名 */
public function backgroundReport()
{
return $this->background_report();
}
/** 与 background_report 相同(路由兼容) */
public function due_diligence()
{
return $this->background_report();
}
public function dueDiligence()
{
return $this->due_diligence();
}
/**
* OpenAlex + Crossref 诚信扫描(不依赖 ORCID 必填)
*/
public function background_check()
{
return $this->authorInfo->background_check();
}
public function backgroundCheck()
{
return $this->background_check();
}
public function get_hindex()
{
return $this->authorInfo->get_hindex();
}
public function getHindex()
{
return $this->get_hindex();
}
public function get_scopus_id()
{
return $this->authorInfo->get_scopus_id();
}
public function getScopusId()
{
return $this->get_scopus_id();
}
public function check_scopus_cookie()
{
return $this->authorInfo->check_scopus_cookie();
}
public function checkScopusCookie()
{
return $this->check_scopus_cookie();
}
public function save_scopus_cookie()
{
return $this->authorInfo->save_scopus_cookie();
}
public function saveScopusCookie()
{
return $this->save_scopus_cookie();
}
public function login_scopus()
{
return $this->authorInfo->login_scopus();
}
public function loginScopus()
{
return $this->login_scopus();
}
public function check_elsevier_api()
{
if (method_exists($this->authorInfo, 'check_elsevier_api')) {
return $this->authorInfo->check_elsevier_api();
}
return json(['code' => 0, 'msg' => 'check_elsevier_api not implemented']);
}
public function checkElsevierApi()
{
return $this->check_elsevier_api();
}
/**
* 解析背调查询参数(兼容多种命名)
*/

View File

@@ -18,23 +18,14 @@ return [
':name' => ['index/hello', ['method' => 'post']],
],
// Author 背调 / Scopus(兼容 /api/author/ 与 /api/Author/
'api/author/index' => 'api/Author/index',
'api/author/background_report' => 'api/Author/background_report',
'api/author/due_diligence' => 'api/Author/due_diligence',
'api/author/background_check' => 'api/Author/background_check',
'api/author/get_hindex' => 'api/Author/get_hindex',
'api/author/get_scopus_id' => 'api/Author/get_scopus_id',
'api/author/check_scopus_cookie' => 'api/Author/check_scopus_cookie',
'api/author/check_elsevier_api' => 'api/Author/check_elsevier_api',
'api/Author/index' => 'api/Author/index',
'api/Author/background_report' => 'api/Author/background_report',
'api/Author/backgroundReport' => 'api/Author/background_report',
'api/Author/due_diligence' => 'api/Author/due_diligence',
'api/Author/dueDiligence' => 'api/Author/due_diligence',
'api/Author/background_check' => 'api/Author/background_check',
'api/Author/get_hindex' => 'api/Author/get_hindex',
'api/Author/get_scopus_id' => 'api/Author/get_scopus_id',
'api/Author/check_elsevier_api' => 'api/Author/check_elsevier_api',
// Author 背调(兼容 /api/author/ 与 /api/Author/
'api/author/index' => 'api/Author/index',
'api/author/background_report' => 'api/Author/background_report',
'api/author/due_diligence' => 'api/Author/due_diligence',
'api/Author/index' => 'api/Author/index',
'api/Author/background_report' => 'api/Author/background_report',
'api/Author/backgroundReport' => 'api/Author/background_report',
'api/Author/due_diligence' => 'api/Author/due_diligence',
'api/Author/dueDiligence' => 'api/Author/due_diligence',
];