A community based topic aggregation platform built on atproto

feat(api): add vote route registration

Register vote XRPC endpoints on the router:
- POST /xrpc/social.coves.feed.vote.create (authenticated)
- POST /xrpc/social.coves.feed.vote.delete (authenticated)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

+24
+24
internal/api/routes/vote.go
··· 1 + package routes 2 + 3 + import ( 4 + "Coves/internal/api/handlers/vote" 5 + "Coves/internal/api/middleware" 6 + "Coves/internal/core/votes" 7 + 8 + "github.com/go-chi/chi/v5" 9 + ) 10 + 11 + // RegisterVoteRoutes registers vote-related XRPC endpoints on the router 12 + // Implements social.coves.feed.vote.* lexicon endpoints 13 + func RegisterVoteRoutes(r chi.Router, voteService votes.Service, authMiddleware *middleware.OAuthAuthMiddleware) { 14 + // Initialize handlers 15 + createHandler := vote.NewCreateVoteHandler(voteService) 16 + deleteHandler := vote.NewDeleteVoteHandler(voteService) 17 + 18 + // Procedure endpoints (POST) - require authentication 19 + // social.coves.feed.vote.create - create or update a vote on a post/comment 20 + r.With(authMiddleware.RequireAuth).Post("/xrpc/social.coves.feed.vote.create", createHandler.HandleCreateVote) 21 + 22 + // social.coves.feed.vote.delete - delete a vote from a post/comment 23 + r.With(authMiddleware.RequireAuth).Post("/xrpc/social.coves.feed.vote.delete", deleteHandler.HandleDeleteVote) 24 + }