func testInsertFeed() { feed := model.Feed{Uid: "abcdef987654321", Content: model.FeedContent{Text: "second feed"}} log.Debugf("insert feed: %+v", feed) feed, err := dao.InsertFeed(feed) if err != nil { log.Fatal(err) } log.Debugf("insert ret: %+v", feed) }
func (fs *FeedService) Create(feed model.Feed, ret *model.Feed) error { logstr := fmt.Sprintf("create feed: %+v", feed) log.Info(logstr) tmp, err := dao.InsertFeed(feed) if err != nil { log.Errorf("%s, error: ", logstr, err.Error()) return err } *ret = tmp log.Infof("create feed result: %+v", tmp) backend.CreateFeed(tmp) return nil }
func testInsertFeedLoc() { feed := model.Feed{Uid: "abcdef987654321", Content: model.FeedContent{Text: "first feed"}} feed, err := dao.InsertFeed(feed) if err != nil { log.Fatal(err) } loc := model.FeedLoc{} loc.Fid = feed.Fid.Hex() loc.Loc = model.Location{Ctime: feed.Ctime, Loc: [2]float64{3.4, 1.2}} loc, err = dao.InsertFeedLoc(loc) if err != nil { log.Fatal(err) } log.Debugf("insert feed loc: %+v", loc) }