17 lines
303 B
Go
17 lines
303 B
Go
package article
|
|
|
|
import "scrap/api/httpio"
|
|
|
|
type ArticleQueryRequest struct {
|
|
Title string `json:"title"`
|
|
}
|
|
|
|
func (a ArticleQueryRequest) Validate() *httpio.HTTPError {
|
|
titleLength := len(a.Title)
|
|
if titleLength < 1 || titleLength > 255 {
|
|
return &ErrHttpArticleTitleInvalidLength
|
|
}
|
|
|
|
return nil
|
|
}
|