20 lines
296 B
Go
20 lines
296 B
Go
package photosapi
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type Me struct {
|
|
User string `json:"user"`
|
|
}
|
|
|
|
func (s *Service) Me(c *gin.Context) {
|
|
c.JSON(http.StatusOK, Me{s.CurrentSession(c).Account.Login})
|
|
}
|
|
|
|
func (s *Service) MeInit() {
|
|
s.Gin.GET("/me", s.RequireSession, s.Me)
|
|
}
|