Added: downloading and returning wikipedia articles
This commit is contained in:
16
api/article/request.go
Normal file
16
api/article/request.go
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user