aboutsummaryrefslogtreecommitdiff
path: root/models/issue.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-24 22:30:50 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-24 22:30:50 +0800
commit0e28dcdac402b3bfc8336fe250e3418939467208 (patch)
treef16788377cf724e7d6ea28301f2876632a34d3dc /models/issue.go
parent48ea9b12f65e21c8584eb89224bda4ad6c635847 (diff)
parentc9e1eb0a0d9e6bdafa158442158c762b7f188177 (diff)
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/models/issue.go b/models/issue.go
index 929567b1..fe43a94b 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