services

package
v0.0.0-...-2a09b22 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	DB *gorm.DB
}

func (*Article) Count

func (a *Article) Count() (bool, int64)

func (*Article) Create

func (a *Article) Create(articleDto *dto.ArticleDto) (isError bool, message string)

func (*Article) Delete

func (a *Article) Delete(articleDto *dto.ArticleDtoForDelete) (isError bool, message string)

func (*Article) Detail

func (a *Article) Detail(articleID uint) (bool, *models.Article)

func (*Article) Edit

func (a *Article) Edit(articleDto *dto.ArticleDtoForEdit) (isError bool, message string)

func (*Article) List

func (a *Article) List(offset uint) (bool, *models.ApiArticleList)

List TODO: label,keyword will add later=

func (*Article) MyList

func (a *Article) MyList(uid uint) (bool, *models.ApiArticleList)

type Auth

type Auth struct {
	DB *gorm.DB
}

func (*Auth) BeforeModify

func (a *Auth) BeforeModify(authDto *dto.AuthDtoForModify) (bool, string)

func (*Auth) Login

func (a *Auth) Login(authDto *dto.AuthDto, forRegisterAuth bool) (bool, string, string)

Login forRegisterAuth:whether used for register auth or only used for login

func (*Auth) Modify

func (a *Auth) Modify(authDto *dto.AuthDtoForModify) (bool, string)

modify password

func (*Auth) Register

func (a *Auth) Register(authDto *dto.AuthDto) bool

Register before call Register,controller should call login, to ensure this user was not exists

type Comment

type Comment struct {
	DB *gorm.DB
}

func (*Comment) CommentNumberModify

func (c *Comment) CommentNumberModify(articleID uint, signal string) bool

func (*Comment) Create

func (c *Comment) Create(commentDto *dto.CommentDtoForCreate) bool

func (*Comment) Delete

func (c *Comment) Delete(commentDto *dto.CommentDtoForDelete) bool

Delete jwt-->article owner,comment user

func (*Comment) Edit

func (c *Comment) Edit(commentDto *dto.CommentDtoForEdit) bool

jwt-->comment user

func (*Comment) Like

func (c *Comment) Like(likeDto *dto.LikeDto, signal string) bool

func (*Comment) LikeShow

func (c *Comment) LikeShow(likeDto *dto.LikeDto) (bool, string)

func (*Comment) LikeStatusShow

func (c *Comment) LikeStatusShow(likeDto *dto.LikeDto) (ok bool, isLike bool)

func (*Comment) LikesShow

func (c *Comment) LikesShow(likesDto *dto.LikesDto) (bool, []bool)

func (*Comment) List

func (c *Comment) List(ad uint) (bool, *models.ApiComments)

func (*Comment) MyList

func (c *Comment) MyList(ud uint) (bool, *models.ApiComments)

type Profile

type Profile struct {
	DB *gorm.DB
}

func (*Profile) Create

func (p *Profile) Create(profileDto *dto.UserProfileDto, authDto *dto.AuthDto) (ok bool)

Create one user only call this once after register

func (*Profile) Edit

func (p *Profile) Edit(profileDto *dto.UserProfileDtoForEdit) (ok bool)

func (*Profile) Show

func (p *Profile) Show(userID uint) (bool, *models.UserProfile)

Jump to

Keyboard shortcuts

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