initial commit
This commit is contained in:
50
internal/dto/role.go
Normal file
50
internal/dto/role.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package dto
|
||||
|
||||
import "base/pkg/validation"
|
||||
|
||||
type ProfileRole struct {
|
||||
Id string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
type CreateProfileRoleRequest struct {
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
func (*CreateProfileRoleRequest) Schema() validation.Schema {
|
||||
return validation.Schema{
|
||||
"title": validation.Rule{Field: "title", Type: validation.ValidationTypeString, Required: true},
|
||||
"status": validation.Rule{Field: "status", Type: validation.ValidationTypeString, Required: true},
|
||||
}
|
||||
}
|
||||
|
||||
type UpdateProfileRoleRequest struct {
|
||||
ID string `uri:"id"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
func (*UpdateProfileRoleRequest) Schema() validation.Schema {
|
||||
return validation.Schema{
|
||||
"id": validation.Rule{Field: "id", Type: validation.ValidationTypeString, Required: true},
|
||||
}
|
||||
}
|
||||
|
||||
type GetProfileRoleRequest struct {
|
||||
ID string `uri:"id"`
|
||||
}
|
||||
|
||||
func (*GetProfileRoleRequest) Schema() validation.Schema {
|
||||
return validation.Schema{
|
||||
"id": validation.Rule{Field: "id", Type: validation.ValidationTypeString, Required: true},
|
||||
}
|
||||
}
|
||||
|
||||
type DeleteProfileRoleRequest struct {
|
||||
ID string `uri:"id"`
|
||||
}
|
||||
|
||||
func (*DeleteProfileRoleRequest) Schema() validation.Schema {
|
||||
return validation.Schema{
|
||||
"id": validation.Rule{Field: "id", Type: validation.ValidationTypeString, Required: true},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user