Exemple #1
0
func testQueryFeed() {
	id := bson.ObjectIdHex("5069df87918d4a4c83000001")
	log.Debugf("query feed: %+v", id)
	feed, err := dao.QueryFeed(id)
	if err != nil {
		log.Fatal(err)
	}
	log.Debugf("query ret: %+v", feed)
}
Exemple #2
0
func (fs *FeedService) Delete(fid string, ret *model.Feed) error {
	logstr := fmt.Sprintf("delete feed: %s", fid)
	log.Info(logstr)
	bid := bson.ObjectIdHex(fid)
	removed, err := dao.QueryFeed(bid)
	if err != nil {
		log.Errorf("%s, error: %s", logstr, err.Error())
		return err
	}
	err = dao.RemoveFeed(bid)
	if err != nil {
		log.Errorf("%s, error: %s", logstr, err.Error())
		return err
	}
	*ret = removed
	backend.DeleteFeed(removed)
	return nil
}