article

package
v1.0.68 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleService

type ArticleService struct {
	// contains filtered or unexported fields
}

func NewArticleService

func NewArticleService(db *gorm.DB, ctx *context.ERPContext) *ArticleService

func (*ArticleService) CreateArticle

func (s *ArticleService) CreateArticle(data *models.ArticleModel) error

CreateArticle creates a new article in the database.

The function takes a pointer to an ArticleModel, which contains the data to be inserted into the database. It returns an error if the insertion fails, or nil if the insertion is successful.

func (*ArticleService) DeleteArticle

func (s *ArticleService) DeleteArticle(id string) error

func (*ArticleService) GetArticleByID

func (s *ArticleService) GetArticleByID(id string) (*models.ArticleModel, error)

GetArticleByID retrieves an article from the database by its ID.

It takes an ID as input and returns an ArticleModel and an error. The function uses GORM to retrieve the article data from the articles table. If the operation fails, an error is returned.

func (*ArticleService) GetArticles

func (s *ArticleService) GetArticles(request http.Request, search string) (paginate.Page, error)

func (*ArticleService) UpdateArticle

func (s *ArticleService) UpdateArticle(id string, data *models.ArticleModel) error

Jump to

Keyboard shortcuts

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