Improve API

This commit is contained in:
2023-04-02 17:31:37 +03:00
parent bc61b916f9
commit 11a6171954
12 changed files with 260 additions and 25 deletions

View File

@@ -15,6 +15,33 @@ func (s *ErrorStatusCode) Error() string {
return fmt.Sprintf("code %d: %+v", s.StatusCode, s.Response)
}
type AddPageBadRequest struct {
Field string `json:"field"`
Error string `json:"error"`
}
// GetField returns the value of Field.
func (s *AddPageBadRequest) GetField() string {
return s.Field
}
// GetError returns the value of Error.
func (s *AddPageBadRequest) GetError() string {
return s.Error
}
// SetField sets the value of Field.
func (s *AddPageBadRequest) SetField(val string) {
s.Field = val
}
// SetError sets the value of Error.
func (s *AddPageBadRequest) SetError(val string) {
s.Error = val
}
func (*AddPageBadRequest) addPageRes() {}
type AddPageReq struct {
URL string `json:"url"`
Description OptString `json:"description"`
@@ -349,6 +376,8 @@ func (s *Page) SetStatus(val Status) {
s.Status = val
}
func (*Page) addPageRes() {}
// Merged schema.
// Ref: #/components/schemas/pageWithResults
type PageWithResults struct {