diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-23 19:09:11 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-23 19:09:11 -0400 |
commit | b9b82cfe477bcbfd3541adfc969ff20210d56549 (patch) | |
tree | 36020ddd1605414d1f11d1e0201d1ab05afe2880 /models/issue.go | |
parent | 003298ef1d53e1d9837bcac5aadb2e9e159a7497 (diff) | |
download | gitea-b9b82cfe477bcbfd3541adfc969ff20210d56549.tar.gz gitea-b9b82cfe477bcbfd3541adfc969ff20210d56549.zip |
Mirror updates
Diffstat (limited to 'models/issue.go')
-rw-r--r-- | models/issue.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/models/issue.go b/models/issue.go index 929567b1b7..fe43a94b59 100644 --- a/models/issue.go +++ b/models/issue.go @@ -58,6 +58,7 @@ func CreateIssue(userId, repoId, milestoneId, assigneeId int64, name, labels, co Content: content, } _, err = orm.Insert(issue) + // TODO: newIssueAction return issue, err } @@ -67,9 +68,9 @@ func GetIssueCount(repoId int64) (int64, error) { } // GetIssueById returns issue object by given id. -func GetIssueById(id int64) (*Issue, error) { - issue := new(Issue) - has, err := orm.Id(id).Get(issue) +func GetIssueByIndex(repoId, index int64) (*Issue, error) { + issue := &Issue{RepoId: repoId, Index: index} + has, err := orm.Get(issue) if err != nil { return nil, err } else if !has { @@ -126,6 +127,18 @@ func GetIssues(userId, repoId, posterId, milestoneId int64, page int, isClosed, return issues, err } +// UpdateIssue updates information of issue. +func UpdateIssue(issue *Issue) error { + _, err := orm.Update(issue, &Issue{RepoId: issue.RepoId, Index: issue.Index}) + return err +} + +func CloseIssue() { +} + +func ReopenIssue() { +} + // Label represents a list of labels of repository for issues. type Label struct { Id int64 |