You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
466 B

package article
import (
"context"
"practice_ArticleVote_Go/internal/dao"
"practice_ArticleVote_Go/internal/model/do"
"practice_ArticleVote_Go/internal/service"
)
func init() {
service.RegisterArticle(New())
}
func New() *iArticle {
return &iArticle{}
}
type iArticle struct{}
func (i iArticle) AddArticle(ctx context.Context, article do.Article) (Aid int64, err error) {
Aid, err = dao.Article.Ctx(ctx).Data(article).InsertAndGetId()
return Aid, err
}