finish create issue with labels
This commit is contained in:
parent
17de3ab0a3
commit
922f3f3062
9 changed files with 160 additions and 41 deletions
|
@ -98,8 +98,8 @@ func (f *NewSlackHookForm) Validate(ctx *macaron.Context, errs binding.Errors) b
|
|||
// \/ \/ \/
|
||||
|
||||
type CreateIssueForm struct {
|
||||
Title string `binding:"Required;MaxSize(255)"`
|
||||
LabelIDs []int64 `form:"label_id"`
|
||||
Title string `binding:"Required;MaxSize(255)"`
|
||||
LabelIDs string `form:"label_ids"`
|
||||
MilestoneID int64
|
||||
AssigneeID int64
|
||||
Content string
|
||||
|
|
|
@ -420,3 +420,21 @@ func Subtract(left interface{}, right interface{}) interface{} {
|
|||
return fleft + float64(rleft) - (fright + float64(rright))
|
||||
}
|
||||
}
|
||||
|
||||
// StringsToInt64s converts a slice of string to a slice of int64.
|
||||
func StringsToInt64s(strs []string) []int64 {
|
||||
ints := make([]int64, len(strs))
|
||||
for i := range strs {
|
||||
ints[i] = com.StrTo(strs[i]).MustInt64()
|
||||
}
|
||||
return ints
|
||||
}
|
||||
|
||||
// Int64sToMap converts a slice of int64 to a int64 map.
|
||||
func Int64sToMap(ints []int64) map[int64]bool {
|
||||
m := make(map[int64]bool)
|
||||
for _, i := range ints {
|
||||
m[i] = true
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue