- Remove unused methods.

This commit is contained in:
caoyanyi
2023-12-16 17:16:06 +08:00
parent 1d04c38fc0
commit f9c9a997e3
9 changed files with 21 additions and 132 deletions
+3 -16
View File
@@ -12,18 +12,6 @@
class gogsModel extends model
{
/**
* Get a gogs by id.
*
* @param int $id
* @access public
* @return object
*/
public function getByID($id)
{
return $this->loadModel('pipeline')->getByID($id);
}
/**
* Get gogs list.
*
@@ -59,7 +47,7 @@ class gogsModel extends model
*/
public function getApiRoot($gogsID)
{
$gogs = $this->getByID($gogsID);
$gogs = $this->fetchByID($gogsID);
if(!$gogs) return '';
return rtrim($gogs->url, '/') . '/api/v1%s' . "?token={$gogs->token}";
@@ -290,8 +278,7 @@ class gogsModel extends model
$project->http_url_to_repo = $project->html_url;
$project->name_with_namespace = $project->full_name;
$gogs = $this->getByID($gogsID);
$oauth = "{$gogs->token}@";
$gogs = $this->fetchByID($gogsID);
$project->tokenCloneUrl = preg_replace('/(http(s)?:\/\/)/', '${1}' . $gogs->token . '@', $project->html_url);
}
@@ -463,7 +450,7 @@ class gogsModel extends model
$branch = json_decode(commonModel::http($url));
if($branch)
{
$gogs = $this->getByID($gogsID);
$gogs = $this->fetchByID($gogsID);
$branch->web_url = "{$gogs->url}/$project/src/$branchName";
}