service

package
v0.0.0-...-183bbd4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnswerService

type AnswerService struct {
	Client *ent.Client
}

func NewAnswerService

func NewAnswerService(client *ent.Client) *AnswerService

func (AnswerService) CreateAnswer

func (s AnswerService) CreateAnswer(payload *model.NewAnswerInput) (*ent.Answer, error)

func (AnswerService) DeleteAnswer

func (s AnswerService) DeleteAnswer(id int) error

func (AnswerService) GetAllAnswers

func (s AnswerService) GetAllAnswers(page int, itemsPerPage int) ([]*ent.Answer, error)

func (AnswerService) GetAnswer

func (s AnswerService) GetAnswer(id int) (*ent.Answer, error)

func (AnswerService) GetAnswerAuthor

func (s AnswerService) GetAnswerAuthor(id int) (*ent.Answer, error)

func (AnswerService) GetAnswerQuestion

func (s AnswerService) GetAnswerQuestion(id int) (*ent.Answer, error)

func (AnswerService) UpdateAnswer

func (s AnswerService) UpdateAnswer(id int, payload *model.UpdateAnswerInput) (*ent.Answer, error)

type AuthService

type AuthService struct {
	Client *ent.Client
}

func NewAuthService

func NewAuthService(client *ent.Client) *AuthService

func (AuthService) Login

func (s AuthService) Login(payload *model.LoginUserInput) (*ent.User, error)

type QuestionService

type QuestionService struct {
	Client *ent.Client
}

func NewQuestionService

func NewQuestionService(client *ent.Client) *QuestionService

func (QuestionService) CreateQuestion

func (s QuestionService) CreateQuestion(payload *model.NewQuestionInput) (*ent.Question, error)

func (QuestionService) DeleteQuestion

func (s QuestionService) DeleteQuestion(id int) error

func (QuestionService) GetAllQuestions

func (s QuestionService) GetAllQuestions(page int, itemsPerPage int) ([]*ent.Question, error)

func (QuestionService) GetQuestion

func (s QuestionService) GetQuestion(id int) (*ent.Question, error)

func (QuestionService) GetQuestionAnswers

func (s QuestionService) GetQuestionAnswers(id int) (*ent.Question, error)

func (QuestionService) GetQuestionAuthor

func (s QuestionService) GetQuestionAuthor(id int) (*ent.Question, error)

func (QuestionService) GetQuestionTags

func (s QuestionService) GetQuestionTags(id int) (*ent.Question, error)

func (QuestionService) UpdateQuestion

func (s QuestionService) UpdateQuestion(id int, payload *model.UpdateQuestionInput) (*ent.Question, error)

type TagService

type TagService struct {
	Client *ent.Client
}

func NewTagService

func NewTagService(client *ent.Client) *TagService

func (TagService) DeleteTag

func (s TagService) DeleteTag(id int) error

func (TagService) GetAllTags

func (s TagService) GetAllTags(page int, itemsPerPage int) ([]*ent.Tag, error)

func (TagService) GetTag

func (s TagService) GetTag(id int) (*ent.Tag, error)

func (TagService) GetTagQuestions

func (s TagService) GetTagQuestions(id int) (*ent.Tag, error)

func (TagService) UpdateTag

func (s TagService) UpdateTag(id int, payload *model.UpdateTagInput) (*ent.Tag, error)

type UserService

type UserService struct {
	Client *ent.Client
}

func NewUserService

func NewUserService(client *ent.Client) *UserService

func (UserService) CreateUser

func (s UserService) CreateUser(payload *model.NewUserInput) (*ent.User, error)

func (UserService) DeleteUser

func (s UserService) DeleteUser(id int) error

func (UserService) GetAllUsers

func (s UserService) GetAllUsers(page int, itemsPerPage int) ([]*ent.User, error)

func (UserService) GetUser

func (s UserService) GetUser(id int) (*ent.User, error)

func (UserService) GetUserAnswers

func (s UserService) GetUserAnswers(id int) (*ent.User, error)

func (UserService) GetUserQuestions

func (s UserService) GetUserQuestions(id int) (*ent.User, error)

func (UserService) UpdateUser

func (s UserService) UpdateUser(id int, payload *model.UpdateUserInput) (*ent.User, error)

Jump to

Keyboard shortcuts

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