2024-06-18 04:37:32 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
type Author struct {
|
|
|
|
ID uint `json:"id" gorm:"primary_key"`
|
|
|
|
FullName string `json:"full_name"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type CreateAuthorInput struct {
|
|
|
|
ID uint `json:"id" binding:"required"`
|
|
|
|
FullName string `json:"full_name" binding:"required"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type UpdateAuthorInput struct {
|
|
|
|
FullName string `json:"full_name"`
|
|
|
|
}
|
2024-06-19 02:59:35 +00:00
|
|
|
|
|
|
|
func NewAuthor(id uint, full_name string) Author {
|
|
|
|
author := Author{
|
|
|
|
ID: id,
|
|
|
|
FullName: full_name,
|
|
|
|
}
|
|
|
|
return author
|
|
|
|
}
|