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.
19 lines
449 B
19 lines
449 B
package service |
|
|
|
import ( |
|
"context" |
|
|
|
artmdl "go-common/app/interface/openplatform/article/model" |
|
"go-common/library/ecode" |
|
) |
|
|
|
// AddShare adds share stats count. |
|
func (s *Service) AddShare(c context.Context, id int64, mid int64, ip string) (err error) { |
|
var res *artmdl.Meta |
|
if res, err = s.ArticleMeta(c, id); (err != nil) || (res == nil) || (!res.IsNormal()) { |
|
err = ecode.NothingFound |
|
return |
|
} |
|
s.dao.PubShare(c, mid, id, ip) |
|
return |
|
}
|
|
|