fix: api use restful and back data example
This commit is contained in:
parent
ca7dad0ebc
commit
d9495f6822
|
@ -1159,16 +1159,12 @@ type ErrWebhookNotExist struct {
|
||||||
ID int64
|
ID int64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// IsErrWebhookNotExist checks if an error is a ErrWebhookNotExist.
|
// IsErrWebhookNotExist checks if an error is a ErrWebhookNotExist.
|
||||||
func IsErrWebhookNotExist(err error) bool {
|
func IsErrWebhookNotExist(err error) bool {
|
||||||
_, ok := err.(ErrWebhookNotExist)
|
_, ok := err.(ErrWebhookNotExist)
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
func IsErrHookTaskNotExist(err error) bool {
|
|
||||||
_, ok := err.(ErrWebhookNotExist)
|
|
||||||
return ok
|
|
||||||
}
|
|
||||||
func (err ErrWebhookNotExist) Error() string {
|
func (err ErrWebhookNotExist) Error() string {
|
||||||
return fmt.Sprintf("webhook does not exist [id: %d]", err.ID)
|
return fmt.Sprintf("webhook does not exist [id: %d]", err.ID)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2119,21 +2119,6 @@ func CopyLFS(ctx DBContext, newRepo, oldRepo *Repository) error {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
//<<<<<<< HEAD
|
|
||||||
/////////////////////////////GetWiki
|
|
||||||
//func (repo *Repository) GetWikis(listOptions ListOptions) ([]*Repository, error) {
|
|
||||||
// if listOptions.Page == 0 {
|
|
||||||
// wikis := make([]*Repository, 0, repo.NumWikis)
|
|
||||||
// return wikis, x.Find(&wikis, &Repository{WikiID: repo.ID})
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// sess := listOptions.getPaginatedSession()
|
|
||||||
// wikis := make([]*Repository, 0, listOptions.PageSize)
|
|
||||||
// return wikis, sess.Find(&wikis, &Repository{WikiID: repo.ID})
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
//>>>>>>> 3b5dff2e2323aa944690ad52574c3e3b389689ac
|
|
||||||
|
|
||||||
// GetForks returns all the forks of the repository
|
// GetForks returns all the forks of the repository
|
||||||
func (repo *Repository) GetForks(listOptions ListOptions) ([]*Repository, error) {
|
func (repo *Repository) GetForks(listOptions ListOptions) ([]*Repository, error) {
|
||||||
|
|
|
@ -334,18 +334,6 @@ func getWebhook(bean *Webhook) (*Webhook, error) {
|
||||||
return bean, nil
|
return bean, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getHookTask(bean *HookTask) (*HookTask, error) {
|
|
||||||
has, err := x.Get(bean)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
} else if !has {
|
|
||||||
return nil, ErrWebhookNotExist{bean.ID}
|
|
||||||
}
|
|
||||||
return bean, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// GetWebhookByID returns webhook of repository by given ID.
|
// GetWebhookByID returns webhook of repository by given ID.
|
||||||
func GetWebhookByID(id int64) (*Webhook, error) {
|
func GetWebhookByID(id int64) (*Webhook, error) {
|
||||||
return getWebhook(&Webhook{
|
return getWebhook(&Webhook{
|
||||||
|
@ -360,12 +348,7 @@ func GetWebhookByRepoID(repoID, id int64) (*Webhook, error) {
|
||||||
RepoID: repoID,
|
RepoID: repoID,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
func GetHookTaskByRepoID(repoID, id int64) (*HookTask, error) {
|
|
||||||
return getHookTask(&HookTask{
|
|
||||||
ID: id,
|
|
||||||
RepoID: repoID,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// GetWebhookByOrgID returns webhook of organization by given ID.
|
// GetWebhookByOrgID returns webhook of organization by given ID.
|
||||||
func GetWebhookByOrgID(orgID, id int64) (*Webhook, error) {
|
func GetWebhookByOrgID(orgID, id int64) (*Webhook, error) {
|
||||||
return getWebhook(&Webhook{
|
return getWebhook(&Webhook{
|
||||||
|
@ -397,17 +380,7 @@ func GetWebhooksByRepoID(repoID int64, listOptions ListOptions) ([]*Webhook, err
|
||||||
|
|
||||||
return webhooks, sess.Find(&webhooks, &Webhook{RepoID: repoID})
|
return webhooks, sess.Find(&webhooks, &Webhook{RepoID: repoID})
|
||||||
}
|
}
|
||||||
func GetHookTasksByRepoID(repoID int64, listOptions ListOptions) ([]*HookTask, error) {
|
|
||||||
if listOptions.Page == 0 {
|
|
||||||
hooktasks := make([]*HookTask, 0, 5)
|
|
||||||
return hooktasks,x.Find(&hooktasks, &HookTask{RepoID: repoID})
|
|
||||||
}
|
|
||||||
|
|
||||||
sess := listOptions.getPaginatedSession()
|
|
||||||
hooktasks := make([]*HookTask, 0, listOptions.PageSize)
|
|
||||||
|
|
||||||
return hooktasks, sess.Find(&hooktasks, &HookTask{RepoID: repoID})
|
|
||||||
}
|
|
||||||
// GetActiveWebhooksByOrgID returns all active webhooks for an organization.
|
// GetActiveWebhooksByOrgID returns all active webhooks for an organization.
|
||||||
func GetActiveWebhooksByOrgID(orgID int64) (ws []*Webhook, err error) {
|
func GetActiveWebhooksByOrgID(orgID int64) (ws []*Webhook, err error) {
|
||||||
return getActiveWebhooksByOrgID(x, orgID)
|
return getActiveWebhooksByOrgID(x, orgID)
|
||||||
|
@ -783,6 +756,18 @@ func (t *HookTask) simpleMarshalJSON(v interface{}) string {
|
||||||
return string(p)
|
return string(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetHookTasksByRepoIDAndHookID(repoID int64, hookID int64, listOptions ListOptions) ([]*HookTask, error) {
|
||||||
|
if listOptions.Page == 0 {
|
||||||
|
hookTasks := make([]*HookTask, 0, 5)
|
||||||
|
return hookTasks, x.Find(&hookTasks, &HookTask{RepoID: repoID, HookID: hookID})
|
||||||
|
}
|
||||||
|
|
||||||
|
sess := listOptions.getPaginatedSession()
|
||||||
|
hookTasks := make([]*HookTask, 0, listOptions.PageSize)
|
||||||
|
|
||||||
|
return hookTasks, sess.Find(&hookTasks, &HookTask{RepoID: repoID, HookID: hookID})
|
||||||
|
}
|
||||||
|
|
||||||
// HookTasks returns a list of hook tasks by given conditions.
|
// HookTasks returns a list of hook tasks by given conditions.
|
||||||
func HookTasks(hookID int64, page int) ([]*HookTask, error) {
|
func HookTasks(hookID int64, page int) ([]*HookTask, error) {
|
||||||
tasks := make([]*HookTask, 0, setting.Webhook.PagingNum)
|
tasks := make([]*HookTask, 0, setting.Webhook.PagingNum)
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
package convert
|
package convert
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -278,6 +279,36 @@ func ToHook(repoLink string, w *models.Webhook) *api.Hook {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ToHookTask(t *models.HookTask) *api.HookTask {
|
||||||
|
config := map[string]string{
|
||||||
|
"url": t.URL,
|
||||||
|
"content_type": t.ContentType.Name(),
|
||||||
|
"http_method": t.HTTPMethod,
|
||||||
|
}
|
||||||
|
|
||||||
|
payloadContent := make(map[string]interface{})
|
||||||
|
requestContent := make(map[string]interface{})
|
||||||
|
responseContent := make(map[string]interface{})
|
||||||
|
_ = json.Unmarshal([]byte(t.PayloadContent), &payloadContent)
|
||||||
|
_ = json.Unmarshal([]byte(t.RequestContent), &requestContent)
|
||||||
|
_ = json.Unmarshal([]byte(t.ResponseContent), &responseContent)
|
||||||
|
|
||||||
|
return &api.HookTask{
|
||||||
|
ID: t.ID,
|
||||||
|
UUID: t.UUID,
|
||||||
|
Type: t.Type.Name(),
|
||||||
|
Config: config,
|
||||||
|
PayloadContent: payloadContent,
|
||||||
|
EventType: string(t.EventType),
|
||||||
|
IsSSL: t.IsSSL,
|
||||||
|
IsDelivered: t.IsDelivered,
|
||||||
|
Delivered: t.Delivered,
|
||||||
|
IsSucceed: t.IsSucceed,
|
||||||
|
RequestContent: requestContent,
|
||||||
|
ResponseContent: responseContent,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ToGitHook convert git.Hook to api.GitHook
|
// ToGitHook convert git.Hook to api.GitHook
|
||||||
func ToGitHook(h *git.Hook) *api.GitHook {
|
func ToGitHook(h *git.Hook) *api.GitHook {
|
||||||
return &api.GitHook{
|
return &api.GitHook{
|
||||||
|
|
|
@ -35,6 +35,21 @@ type Hook struct {
|
||||||
// HookList represents a list of API hook.
|
// HookList represents a list of API hook.
|
||||||
type HookList []*Hook
|
type HookList []*Hook
|
||||||
|
|
||||||
|
type HookTask struct {
|
||||||
|
ID int64 `json:"id"`
|
||||||
|
UUID string `json:"uuid"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
Config map[string]string `json:"config"`
|
||||||
|
PayloadContent map[string]interface{} `json:"payload_content"`
|
||||||
|
EventType string `json:"event_type"`
|
||||||
|
IsSSL bool `json:"is_ssl"`
|
||||||
|
IsDelivered bool `json:"is_delivered"`
|
||||||
|
Delivered int64 `json:"delivered"`
|
||||||
|
IsSucceed bool `json:"is_succeed"`
|
||||||
|
RequestContent map[string]interface{} `json:"request_info"`
|
||||||
|
ResponseContent map[string]interface{} `json:"response_content"`
|
||||||
|
}
|
||||||
|
|
||||||
// CreateHookOptionConfig has all config options in it
|
// CreateHookOptionConfig has all config options in it
|
||||||
// required are "content_type" and "url" Required
|
// required are "content_type" and "url" Required
|
||||||
type CreateHookOptionConfig map[string]string
|
type CreateHookOptionConfig map[string]string
|
||||||
|
@ -51,17 +66,7 @@ type CreateHookOption struct {
|
||||||
// default: false
|
// default: false
|
||||||
Active bool `json:"active"`
|
Active bool `json:"active"`
|
||||||
}
|
}
|
||||||
type CreateHookTaskOption struct {
|
|
||||||
// required: true
|
|
||||||
// enum: dingtalk,discord,gitea,gogs,msteams,slack,telegram,feishu
|
|
||||||
Type string `json:"type" binding:"Required"`
|
|
||||||
//required: true
|
|
||||||
Config CreateHookOptionConfig `json:"config" binding:"Required"`
|
|
||||||
Events []string `json:"events"`
|
|
||||||
BranchFilter string `json:"branch_filter" binding:"GlobPattern"`
|
|
||||||
//default: false
|
|
||||||
Active bool `json:"active"`
|
|
||||||
}
|
|
||||||
// EditHookOption options when modify one hook
|
// EditHookOption options when modify one hook
|
||||||
type EditHookOption struct {
|
type EditHookOption struct {
|
||||||
Config map[string]string `json:"config"`
|
Config map[string]string `json:"config"`
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
/*
|
||||||
|
* @Date: 2021-08-06 14:28:55
|
||||||
|
* @LastEditors: viletyy
|
||||||
|
* @LastEditTime: 2021-08-06 16:33:20
|
||||||
|
* @FilePath: /gitea-1120-rc1/modules/structs/wiki.go
|
||||||
|
*/
|
||||||
|
package structs
|
||||||
|
|
||||||
|
type WikiesResponse struct {
|
||||||
|
WikiMeta
|
||||||
|
}
|
||||||
|
|
||||||
|
type WikiMeta struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Commit WikiCommit `json:"commit"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WikiCommit struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Message string `json:"message"`
|
||||||
|
Author WikiUser `json:"author"`
|
||||||
|
Commiter WikiUser `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WikiUser struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Email string `json:"email"`
|
||||||
|
When int64 `json:"when"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WikiResponse struct {
|
||||||
|
WikiMeta
|
||||||
|
CommitCounts int64 `json:"commit_counts"`
|
||||||
|
Content string `json:"content"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WikiOption struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Content string `json:"content"`
|
||||||
|
CommitMessage string `json:"commit_message"`
|
||||||
|
}
|
|
@ -1,19 +1,24 @@
|
||||||
package wikis
|
/*
|
||||||
|
* @Date: 2021-08-06 09:53:43
|
||||||
|
* @LastEditors: viletyy
|
||||||
|
* @LastEditTime: 2021-08-06 16:55:28
|
||||||
|
* @FilePath: /gitea-1120-rc1/modules/wikies/wiki.go
|
||||||
|
*/
|
||||||
|
package wikies
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io/ioutil"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/context"
|
"code.gitea.io/gitea/modules/context"
|
||||||
"code.gitea.io/gitea/modules/git"
|
"code.gitea.io/gitea/modules/git"
|
||||||
wiki_service "code.gitea.io/gitea/services/wiki"
|
wiki_service "code.gitea.io/gitea/services/wiki"
|
||||||
"io/ioutil"
|
|
||||||
"net/url"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
func FindWikiRepoCommit(ctx *context.APIContext) (*git.Repository, *git.Commit, error) {
|
func FindWikiRepoCommit(ctx *context.APIContext) (*git.Repository, *git.Commit, error) {
|
||||||
wikiRepo, err := git.OpenRepository(ctx.Repo.Repository.WikiPath())
|
wikiRepo, err := git.OpenRepository(ctx.Repo.Repository.WikiPath())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.ServerError("OpenRepository", err)
|
// ctx.ServerError("OpenRepository", err)
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +29,6 @@ func FindWikiRepoCommit(ctx *context.APIContext) (*git.Repository, *git.Commit,
|
||||||
return wikiRepo, commit, nil
|
return wikiRepo, commit, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func WikiContentsByName(ctx *context.APIContext, commit *git.Commit, wikiName string) ([]byte, *git.TreeEntry, string, bool) {
|
func WikiContentsByName(ctx *context.APIContext, commit *git.Commit, wikiName string) ([]byte, *git.TreeEntry, string, bool) {
|
||||||
pageFilename := wiki_service.NameToFilename(wikiName)
|
pageFilename := wiki_service.NameToFilename(wikiName)
|
||||||
entry, err := findEntryForFile(commit, pageFilename)
|
entry, err := findEntryForFile(commit, pageFilename)
|
|
@ -65,6 +65,9 @@
|
||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models"
|
"code.gitea.io/gitea/models"
|
||||||
"code.gitea.io/gitea/modules/auth"
|
"code.gitea.io/gitea/modules/auth"
|
||||||
"code.gitea.io/gitea/modules/context"
|
"code.gitea.io/gitea/modules/context"
|
||||||
|
@ -81,8 +84,6 @@ import (
|
||||||
_ "code.gitea.io/gitea/routers/api/v1/swagger" // for swagger generation
|
_ "code.gitea.io/gitea/routers/api/v1/swagger" // for swagger generation
|
||||||
"code.gitea.io/gitea/routers/api/v1/user"
|
"code.gitea.io/gitea/routers/api/v1/user"
|
||||||
"code.gitea.io/gitea/routers/api/v1/viewfile"
|
"code.gitea.io/gitea/routers/api/v1/viewfile"
|
||||||
"net/http"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"gitea.com/macaron/binding"
|
"gitea.com/macaron/binding"
|
||||||
"gitea.com/macaron/macaron"
|
"gitea.com/macaron/macaron"
|
||||||
|
@ -518,7 +519,6 @@ func mustNotBeArchived(ctx *context.APIContext) {
|
||||||
func RegisterRoutes(m *macaron.Macaron) {
|
func RegisterRoutes(m *macaron.Macaron) {
|
||||||
bind := binding.Bind
|
bind := binding.Bind
|
||||||
|
|
||||||
//reqSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: true})
|
|
||||||
// add by qiubing
|
// add by qiubing
|
||||||
reqRepoCodeReader := context.RequireRepoReader(models.UnitTypeCode)
|
reqRepoCodeReader := context.RequireRepoReader(models.UnitTypeCode)
|
||||||
// end by qiubing
|
// end by qiubing
|
||||||
|
@ -552,7 +552,6 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
Patch(notify.ReadThread)
|
Patch(notify.ReadThread)
|
||||||
}, reqToken())
|
}, reqToken())
|
||||||
|
|
||||||
|
|
||||||
m.Group("/users", func() {
|
m.Group("/users", func() {
|
||||||
m.Get("/search", user.Search)
|
m.Get("/search", user.Search)
|
||||||
|
|
||||||
|
@ -586,7 +585,6 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
})
|
})
|
||||||
}, reqToken())
|
}, reqToken())
|
||||||
|
|
||||||
|
|
||||||
//数据统计
|
//数据统计
|
||||||
m.Group("/activity", func() {
|
m.Group("/activity", func() {
|
||||||
m.Get("", report.GetActivity)
|
m.Get("", report.GetActivity)
|
||||||
|
@ -654,7 +652,6 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
|
|
||||||
m.Combo("/repositories/:id", reqToken()).Get(repo.GetByID)
|
m.Combo("/repositories/:id", reqToken()).Get(repo.GetByID)
|
||||||
|
|
||||||
|
|
||||||
m.Group("/repos", func() {
|
m.Group("/repos", func() {
|
||||||
|
|
||||||
m.Get("/search", repo.Search)
|
m.Get("/search", repo.Search)
|
||||||
|
@ -676,7 +673,6 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
m.Get("/tag/*", viewfile.RepoRefByType(context.RepoRefTag), viewfile.ViewFile)
|
m.Get("/tag/*", viewfile.RepoRefByType(context.RepoRefTag), viewfile.ViewFile)
|
||||||
m.Get("/commit/*", viewfile.RepoRefByType(context.RepoRefCommit), viewfile.ViewFile)
|
m.Get("/commit/*", viewfile.RepoRefByType(context.RepoRefCommit), viewfile.ViewFile)
|
||||||
|
|
||||||
|
|
||||||
//update by 2021-01-12 end 引用自定义包;
|
//update by 2021-01-12 end 引用自定义包;
|
||||||
|
|
||||||
// alter on 2021/01/15
|
// alter on 2021/01/15
|
||||||
|
@ -698,7 +694,6 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
m.Get("", report.GetContributors) //获取仓库的所有构建者信息 ****
|
m.Get("", report.GetContributors) //获取仓库的所有构建者信息 ****
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
m.Combo("").Get(reqAnyRepoReader(), repo.Get).
|
m.Combo("").Get(reqAnyRepoReader(), repo.Get).
|
||||||
Delete(reqToken(), reqOwner(), repo.Delete).
|
Delete(reqToken(), reqOwner(), repo.Delete).
|
||||||
Patch(reqToken(), reqAdmin(), bind(api.EditRepoOption{}), context.RepoRef(), repo.Edit)
|
Patch(reqToken(), reqAdmin(), bind(api.EditRepoOption{}), context.RepoRef(), repo.Edit)
|
||||||
|
@ -706,16 +701,13 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
m.Combo("/notifications").
|
m.Combo("/notifications").
|
||||||
Get(reqToken(), notify.ListRepoNotifications).
|
Get(reqToken(), notify.ListRepoNotifications).
|
||||||
Put(reqToken(), notify.ReadRepoNotifications)
|
Put(reqToken(), notify.ReadRepoNotifications)
|
||||||
m.Group("/wiki", func() {
|
m.Group("/wikies", func() {
|
||||||
m.Group("/content", func() {
|
m.Combo("").Get(repo.WikiList).
|
||||||
m.Get("/?:page",repo.WikiContent)
|
Post(bind(api.WikiOption{}), repo.CreateWiki)
|
||||||
})
|
m.Group("/:page", func() {
|
||||||
m.Get("/_pages", repo.WikiPages)
|
m.Combo("").Get(repo.GetWiki).
|
||||||
m.Group("", func() {
|
Patch(bind(api.WikiOption{}), repo.EditWiki).
|
||||||
m.Get("/_new", repo.CreateNewWiki)
|
Delete(repo.DeleteWiki)
|
||||||
|
|
||||||
m.Get("/:page/_edit",repo.EditWiki)
|
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
m.Group("/hooks", func() {
|
m.Group("/hooks", func() {
|
||||||
|
@ -726,7 +718,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
Patch(bind(api.EditHookOption{}), repo.EditHook).
|
Patch(bind(api.EditHookOption{}), repo.EditHook).
|
||||||
Delete(repo.DeleteHook)
|
Delete(repo.DeleteHook)
|
||||||
m.Post("/tests", context.RepoRef(), repo.TestHook)
|
m.Post("/tests", context.RepoRef(), repo.TestHook)
|
||||||
m.Get("/hooktasks",repo.HookTaskList)
|
m.Get("/hooktasks", repo.ListHookTask)
|
||||||
})
|
})
|
||||||
|
|
||||||
m.Group("/git", func() {
|
m.Group("/git", func() {
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
package repo
|
package repo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.gitea.io/gitea/modules/setting"
|
|
||||||
_ "fmt"
|
_ "fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
@ -267,8 +266,8 @@ func DeleteHook(ctx *context.APIContext) {
|
||||||
ctx.Status(http.StatusNoContent)
|
ctx.Status(http.StatusNoContent)
|
||||||
}
|
}
|
||||||
|
|
||||||
func HookTaskList(ctx *context.APIContext){
|
func ListHookTask(ctx *context.APIContext) {
|
||||||
// swagger:operation GET /repos/{owner}/{repo}/hooks/hooktasks repository repoGetHookTasks
|
// swagger:operation GET /repos/{owner}/{repo}/hooks/{id}/hooktasks repository repoGetHookTasks
|
||||||
// ---
|
// ---
|
||||||
// summary: Get a hooktasks
|
// summary: Get a hooktasks
|
||||||
// produces:
|
// produces:
|
||||||
|
@ -284,36 +283,38 @@ func HookTaskList(ctx *context.APIContext){
|
||||||
// description: name of the repo
|
// description: name of the repo
|
||||||
// type: string
|
// type: string
|
||||||
// required: true
|
// required: true
|
||||||
|
// - name: id
|
||||||
|
// in: path
|
||||||
|
// description: id of the hook
|
||||||
|
// type: integer
|
||||||
|
// format: int64
|
||||||
|
// required: true
|
||||||
|
// - name: page
|
||||||
|
// in: query
|
||||||
|
// description: page number of results to return (1-based)
|
||||||
|
// type: integer
|
||||||
|
// - name: limit
|
||||||
|
// in: query
|
||||||
|
// description: page size of results
|
||||||
|
// type: integer
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/Hook"
|
// "$ref": "#/responses/HookTaskList"
|
||||||
// "404":
|
hook, err := utils.GetRepoHook(ctx, ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
|
||||||
// "$ref": "#/responses/notFound"
|
|
||||||
|
|
||||||
//hooks, err := models.GetHookTasksByRepoID(ctx.Repo.Repository.ID, utils.GetListOptions(ctx))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
repo := ctx.Repo
|
|
||||||
hookID := ctx.ParamsInt64(":id")
|
|
||||||
hook, err := utils.GetRepoHookTask(ctx, repo.Repository.ID, hookID)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
ctx.NotFound()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//hooks, err := models.GetWebhooksByRepoID(ctx.Repo.Repository.ID, utils.GetListOptions(ctx))
|
hookTasks, err := models.GetHookTasksByRepoIDAndHookID(ctx.Repo.Repository.ID, hook.ID, utils.GetListOptions(ctx))
|
||||||
//if err != nil {
|
if err != nil {
|
||||||
// ctx.Error(http.StatusInternalServerError, "GetWebhooksByRepoID", err)
|
ctx.Error(http.StatusInternalServerError, "GetHookTasksByRepoIDAndHookID", err)
|
||||||
// return
|
return
|
||||||
//}
|
}
|
||||||
|
|
||||||
//apiHooks := make([]*models.HookTask,len(hooks))
|
apiHookTasks := make([]*api.HookTask, len(hookTasks))
|
||||||
//for i := range hooks {
|
for i := range hookTasks {
|
||||||
// apiHooks[i] = convert.ToHook(ctx.Repo.RepoLink, hooks[i])
|
apiHookTasks[i] = convert.ToHookTask(hookTasks[i])
|
||||||
//}
|
}
|
||||||
//hookstasks := make(map[string]string)
|
|
||||||
//hookTasks := make([][]*models.HookTask, 0, setting.Webhook.PagingNum)
|
ctx.JSON(http.StatusOK, &apiHookTasks)
|
||||||
|
|
||||||
hookTasks := utils.GetHookTasks(hook, setting.Webhook.PagingNum)
|
|
||||||
|
|
||||||
ctx.JSON(http.StatusOK, &hookTasks)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,46 +1,21 @@
|
||||||
package repo
|
package repo
|
||||||
|
|
||||||
//
|
//
|
||||||
import (
|
import (
|
||||||
"code.gitea.io/gitea/models"
|
"code.gitea.io/gitea/models"
|
||||||
"code.gitea.io/gitea/modules/context"
|
"code.gitea.io/gitea/modules/context"
|
||||||
"code.gitea.io/gitea/modules/git"
|
|
||||||
"code.gitea.io/gitea/modules/markup/markdown"
|
"code.gitea.io/gitea/modules/markup/markdown"
|
||||||
"code.gitea.io/gitea/modules/timeutil"
|
api "code.gitea.io/gitea/modules/structs"
|
||||||
"code.gitea.io/gitea/modules/wikis"
|
"code.gitea.io/gitea/modules/wikies"
|
||||||
wiki_service "code.gitea.io/gitea/services/wiki"
|
wiki_service "code.gitea.io/gitea/services/wiki"
|
||||||
//"fmt"
|
|
||||||
//"golang.org/x/sys/windows"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
//"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func WikiList(ctx *context.APIContext) {
|
||||||
type PageMeta struct {
|
// swagger:operation GET /repos/{owner}/{repo}/wikies repository repoWikiList
|
||||||
Name string `json:"name"`
|
|
||||||
SubURL string `json:"sub_url"`
|
|
||||||
UpdatedUnix timeutil.TimeStamp `json:"updated_unix"`
|
|
||||||
}
|
|
||||||
type Wiki struct {
|
|
||||||
|
|
||||||
WikiRepo *git.Repository `json:"wiki_repo"`
|
|
||||||
//CommitID *git.Commit `json:"commit_id"`
|
|
||||||
Page []PageMeta `json:"page"`
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
type wiContent struct{
|
|
||||||
UserName string `json:"user_name"`
|
|
||||||
UserId int64 `json:"user_id"`
|
|
||||||
PageName string `json:"page_name"`
|
|
||||||
UpdateUnix timeutil.TimeStamp `json:"update_unix"`
|
|
||||||
CommitCounts int64 `json:"commit_counts"`
|
|
||||||
Content string `json:"content"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func WikiPages(ctx *context.APIContext) {
|
|
||||||
// swagger:operation GET /repos/{owner}/{repo}/wiki/_pages wikipages
|
|
||||||
// ---
|
// ---
|
||||||
// summary: Get ListWikiPages
|
// summary: List the hooks in a repository
|
||||||
// produces:
|
// produces:
|
||||||
// - application/json
|
// - application/json
|
||||||
// parameters:
|
// parameters:
|
||||||
|
@ -56,10 +31,13 @@ func WikiPages(ctx *context.APIContext) {
|
||||||
// required: true
|
// required: true
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/Wiki/_page"
|
// "$ref": "#/responses/WikiList"
|
||||||
|
|
||||||
|
wikiRepo, commit, err := wikies.FindWikiRepoCommit(ctx)
|
||||||
wikiRepo, commit, err := wikis.FindWikiRepoCommit(ctx)
|
if err != nil {
|
||||||
|
ctx.JSON(http.StatusOK, []api.WikiesResponse{})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
entries, err := commit.ListEntries()
|
entries, err := commit.ListEntries()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -67,10 +45,11 @@ func WikiPages(ctx *context.APIContext) {
|
||||||
wikiRepo.Close()
|
wikiRepo.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.NotFound("ListEntries", err)
|
ctx.JSON(http.StatusOK, []api.WikiesResponse{})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
pages := make([]PageMeta, 0, len(entries))
|
|
||||||
|
wikies := make([]api.WikiesResponse, 0, len(entries))
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
if !entry.IsRegular() {
|
if !entry.IsRegular() {
|
||||||
continue
|
continue
|
||||||
|
@ -96,28 +75,34 @@ func WikiPages(ctx *context.APIContext) {
|
||||||
ctx.ServerError("WikiFilenameToName", err)
|
ctx.ServerError("WikiFilenameToName", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
pages = append(pages,PageMeta{
|
wikies = append(wikies, api.WikiesResponse{
|
||||||
|
WikiMeta: api.WikiMeta{
|
||||||
Name: wikiName,
|
Name: wikiName,
|
||||||
SubURL: wiki_service.NameToSubURL(wikiName),
|
Commit: api.WikiCommit{
|
||||||
UpdatedUnix: timeutil.TimeStamp(c.Author.When.Unix()),
|
Author: api.WikiUser{
|
||||||
|
Name: c.Author.Name,
|
||||||
|
Email: c.Author.Email,
|
||||||
|
When: c.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
Commiter: api.WikiUser{
|
||||||
|
Name: c.Committer.Name,
|
||||||
|
Email: c.Committer.Email,
|
||||||
|
When: c.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
ID: c.ID.String(),
|
||||||
|
Message: c.Message(),
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
WikiPages := Wiki{
|
|
||||||
WikiRepo: wikiRepo,
|
|
||||||
//CommitID: commit,
|
|
||||||
Page: pages,
|
|
||||||
}
|
|
||||||
//wikiPages, _ := json.Marshal(WikiPages)
|
|
||||||
|
|
||||||
ctx.JSON(http.StatusOK,WikiPages)
|
ctx.JSON(http.StatusOK, wikies)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetWiki(ctx *context.APIContext) {
|
||||||
|
// swagger:operation GET /repos/{owner}/{repo}/wikies/{pagename} repository repoGetWiki
|
||||||
func WikiContent(ctx *context.APIContext){
|
|
||||||
// swagger:operation GET /repos/{owner}/{repo}/wiki/content/{pagename} wikiName Content
|
|
||||||
// ---
|
// ---
|
||||||
// summary: Get NameWiki Content
|
// summary: Get a Wiki
|
||||||
// produces:
|
// produces:
|
||||||
// - application/json
|
// - application/json
|
||||||
// parameters:
|
// parameters:
|
||||||
|
@ -138,27 +123,18 @@ func WikiContent(ctx *context.APIContext){
|
||||||
// required: true
|
// required: true
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/Wiki/content/wikipage"
|
// "$ref": "#/responses/Wiki"
|
||||||
|
|
||||||
wikiRepo, commit, _ := wikis.FindWikiRepoCommit(ctx)
|
wikiRepo, commit, _ := wikies.FindWikiRepoCommit(ctx)
|
||||||
|
|
||||||
//entries, err := commit.ListEntries()
|
|
||||||
//if err != nil {
|
|
||||||
// if wikiRepo != nil {
|
|
||||||
// wikiRepo.Close()
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ctx.NotFound("ListEntries", err)
|
|
||||||
// return
|
|
||||||
//}
|
|
||||||
pageName := wiki_service.NormalizeWikiName(ctx.Params(":page"))
|
pageName := wiki_service.NormalizeWikiName(ctx.Params(":page"))
|
||||||
if len(pageName) == 0 {
|
if len(pageName) == 0 {
|
||||||
pageName = "Home"
|
pageName = "Home"
|
||||||
}
|
}
|
||||||
data, entry, pageFilename, noEntry := wikis.WikiContentsByName(ctx, commit, pageName)
|
data, entry, pageFilename, noEntry := wikies.WikiContentsByName(ctx, commit, pageName)
|
||||||
if noEntry {
|
if noEntry {
|
||||||
ctx.Redirect(ctx.Repo.RepoLink + "/wiki/_pages")
|
ctx.NotFound()
|
||||||
//ctx.ServerError("WikiContentsByName",error)
|
return
|
||||||
}
|
}
|
||||||
if entry == nil || ctx.Written() {
|
if entry == nil || ctx.Written() {
|
||||||
if wikiRepo != nil {
|
if wikiRepo != nil {
|
||||||
|
@ -166,7 +142,7 @@ func WikiContent(ctx *context.APIContext){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
metas := ctx.Repo.Repository.ComposeDocumentMetas()
|
metas := ctx.Repo.Repository.ComposeDocumentMetas()
|
||||||
PagaContent := markdown.RenderWiki(data, ctx.Repo.RepoLink, metas)
|
PageContent := markdown.RenderWiki(data, ctx.Repo.RepoLink, metas)
|
||||||
c, err := wikiRepo.GetCommitByPath(entry.Name())
|
c, err := wikiRepo.GetCommitByPath(entry.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if models.IsErrWikiInvalidFileName(err) {
|
if models.IsErrWikiInvalidFileName(err) {
|
||||||
|
@ -175,23 +151,61 @@ func WikiContent(ctx *context.APIContext){
|
||||||
}
|
}
|
||||||
commitsCount, _ := wikiRepo.FileCommitsCount("master", pageFilename)
|
commitsCount, _ := wikiRepo.FileCommitsCount("master", pageFilename)
|
||||||
|
|
||||||
|
wiki := api.WikiResponse{
|
||||||
WikiPageContent := wiContent{
|
WikiMeta: api.WikiMeta{
|
||||||
UserName: ctx.User.Name,
|
Name: pageName,
|
||||||
UserId: ctx.User.ID,
|
Commit: api.WikiCommit{
|
||||||
PageName: pageName,
|
Author: api.WikiUser{
|
||||||
UpdateUnix: timeutil.TimeStamp(c.Author.When.Unix()),
|
Name: c.Author.Name,
|
||||||
|
Email: c.Author.Email,
|
||||||
|
When: c.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
Commiter: api.WikiUser{
|
||||||
|
Name: c.Committer.Name,
|
||||||
|
Email: c.Committer.Email,
|
||||||
|
When: c.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
ID: c.ID.String(),
|
||||||
|
Message: c.Message(),
|
||||||
|
},
|
||||||
|
},
|
||||||
CommitCounts: commitsCount,
|
CommitCounts: commitsCount,
|
||||||
Content: PagaContent,
|
Content: PageContent,
|
||||||
}
|
}
|
||||||
ctx.JSON(http.StatusOK,WikiPageContent)
|
ctx.JSON(http.StatusOK, wiki)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateNewWiki(ctx *context.APIContext){
|
func CreateWiki(ctx *context.APIContext) {
|
||||||
// swagger:operation GET /repos/{owner}/{repo}/wiki/{pagename} Create a new Wikipage
|
// swagger:operation POST /repos/{owner}/{repo}/wikis repository repoCreateWiki
|
||||||
// ---
|
// ---
|
||||||
// summary: wiki Content
|
// summary: Create a wiki in a repository
|
||||||
|
// produces:
|
||||||
|
// - application/json
|
||||||
|
// parameters:
|
||||||
|
// - name: owner
|
||||||
|
// in: path
|
||||||
|
// description: owner of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: repo
|
||||||
|
// in: path
|
||||||
|
// description: name of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: body
|
||||||
|
// in: body
|
||||||
|
// schema:
|
||||||
|
// "$ref": "#/definitions/WikiOption"
|
||||||
|
// responses:
|
||||||
|
// "201":
|
||||||
|
// "$ref": "#/responses/Wiki"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func EditWiki(ctx *context.Context) {
|
||||||
|
// swagger:operation PATCH /repos/{owner}/{repo}/wikies/{pagename} repository repoEditWiki
|
||||||
|
// ---
|
||||||
|
// summary: Edit a wiki in a repository
|
||||||
// produces:
|
// produces:
|
||||||
// - application/json
|
// - application/json
|
||||||
// parameters:
|
// parameters:
|
||||||
|
@ -207,27 +221,23 @@ func CreateNewWiki(ctx *context.APIContext){
|
||||||
// required: true
|
// required: true
|
||||||
// - name: pagename
|
// - name: pagename
|
||||||
// in: path
|
// in: path
|
||||||
// description: path of the dir, file, symlink or submodule in the repo
|
// description: name of the wiki
|
||||||
// type: string
|
// type: string
|
||||||
// required: true
|
// required: true
|
||||||
// - name: ref
|
// - name: body
|
||||||
// in: query
|
// in: body
|
||||||
// description: "The name of the commit/branch/tag. Default the repository’s default branch (usually master)"
|
// schema:
|
||||||
// type: string
|
// "$ref": "#/definitions/WikiOption"
|
||||||
// required: false
|
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "200":
|
||||||
// "$ref": "#/responses/ContentsResponse"
|
// "$ref": "#/responses/Wiki"
|
||||||
// "404":
|
|
||||||
// "$ref": "#/responses/notFound"
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func EditWiki(ctx *context.Context){
|
func DeleteWiki(ctx *context.Context) {
|
||||||
// swagger:operation GET /repos/{owner}/{repo}/wiki/{pagename}/_edit Edit wikipage
|
// swagger:operation DELETE /repos/{owner}/{repo}/wikies/{pagename} repository repoDeleteWiki
|
||||||
// ---
|
// ---
|
||||||
// summary: new wiki
|
// summary: Delete a wiki in a repository
|
||||||
// produces:
|
// produces:
|
||||||
// - application/json
|
// - application/json
|
||||||
// parameters:
|
// parameters:
|
||||||
|
@ -247,7 +257,8 @@ func EditWiki(ctx *context.Context){
|
||||||
// type: string
|
// type: string
|
||||||
// required: true
|
// required: true
|
||||||
// responses:
|
// responses:
|
||||||
// "200":
|
// "204":
|
||||||
// "$ref": "#/responses/Wiki/pagename/_edit"
|
// "$ref": "#/responses/empty"
|
||||||
|
// "404":
|
||||||
|
// "$ref": "#/responses/notFound"
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,9 @@ type swaggerParameterBodies struct {
|
||||||
// in:body
|
// in:body
|
||||||
DeleteEmailOption api.DeleteEmailOption
|
DeleteEmailOption api.DeleteEmailOption
|
||||||
|
|
||||||
|
// in:body
|
||||||
|
WikiOption api.WikiOption
|
||||||
|
|
||||||
// in:body
|
// in:body
|
||||||
CreateHookOption api.CreateHookOption
|
CreateHookOption api.CreateHookOption
|
||||||
// in:body
|
// in:body
|
||||||
|
|
|
@ -85,6 +85,20 @@ type swaggerResponseReferenceList struct {
|
||||||
Body []api.Reference `json:"body"`
|
Body []api.Reference `json:"body"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wiki
|
||||||
|
// swagger:response Wiki
|
||||||
|
type swaggerResponseWiki struct {
|
||||||
|
// in:body
|
||||||
|
Body api.WikiResponse `json:"body"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// WikiList
|
||||||
|
// swagger:response WikiList
|
||||||
|
type swaggerResponseWikiList struct {
|
||||||
|
// in:body
|
||||||
|
Body api.WikiesResponse `json:"body"`
|
||||||
|
}
|
||||||
|
|
||||||
// Hook
|
// Hook
|
||||||
// swagger:response Hook
|
// swagger:response Hook
|
||||||
type swaggerResponseHook struct {
|
type swaggerResponseHook struct {
|
||||||
|
@ -99,6 +113,13 @@ type swaggerResponseHookList struct {
|
||||||
Body []api.Hook `json:"body"`
|
Body []api.Hook `json:"body"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HookTaskList
|
||||||
|
// swagger:response HookTaskList
|
||||||
|
type swaggerResponseHookTaskList struct {
|
||||||
|
// in:body
|
||||||
|
Body []api.HookTask `json:"body"`
|
||||||
|
}
|
||||||
|
|
||||||
// GitHook
|
// GitHook
|
||||||
// swagger:response GitHook
|
// swagger:response GitHook
|
||||||
type swaggerResponseGitHook struct {
|
type swaggerResponseGitHook struct {
|
||||||
|
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"xorm.io/xorm"
|
|
||||||
|
|
||||||
"code.gitea.io/gitea/models"
|
"code.gitea.io/gitea/models"
|
||||||
"code.gitea.io/gitea/modules/context"
|
"code.gitea.io/gitea/modules/context"
|
||||||
|
@ -50,85 +49,6 @@ func GetRepoHook(ctx *context.APIContext, repoID, hookID int64) (*models.Webhook
|
||||||
return w, nil
|
return w, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetRepoHookTask(ctx *context.APIContext, repoID, hookID int64) (*models.HookTask, error) {
|
|
||||||
w, err := models.GetHookTaskByRepoID(repoID, hookID)
|
|
||||||
if err != nil {
|
|
||||||
if models.IsErrHookTaskNotExist(err) {
|
|
||||||
ctx.NotFound()
|
|
||||||
} else {
|
|
||||||
ctx.Error(http.StatusInternalServerError, "GetHookTaskByID", err)
|
|
||||||
}
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return w, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetHookTasks(w *models.HookTask, page int )([]*models.HookTask){
|
|
||||||
|
|
||||||
hook_id := w.HookID
|
|
||||||
|
|
||||||
//tasks := make([]*models.HookTask, 0, setting.Webhook.PagingNum)
|
|
||||||
|
|
||||||
hookTasks, _ := models.HookTasks(hook_id, page)
|
|
||||||
//tasks, _ = hookTasks, err
|
|
||||||
|
|
||||||
//for i := range tasks{
|
|
||||||
// tasks[i].ID = hookTasks[i].ID
|
|
||||||
// tasks[i].UUID = hookTasks[i].UUID
|
|
||||||
// tasks[i].URL = hookTasks[i].URL
|
|
||||||
// tasks[i].ContentType = hookTasks[i].ContentType
|
|
||||||
// tasks[i].RequestInfo = hookTasks[i].RequestInfo
|
|
||||||
// tasks[i].RequestContent = hookTasks[i].RequestContent
|
|
||||||
// tasks[i].HTTPMethod = hookTasks[i].HTTPMethod
|
|
||||||
// tasks[i].ResponseContent = hookTasks[i].ResponseContent
|
|
||||||
// tasks[i].ResponseInfo = hookTasks[i].ResponseInfo
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
|
|
||||||
//
|
|
||||||
//if err != nil{
|
|
||||||
// fmt.Println("err ......")
|
|
||||||
//}
|
|
||||||
|
|
||||||
//t := append(tasks, hookTasks)
|
|
||||||
|
|
||||||
//tasks := make(map[string]string)
|
|
||||||
////hooktasks := make([]models.HookTask, len(hookTasks))
|
|
||||||
//tasks := append(hooktasks, hookTasks)
|
|
||||||
|
|
||||||
//HookTasks := make([]*models.HookTask, len(hookTasks))
|
|
||||||
//H := append(HookTasks, hookTasks)
|
|
||||||
return hookTasks
|
|
||||||
//return {
|
|
||||||
// //ID: w.ID,
|
|
||||||
// //Type: w.Type,
|
|
||||||
// //URL: w.URL,
|
|
||||||
// //Signature: w.Signature,
|
|
||||||
// //PayloadContent: w.PayloadContent,
|
|
||||||
// //
|
|
||||||
// //HTTPMethod: w.HTTPMethod,
|
|
||||||
// //ResponseContent: w.ResponseContent,
|
|
||||||
// //ResponseInfo: w.ResponseInfo,
|
|
||||||
// ID: w.ID,
|
|
||||||
// UUID: w.UUID,
|
|
||||||
// Type :w.Type,
|
|
||||||
// URL :w.URL,
|
|
||||||
// PayloadContent:w.PayloadContent,
|
|
||||||
// HTTPMethod : w.HTTPMethod,
|
|
||||||
// ContentType : w.ContentType,
|
|
||||||
// EventType : w.EventType,
|
|
||||||
// //IsSSL : w.IsSSL,
|
|
||||||
// //IsDelivered :w.IsDelivered,
|
|
||||||
// Delivered :w.Delivered,
|
|
||||||
// DeliveredString :w.DeliveredString,
|
|
||||||
// // History info.
|
|
||||||
// IsSucceed : w.IsSucceed,
|
|
||||||
// RequestContent : w.RequestContent,
|
|
||||||
// RequestInfo : w.RequestInfo,
|
|
||||||
// ResponseContent : w.ResponseContent,
|
|
||||||
// ResponseInfo : w.ResponseInfo,
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
// CheckCreateHookOption check if a CreateHookOption form is valid. If invalid,
|
// CheckCreateHookOption check if a CreateHookOption form is valid. If invalid,
|
||||||
// write the appropriate error to `ctx`. Return whether the form is valid
|
// write the appropriate error to `ctx`. Return whether the form is valid
|
||||||
func CheckCreateHookOption(ctx *context.APIContext, form *api.CreateHookOption) bool {
|
func CheckCreateHookOption(ctx *context.APIContext, form *api.CreateHookOption) bool {
|
||||||
|
@ -376,29 +296,3 @@ func editHook(ctx *context.APIContext, form *api.EditHookOption, w *models.Webho
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var (
|
|
||||||
x *xorm.Engine
|
|
||||||
tables []interface{}
|
|
||||||
|
|
||||||
// HasEngine specifies if we have a xorm.Engine
|
|
||||||
HasEngine bool
|
|
||||||
)
|
|
||||||
|
|
||||||
func HookTaskList(ctx *context.APIContext,hookId int64, page int)([]*models.HookTask, error){
|
|
||||||
|
|
||||||
//tasks := make([]*models.HookTask,0,setting.Webhook.PagingNum)
|
|
||||||
tasks, err := models.HookTasks(hookId, page)
|
|
||||||
if err != nil{
|
|
||||||
if models.IsErrWebhookNotExist(err) {
|
|
||||||
ctx.NotFound()
|
|
||||||
}else{
|
|
||||||
ctx.Error(http.StatusInternalServerError, "HookTaskList", err)
|
|
||||||
|
|
||||||
}
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return tasks, err
|
|
||||||
}
|
|
||||||
|
|
|
@ -3856,42 +3856,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/repos/{owner}/{repo}/hooks/hooktasks": {
|
|
||||||
"get": {
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"repository"
|
|
||||||
],
|
|
||||||
"summary": "Get a hooktasks",
|
|
||||||
"operationId": "repoGetHookTasks",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "owner of the repo",
|
|
||||||
"name": "owner",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "name of the repo",
|
|
||||||
"name": "repo",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"$ref": "#/responses/Hook"
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"$ref": "#/responses/notFound"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/repos/{owner}/{repo}/hooks/{id}": {
|
"/repos/{owner}/{repo}/hooks/{id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"produces": [
|
"produces": [
|
||||||
|
@ -4024,6 +3988,59 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/repos/{owner}/{repo}/hooks/{id}/hooktasks": {
|
||||||
|
"get": {
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"repository"
|
||||||
|
],
|
||||||
|
"summary": "Get a hooktasks",
|
||||||
|
"operationId": "repoGetHookTasks",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "owner of the repo",
|
||||||
|
"name": "owner",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the repo",
|
||||||
|
"name": "repo",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "id of the hook",
|
||||||
|
"name": "id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "page number of results to return (1-based)",
|
||||||
|
"name": "page",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "page size of results",
|
||||||
|
"name": "limit",
|
||||||
|
"in": "query"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"$ref": "#/responses/HookTaskList"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/repos/{owner}/{repo}/hooks/{id}/tests": {
|
"/repos/{owner}/{repo}/hooks/{id}/tests": {
|
||||||
"post": {
|
"post": {
|
||||||
"produces": [
|
"produces": [
|
||||||
|
@ -8883,13 +8900,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/repos/{owner}/{repo}/wiki/_pages": {
|
"/repos/{owner}/{repo}/wikies": {
|
||||||
"get": {
|
"get": {
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"summary": "Get ListWikiPages",
|
"tags": [
|
||||||
"operationId": "wikipages",
|
"repository"
|
||||||
|
],
|
||||||
|
"summary": "List the hooks in a repository",
|
||||||
|
"operationId": "repoWikiList",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -8908,21 +8928,21 @@
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/Wiki/_page"
|
"$ref": "#/responses/WikiList"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/repos/{owner}/{repo}/wiki/content/{pagename}": {
|
"/repos/{owner}/{repo}/wikies/{pagename}": {
|
||||||
"get": {
|
"get": {
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"wikiName"
|
"repository"
|
||||||
],
|
],
|
||||||
"summary": "Get NameWiki Content",
|
"summary": "Get a Wiki",
|
||||||
"operationId": "Content",
|
"operationId": "repoGetWiki",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -8948,72 +8968,19 @@
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/Wiki/content/wikipage"
|
"$ref": "#/responses/Wiki"
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/repos/{owner}/{repo}/wiki/{pagename}": {
|
"delete": {
|
||||||
"get": {
|
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"Create",
|
"repository"
|
||||||
"a",
|
|
||||||
"new"
|
|
||||||
],
|
],
|
||||||
"summary": "wiki Content",
|
"summary": "Delete a wiki in a repository",
|
||||||
"operationId": "Wikipage",
|
"operationId": "repoDeleteWiki",
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "owner of the repo",
|
|
||||||
"name": "owner",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "name of the repo",
|
|
||||||
"name": "repo",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "path of the dir, file, symlink or submodule in the repo",
|
|
||||||
"name": "pagename",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)",
|
|
||||||
"name": "ref",
|
|
||||||
"in": "query"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"$ref": "#/responses/ContentsResponse"
|
|
||||||
},
|
|
||||||
"404": {
|
|
||||||
"$ref": "#/responses/notFound"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/repos/{owner}/{repo}/wiki/{pagename}/_edit": {
|
|
||||||
"get": {
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"Edit"
|
|
||||||
],
|
|
||||||
"summary": "new wiki",
|
|
||||||
"operationId": "wikipage",
|
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -9037,9 +9004,97 @@
|
||||||
"required": true
|
"required": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"responses": {
|
||||||
|
"204": {
|
||||||
|
"$ref": "#/responses/empty"
|
||||||
|
},
|
||||||
|
"404": {
|
||||||
|
"$ref": "#/responses/notFound"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"patch": {
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"repository"
|
||||||
|
],
|
||||||
|
"summary": "Edit a wiki in a repository",
|
||||||
|
"operationId": "repoEditWiki",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "owner of the repo",
|
||||||
|
"name": "owner",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the repo",
|
||||||
|
"name": "repo",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the wiki",
|
||||||
|
"name": "pagename",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "body",
|
||||||
|
"in": "body",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/WikiOption"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"$ref": "#/responses/Wiki/pagename/_edit"
|
"$ref": "#/responses/Wiki"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/repos/{owner}/{repo}/wikis": {
|
||||||
|
"post": {
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"repository"
|
||||||
|
],
|
||||||
|
"summary": "Create a wiki in a repository",
|
||||||
|
"operationId": "repoCreateWiki",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "owner of the repo",
|
||||||
|
"name": "owner",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the repo",
|
||||||
|
"name": "repo",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "body",
|
||||||
|
"in": "body",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/WikiOption"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"201": {
|
||||||
|
"$ref": "#/responses/Wiki"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13585,6 +13640,74 @@
|
||||||
},
|
},
|
||||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
},
|
},
|
||||||
|
"HookTask": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"config": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"x-go-name": "Config"
|
||||||
|
},
|
||||||
|
"delivered": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"x-go-name": "Delivered"
|
||||||
|
},
|
||||||
|
"event_type": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "EventType"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"x-go-name": "ID"
|
||||||
|
},
|
||||||
|
"is_delivered": {
|
||||||
|
"type": "boolean",
|
||||||
|
"x-go-name": "IsDelivered"
|
||||||
|
},
|
||||||
|
"is_ssl": {
|
||||||
|
"type": "boolean",
|
||||||
|
"x-go-name": "IsSSL"
|
||||||
|
},
|
||||||
|
"is_succeed": {
|
||||||
|
"type": "boolean",
|
||||||
|
"x-go-name": "IsSucceed"
|
||||||
|
},
|
||||||
|
"payload_content": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"x-go-name": "PayloadContent"
|
||||||
|
},
|
||||||
|
"request_info": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"x-go-name": "RequestContent"
|
||||||
|
},
|
||||||
|
"response_content": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"x-go-name": "ResponseContent"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Type"
|
||||||
|
},
|
||||||
|
"uuid": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "UUID"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
"Identity": {
|
"Identity": {
|
||||||
"description": "Identity for a person's identity like an author or committer",
|
"description": "Identity for a person's identity like an author or committer",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -15367,6 +15490,95 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
|
"WikiCommit": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"author": {
|
||||||
|
"$ref": "#/definitions/WikiUser"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "ID"
|
||||||
|
},
|
||||||
|
"message": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Message"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
|
"WikiOption": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"commit_message": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "CommitMessage"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Content"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Name"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
|
"WikiResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"commit": {
|
||||||
|
"$ref": "#/definitions/WikiCommit"
|
||||||
|
},
|
||||||
|
"commit_counts": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"x-go-name": "CommitCounts"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Content"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Name"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
|
"WikiUser": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"email": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Email"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Name"
|
||||||
|
},
|
||||||
|
"when": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"x-go-name": "When"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
|
"WikiesResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"commit": {
|
||||||
|
"$ref": "#/definitions/WikiCommit"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Name"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"responses": {
|
"responses": {
|
||||||
|
@ -15630,6 +15842,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"HookTaskList": {
|
||||||
|
"description": "HookTaskList",
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/HookTask"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Issue": {
|
"Issue": {
|
||||||
"description": "Issue",
|
"description": "Issue",
|
||||||
"schema": {
|
"schema": {
|
||||||
|
@ -16009,6 +16230,18 @@
|
||||||
"$ref": "#/definitions/WatchInfo"
|
"$ref": "#/definitions/WatchInfo"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Wiki": {
|
||||||
|
"description": "Wiki",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/WikiResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"WikiList": {
|
||||||
|
"description": "WikiList",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/WikiesResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
"empty": {
|
"empty": {
|
||||||
"description": "APIEmpty is an empty response"
|
"description": "APIEmpty is an empty response"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue