Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUpdateUserNoteStarNotFound = gonethttpresponse.NewFailResponseError( "note_id", "note not found", nil, http.StatusNotFound, ) ErrUpdateUserNoteTrashNotFound = gonethttpresponse.NewFailResponseError( "note_id", "note not found", nil, http.StatusNotFound, ) ErrUpdateUserNoteArchiveNotFound = gonethttpresponse.NewFailResponseError( "note_id", "note not found", nil, http.StatusNotFound, ) ErrUpdateUserNotePinNotFound = gonethttpresponse.NewFailResponseError( "note_id", "note not found", nil, http.StatusNotFound, ) ErrGetUserNoteByIDNotFound = gonethttpresponse.NewFailResponseError( "note_id", "note not found", nil, http.StatusNotFound, ) ErrUpdateUserNoteNotFound = gonethttpresponse.NewFailResponseError( "note_id", "note not found", nil, http.StatusNotFound, ) ErrDeleteUserNoteNotFound = gonethttpresponse.NewFailResponseError( "note_id", "note not found", nil, http.StatusNotFound, ) )
View Source
var ( Service = &service{} Controller = &controller{} Module = &gonethttp.Module{ Pattern: "/note", Service: Service, Controller: Controller, BeforeLoadFn: func(m *gonethttp.Module) { m.Middlewares = gonethttp.NewMiddlewares( internalmiddleware.AuthenticateAccessToken, ) }, Submodules: gonethttp.NewSubmodules( internalrouterapiv1noteversion.Module, internalrouterapiv1noteversions.Module, internalrouterapiv1notetags.Module, ), RegisterRoutesFn: func(m *gonethttp.Module) { m.RegisterExactRoute( "POST /", Controller.CreateUserNote, internalmiddleware.Validate( &CreateUserNoteRequest{}, ), ) m.RegisterExactRoute( "PUT /", Controller.UpdateUserNote, internalmiddleware.Validate( &UpdateUserNoteRequest{}, ), ) m.RegisterExactRoute( "DELETE /", Controller.DeleteUserNote, internalmiddleware.Validate( &DeleteUserNoteRequest{}, ), ) m.RegisterExactRoute( "GET /", Controller.GetUserNoteByID, internalmiddleware.Validate( &GetUserNoteByIDRequest{}, ), ) m.RegisterExactRoute( "PUT /pin", Controller.UpdateUserNotePin, internalmiddleware.Validate( &UpdateUserNotePinRequest{}, ), ) m.RegisterExactRoute( "PUT /archive", Controller.UpdateUserNoteArchive, internalmiddleware.Validate( &UpdateUserNoteArchiveRequest{}, ), ) m.RegisterExactRoute( "PUT /trash", Controller.UpdateUserNoteTrash, internalmiddleware.Validate( &UpdateUserNoteTrashRequest{}, ), ) m.RegisterExactRoute( "PUT /star", Controller.UpdateUserNoteStar, internalmiddleware.Validate( &UpdateUserNoteStarRequest{}, ), ) }, } )
Functions ¶
This section is empty.
Types ¶
type CreateUserNoteRequest ¶
type CreateUserNoteRequest struct {
Title string `json:"title"`
NoteTagsID []string `json:"note_tags_id,omitempty"`
Color *string `json:"color,omitempty"`
Pinned bool `json:"pinned"`
Archived bool `json:"archived"`
Starred bool `json:"starred"`
Trashed bool `json:"trashed"`
EncryptedContent string `json:"encrypted_content"`
}
CreateUserNoteRequest is the request DTO to create a user note
type DeleteUserNoteRequest ¶
type DeleteUserNoteRequest struct {
NoteID int64 `json:"note_id"`
}
DeleteUserNoteRequest is the request DTO to delete a user note
type GetUserNoteByIDRequest ¶
type GetUserNoteByIDRequest struct {
NoteID int64 `json:"note_id"`
}
GetUserNoteByIDRequest is the request DTO to get a user note by ID
type GetUserNoteByIDResponse ¶
type GetUserNoteByIDResponse struct {
Note internalpostgresmodel.UserNote `json:"note"`
}
GetUserNoteByIDResponse is the response DTO to get a user note by ID
type UpdateUserNoteArchiveRequest ¶
type UpdateUserNoteArchiveRequest struct {
NoteID int64 `json:"note_id"`
Archive bool `json:"archive"`
}
UpdateUserNoteArchiveRequest is the request DTO to archive/unarchive a note
type UpdateUserNotePinRequest ¶
UpdateUserNotePinRequest is the request DTO to pin/unpin a note
type UpdateUserNoteRequest ¶
type UpdateUserNoteRequest struct {
NoteID int64 `json:"note_id"`
Title *string `json:"title,omitempty"`
Color *string `json:"color,omitempty"`
}
UpdateUserNoteRequest is the request DTO to update a user note
type UpdateUserNoteStarRequest ¶
UpdateUserNoteStarRequest is the request DTO to star/unstar a note
type UpdateUserNoteTrashRequest ¶
UpdateUserNoteTrashRequest is the request DTO to trash/untrash a note
Click to show internal directories.
Click to hide internal directories.