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
401 B
23 lines
401 B
package service
|
|
|
|
import (
|
|
"context"
|
|
"practice_ArticleVote_Go/api/article"
|
|
)
|
|
|
|
type IArticle interface {
|
|
AddArticle(ctx context.Context, article *article.ArticleReq) (Aid int64, err error)
|
|
}
|
|
|
|
var localArticle IArticle
|
|
|
|
func Article() IArticle {
|
|
if localArticle == nil {
|
|
panic("IArticle接口未实现或未注册")
|
|
}
|
|
return localArticle
|
|
}
|
|
|
|
func RegisterArticle(i IArticle) {
|
|
localArticle = i
|
|
}
|