forked from NYANDEV/forgejo
#1692 APIs: Users Followers
- User profile un/follow - List user's followers/following
This commit is contained in:
parent
c62a6b7a12
commit
a49af93faf
27 changed files with 641 additions and 271 deletions
|
@ -135,19 +135,32 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||
m.Group("/users", func() {
|
||||
m.Group("/:username", func() {
|
||||
m.Get("/keys", user.ListPublicKeys)
|
||||
|
||||
m.Get("/followers", user.ListFollowers)
|
||||
m.Group("/following", func() {
|
||||
m.Get("", user.ListFollowing)
|
||||
m.Get("/:target", user.CheckFollowing)
|
||||
})
|
||||
})
|
||||
}, ReqToken())
|
||||
|
||||
m.Group("/user", func() {
|
||||
m.Combo("/emails").Get(user.ListEmails).
|
||||
Post(bind(api.CreateEmailOption{}), user.AddEmail).
|
||||
Delete(bind(api.CreateEmailOption{}), user.DeleteEmail)
|
||||
|
||||
m.Get("/followers", user.ListMyFollowers)
|
||||
m.Group("/following", func() {
|
||||
m.Get("", user.ListMyFollowing)
|
||||
m.Combo("/:username").Get(user.CheckMyFollowing).Put(user.Follow).Delete(user.Unfollow)
|
||||
})
|
||||
|
||||
m.Group("/keys", func() {
|
||||
m.Combo("").Get(user.ListMyPublicKeys).
|
||||
Post(bind(api.CreateKeyOption{}), user.CreatePublicKey)
|
||||
m.Combo("/:id").Get(user.GetPublicKey).
|
||||
Delete(user.DeletePublicKey)
|
||||
})
|
||||
m.Combo("/emails").Get(user.ListEmails).
|
||||
Post(bind(api.CreateEmailOption{}), user.AddEmail).
|
||||
Delete(bind(api.CreateEmailOption{}), user.DeleteEmail)
|
||||
}, ReqToken())
|
||||
|
||||
// Repositories
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue