2024-12-02 10:26:51 +01:00
|
|
|
package main
|
|
|
|
|
2024-12-04 08:55:40 +01:00
|
|
|
import (
|
|
|
|
"src.opensuse.org/autogits/common"
|
|
|
|
"src.opensuse.org/autogits/common/gitea-generated/models"
|
|
|
|
)
|
|
|
|
|
2024-12-02 10:26:51 +01:00
|
|
|
//go:generate mockgen -source=pr.go -destination=mock/pr.go -typed
|
|
|
|
|
2024-12-04 08:55:40 +01:00
|
|
|
type GiteaPRInterface interface {
|
|
|
|
GetAssociatedPrjGitPR(org, repo string, id int) (*models.PullRequest, error)
|
|
|
|
GetAssociatedPRs(org, repo string, id int) ([]*models.PullRequest, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type PRInterface struct {
|
|
|
|
gitea common.Gitea
|
|
|
|
}
|
|
|
|
|
|
|
|
func AllocatePRInterface(gitea common.Gitea) GiteaPRInterface {
|
|
|
|
return &PRInterface{
|
|
|
|
gitea: gitea,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *PRInterface) GetAssociatedPrjGitPR(org, repo string, id int) (*models.PullRequest, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *PRInterface) GetAssociatedPRs(org, repo string, id int) ([]*models.PullRequest, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
2024-12-02 10:26:51 +01:00
|
|
|
|