mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
Derpecates UsersSerializer() from user endpoints
This commit is contained in:
parent
50b1902bf3
commit
28d81e52c2
2 changed files with 3 additions and 5 deletions
|
@ -10,7 +10,7 @@ import (
|
||||||
// The type Model is exactly the same with gorm.Model (see jinzhu/gorm)
|
// The type Model is exactly the same with gorm.Model (see jinzhu/gorm)
|
||||||
// except the json tags that are needed for serializing the models
|
// except the json tags that are needed for serializing the models
|
||||||
type Model struct {
|
type Model struct {
|
||||||
ID uint `json:",omitempty" gorm:"unique;primary_key:true"`
|
ID uint `json:"id,omitempty" gorm:"unique;primary_key:true"`
|
||||||
CreatedAt time.Time `json:"-"`
|
CreatedAt time.Time `json:"-"`
|
||||||
UpdatedAt time.Time `json:"-"`
|
UpdatedAt time.Time `json:"-"`
|
||||||
DeletedAt *time.Time `json:"-" sql:"index"`
|
DeletedAt *time.Time `json:"-" sql:"index"`
|
||||||
|
|
|
@ -168,10 +168,8 @@ func getUsers(c *gin.Context) {
|
||||||
if common.ProvideErrorResponse(c, err) {
|
if common.ProvideErrorResponse(c, err) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
serializer := common.UsersSerializer{c, users}
|
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{"users": users})
|
||||||
"users": serializer.Response(true),
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddUser godoc
|
// AddUser godoc
|
||||||
|
|
Loading…
Add table
Reference in a new issue