Expose some API structs
continuous-integration/drone/push Build is failing Details

This commit is contained in:
nemunaire 2023-09-07 12:22:33 +02:00
parent 4119a55fd1
commit e070b6e82b
2 changed files with 4 additions and 4 deletions

View File

@ -185,7 +185,7 @@ func DomainHandler(c *gin.Context) {
c.Next()
}
type apiDomain struct {
type APIDomain struct {
// Id is the Domain's identifier in the database.
Id happydns.Identifier `json:"id" swaggertype:"string"`
@ -222,7 +222,7 @@ type apiDomain struct {
// @Router /domains/{domainId} [get]
func GetDomain(c *gin.Context) {
domain := c.MustGet("domain").(*happydns.Domain)
ret := &apiDomain{
ret := &APIDomain{
Id: domain.Id,
IdUser: domain.IdUser,
IdProvider: domain.IdProvider,

View File

@ -161,7 +161,7 @@ func logout(opts *config.Options, c *gin.Context) {
c.Status(http.StatusNoContent)
}
type loginForm struct {
type LoginForm struct {
// Email of the user.
Email string
@ -183,7 +183,7 @@ type loginForm struct {
// @Failure 500 {object} happydns.Error
// @Router /auth [post]
func checkAuth(opts *config.Options, c *gin.Context) {
var lf loginForm
var lf LoginForm
if err := c.ShouldBindJSON(&lf); err != nil {
log.Printf("%s sends invalid LoginForm JSON: %s", c.ClientIP(), err.Error())
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"errmsg": fmt.Sprintf("Something is wrong in received data: %s", err.Error())})