Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertFeedToProtoFeed(feed Feed) *proto_build.Feed
- func CreateImageFeed(db *gorm.DB, userId uint64, content string, resource []string) (*proto_build.Feed, error)
- func CreateTextFeed(db *gorm.DB, userId uint64, content string) (*proto_build.Feed, error)
- func CreateVideoFeed(db *gorm.DB, userId uint64, content string, resource []string) (*proto_build.Feed, error)
- func DeleteFeed(db *gorm.DB, id uint64) error
- func GetFeedById(db *gorm.DB, id uint64) (*proto_build.Feed, error)
- func GetFeedByUserId(db *gorm.DB, userId uint64) (*proto_build.Feed, error)
- func LikeFeed(db *gorm.DB, id uint64, userId uint64) error
- func OwnFeed(db *gorm.DB, userId uint64, reviewStatus int32, keyword string, lastId uint64, ...) ([]*proto_build.Feed, *proto_build.Pager, error)
- func QueryFeed(db *gorm.DB, keyword string, lastId uint64, num uint64) ([]*proto_build.Feed, *proto_build.Pager, error)
- func UnLikeFeed(db *gorm.DB, id uint64, userId uint64) error
- type Feed
- type FeedImage
- type FeedLike
- type FeedVideo
- type Service
- func (s *Service) FeedCreate(c context.Context, req *proto_build.FeedCreateRequest) (*proto_build.FeedCreateResponse, error)
- func (s *Service) FeedDelete(c context.Context, req *proto_build.FeedDeleteRequest) (*proto_build.FeedDeleteResponse, error)
- func (s *Service) FeedEdit(c context.Context, req *proto_build.FeedEditRequest) (*proto_build.FeedEditResponse, error)
- func (s *Service) FeedFollow(c context.Context, req *proto_build.FeedFollowRequest) (*proto_build.FeedFollowResponse, error)
- func (s *Service) FeedGet(c context.Context, req *proto_build.FeedGetRequest) (*proto_build.FeedGetResponse, error)
- func (s *Service) FeedLike(c context.Context, req *proto_build.FeedLikeRequest) (*proto_build.FeedLikeResponse, error)
- func (s *Service) FeedOwn(c context.Context, req *proto_build.FeedOwnRequest) (*proto_build.FeedOwnResponse, error)
- func (s *Service) FeedQuery(c context.Context, req *proto_build.FeedQueryRequest) (*proto_build.FeedQueryResponse, error)
- func (s *Service) FeedUnLike(c context.Context, req *proto_build.FeedUnLikeRequest) (*proto_build.FeedUnLikeResponse, error)
- func (s *Service) Ping(c context.Context, req *proto_build.PingRequest) (*proto_build.PingResponse, error)
Constants ¶
View Source
const ( FeedTypeTxt = 0 //文本 FeedTypeImage = 1 //图片 FeedTypeVideo = 2 //视频 )
Variables ¶
View Source
var FeedTypeDbToProto = map[int32]proto_build.FeedType{ FeedTypeTxt: proto_build.FeedType_Txt, FeedTypeImage: proto_build.FeedType_Image, FeedTypeVideo: proto_build.FeedType_Video, }
View Source
var FeedTypeProtoToDb = map[proto_build.FeedType]int32{ proto_build.FeedType_Txt: FeedTypeTxt, proto_build.FeedType_Image: FeedTypeImage, proto_build.FeedType_Video: FeedTypeVideo, }
Functions ¶
func ConvertFeedToProtoFeed ¶
func ConvertFeedToProtoFeed(feed Feed) *proto_build.Feed
func CreateImageFeed ¶
func CreateTextFeed ¶
func CreateVideoFeed ¶
func GetFeedById ¶
func GetFeedByUserId ¶
Types ¶
type Service ¶
type Service struct { service.BasicService proto_build.UnimplementedFeedServiceServer }
func NewService ¶
func (*Service) FeedCreate ¶
func (s *Service) FeedCreate(c context.Context, req *proto_build.FeedCreateRequest) (*proto_build.FeedCreateResponse, error)
func (*Service) FeedDelete ¶
func (s *Service) FeedDelete(c context.Context, req *proto_build.FeedDeleteRequest) (*proto_build.FeedDeleteResponse, error)
func (*Service) FeedEdit ¶
func (s *Service) FeedEdit(c context.Context, req *proto_build.FeedEditRequest) (*proto_build.FeedEditResponse, error)
func (*Service) FeedFollow ¶
func (s *Service) FeedFollow(c context.Context, req *proto_build.FeedFollowRequest) (*proto_build.FeedFollowResponse, error)
func (*Service) FeedGet ¶
func (s *Service) FeedGet(c context.Context, req *proto_build.FeedGetRequest) (*proto_build.FeedGetResponse, error)
func (*Service) FeedLike ¶
func (s *Service) FeedLike(c context.Context, req *proto_build.FeedLikeRequest) (*proto_build.FeedLikeResponse, error)
func (*Service) FeedOwn ¶
func (s *Service) FeedOwn(c context.Context, req *proto_build.FeedOwnRequest) (*proto_build.FeedOwnResponse, error)
func (*Service) FeedQuery ¶
func (s *Service) FeedQuery(c context.Context, req *proto_build.FeedQueryRequest) (*proto_build.FeedQueryResponse, error)
func (*Service) FeedUnLike ¶
func (s *Service) FeedUnLike(c context.Context, req *proto_build.FeedUnLikeRequest) (*proto_build.FeedUnLikeResponse, error)
func (*Service) Ping ¶
func (s *Service) Ping(c context.Context, req *proto_build.PingRequest) (*proto_build.PingResponse, error)
Click to show internal directories.
Click to hide internal directories.