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
398 B

  1. package service
  2. import (
  3. "context"
  4. "practice_ArticleVote_Go/internal/model/do"
  5. )
  6. type IArticle interface {
  7. AddArticle(ctx context.Context, article do.Article) (Aid int64, err error)
  8. }
  9. var localArticle IArticle
  10. func Article() IArticle {
  11. if localArticle == nil {
  12. panic("IArticle接口未实现或未注册")
  13. }
  14. return localArticle
  15. }
  16. func RegisterArticle(i IArticle) {
  17. localArticle = i
  18. }