domain

package
v0.0.0-...-bdbfe35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Id          int64  `json:"id,omitempty"`
	Description string `json:"description"`
}

type CategoryCommand

type CategoryCommand interface {
	Create(category Category) error
	Delete(categoryId int64) error
	Update(categoryId int64, category Category) error
}

type CategoryQuery

type CategoryQuery interface {
	FindAll() (*[]Category, error)
	FindById(categoryId int64) (*Category, error)
}

type Comment

type Comment struct {
	Id      int64  `json:"id,omitempty"`
	Content string `json:"content"`
	UserId  int64  `json:"user_id"`
	PostId  int64  `json:"post_id"`
}

type CommentCommand

type CommentCommand interface {
	Create(comment Comment) error
	Delete(commentId int64) error
	Update(commentId int64, comment Comment) error
}

type CommentQuery

type CommentQuery interface {
	FindAllByPost(postId int64) ([]Comment, error)
	FindById(commentId int64) (*Comment, error)
}

type Post

type Post struct {
	Id            int64   `json:"id,omitempty"`
	Title         string  `json:"title"`
	Content       string  `json:"content"`
	CreatedAt     string  `json:"created_at"`
	UserId        int64   `json:"user_id"`
	CategoriesIds []int64 `json:"categories_ids"`
}

type PostCommand

type PostCommand interface {
	Create(post Post) error
	Update(postId int64, post Post) error
	Delete(postId int64) error
}

type PostQuery

type PostQuery interface {
	SearchById(postId int64) (*Post, error)
	SearchByUser(userId int64) (*[]Post, error)
}

type User

type User struct {
	Id        int64  `json:"id,omitempty"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Email     string `json:"email"`
	PassWord  string `json:"password,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
}

func (*User) CheckPassword

func (u *User) CheckPassword(providedPassword string) error

func (*User) HashPassword

func (u *User) HashPassword() (string, error)

type UserCommand

type UserCommand interface {
	Create(user User) error
	Update(userId int64, user User) error
	Delete(userId int64) error
}

type UserQuery

type UserQuery interface {
	FindById(userId int64) (User, error)
	FindByEmail(email string) (User, error)
	FindAll() (*[]User, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL