add crud for users

This commit is contained in:
Andrey Savchuk committed 2018-04-27 20:18:12 +03:00
1 parent 4e608d872a
commit 678147c9ed
19 files changed
+439 -17

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
package structure
type Auth struct {
Token string `json:"token"`
Expired string `json:"expired"`
HeaderName string `json:"headerName"`
}
type AuthRequest struct {
Email string `json:"email" valid:"required~Required"`
Password string `json:"password" valid:"required~Required"`
}
+5
View File
@@ -0,0 +1,5 @@
package structure
type IdentitiesRequest struct {
Ids []int64 `json:"ids"`
}
+5
View File
@@ -0,0 +1,5 @@
package structure
type DeleteResponse struct {
Deleted int
}
+12
View File
@@ -0,0 +1,12 @@
package structure
import "time"
type Token struct {
TableName string `sql:"admin_service.tokens" json:"-"`
Id int64 `json:"id"`
UserId int64 `json:"userId"`
Token string `json:"token"`
ExpiredAt *time.Time `json:"expiredAt"`
CreatedAt time.Time `json:"createdAt" sql:",null"`
}
+28
View File
@@ -0,0 +1,28 @@
package structure
import "time"
type User struct {
TableName string `sql:"admin_service.users" json:"-"`
Id int64 `json:"id"`
Image string `json:"image"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Email string `json:"email" valid:"required~Required"`
Password string `json:"password,omitempty"`
Phone string `json:"phone"`
UpdatedAt time.Time `json:"updatedAt" sql:",null"`
CreatedAt time.Time `json:"createdAt" sql:",null"`
}
type UsersResponse struct {
Items *[]User `json:"items,omitempty"`
}
type UsersRequest struct {
Ids []int64 `json:"ids"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Email string `json:"email"`
Phone string `json:"phone"`
}