add addFacebookPage command
This commit is contained in:
parent
c7032bde6f
commit
d24db4b509
@ -52,7 +52,6 @@ func addFacebookPage(info EvtInfo, fbid, tmpl string) string {
|
||||
return "check facebook fail"
|
||||
}
|
||||
if page == nil {
|
||||
// TODO: write facebook page
|
||||
page, err = pubmodel.NewFacebookPage(fbid)
|
||||
if err != nil {
|
||||
return "write data fail"
|
||||
@ -69,6 +68,16 @@ func addFacebookPage(info EvtInfo, fbid, tmpl string) string {
|
||||
if fbrt != nil {
|
||||
return "facebook page already linked"
|
||||
}
|
||||
|
||||
rt, err := dsmodel.CreateFacebookRT(info.Channel, page.ID, tmpl)
|
||||
if err != nil {
|
||||
return "create data fail"
|
||||
}
|
||||
|
||||
err = rt.Write()
|
||||
if err != nil {
|
||||
return "write data fail"
|
||||
}
|
||||
}
|
||||
return ""
|
||||
return "Success"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user