add addFacebookPage command

This commit is contained in:
Jay 2019-08-19 15:13:38 +00:00
parent c7032bde6f
commit d24db4b509

View File

@ -52,7 +52,6 @@ func addFacebookPage(info EvtInfo, fbid, tmpl string) string {
return "check facebook fail" return "check facebook fail"
} }
if page == nil { if page == nil {
// TODO: write facebook page
page, err = pubmodel.NewFacebookPage(fbid) page, err = pubmodel.NewFacebookPage(fbid)
if err != nil { if err != nil {
return "write data fail" return "write data fail"
@ -69,6 +68,16 @@ func addFacebookPage(info EvtInfo, fbid, tmpl string) string {
if fbrt != nil { if fbrt != nil {
return "facebook page already linked" 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"
} }