1 Star 0 Fork 0

yangx282441848 / scm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
pr.go 2.79 KB
一键复制 编辑 原始数据 按行查看 历史
Your Name 提交于 2021-10-11 10:02 . gitee
// Copyright 2017 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gogs
import (
"context"
"gitee.com/yangx282441848/scm/scm"
)
type pullService struct {
client *wrapper
}
func (s *pullService) Find(context.Context, string, int) (*scm.PullRequest, *scm.Response, error) {
return nil, nil, scm.ErrNotSupported
}
func (s *pullService) FindComment(context.Context, string, int, int) (*scm.Comment, *scm.Response, error) {
return nil, nil, scm.ErrNotSupported
}
func (s *pullService) List(context.Context, string, scm.PullRequestListOptions) ([]*scm.PullRequest, *scm.Response, error) {
return nil, nil, scm.ErrNotSupported
}
func (s *pullService) ListComments(context.Context, string, int, scm.ListOptions) ([]*scm.Comment, *scm.Response, error) {
return nil, nil, scm.ErrNotSupported
}
func (s *pullService) ListChanges(context.Context, string, int, scm.ListOptions) ([]*scm.Change, *scm.Response, error) {
return nil, nil, scm.ErrNotSupported
}
func (s *pullService) ListCommits(context.Context, string, int, scm.ListOptions) ([]*scm.Commit, *scm.Response, error) {
return nil, nil, scm.ErrNotSupported
}
func (s *pullService) Create(context.Context, string, *scm.PullRequestInput) (*scm.PullRequest, *scm.Response, error) {
return nil, nil, scm.ErrNotSupported
}
func (s *pullService) CreateComment(context.Context, string, int, *scm.CommentInput) (*scm.Comment, *scm.Response, error) {
return nil, nil, scm.ErrNotSupported
}
func (s *pullService) DeleteComment(context.Context, string, int, int) (*scm.Response, error) {
return nil, scm.ErrNotSupported
}
func (s *pullService) Merge(context.Context, string, int) (*scm.Response, error) {
return nil, scm.ErrNotSupported
}
func (s *pullService) Close(context.Context, string, int) (*scm.Response, error) {
return nil, scm.ErrNotSupported
}
//
// native data structures
//
type pullRequest struct {
ID int `json:"id"`
Number int `json:"number"`
User user `json:"user"`
Title string `json:"title"`
Body string `json:"body"`
State string `json:"state"`
HeadBranch string `json:"head_branch"`
HeadRepo repository `json:"head_repo"`
BaseBranch string `json:"base_branch"`
BaseRepo repository `json:"base_repo"`
HTMLURL string `json:"html_url"`
Mergeable bool `json:"mergeable"`
Merged bool `json:"merged"`
}
//
// native data structure conversion
//
func convertPullRequestFromIssue(src *issue) *scm.PullRequest {
return &scm.PullRequest{
Number: src.Number,
Title: src.Title,
Body: src.Body,
Closed: src.State == "closed",
Author: *convertUser(&src.User),
Merged: src.PullRequest.Merged,
Created: src.Created,
Updated: src.Updated,
}
}
1
https://gitee.com/yangx282441848/scm.git
git@gitee.com:yangx282441848/scm.git
yangx282441848
scm
scm
v1.16.27

搜索帮助