package friendhandler import ( "github.com/gin-gonic/gin" "spark-server/internal/transport/http/respond" ) func (h *Handler) GetFollow(c *gin.Context) { uid, ok := currentUID(c) if !ok { return } targetID, err := pathUID(c) if err != nil { respond.JSONError(c, err) return } out, err := h.friends.GetFollow(c.Request.Context(), uid, targetID) if err != nil { respond.JSONError(c, err) return } respond.JSON(c, out) } func (h *Handler) Follow(c *gin.Context) { uid, ok := currentUID(c) if !ok { return } targetID, err := pathUID(c) if err != nil { respond.JSONError(c, err) return } out, err := h.friends.Follow(c.Request.Context(), uid, targetID) if err != nil { respond.JSONError(c, err) return } respond.JSON(c, out) } func (h *Handler) Unfollow(c *gin.Context) { uid, ok := currentUID(c) if !ok { return } targetID, err := pathUID(c) if err != nil { respond.JSONError(c, err) return } out, err := h.friends.Unfollow(c.Request.Context(), uid, targetID) if err != nil { respond.JSONError(c, err) return } respond.JSON(c, out) }