闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
662 B

  1. class Api::AccountsController < ApiController
  2. before_action :set_account
  3. before_action :doorkeeper_authorize!
  4. respond_to :json
  5. def show
  6. end
  7. def following
  8. @following = @account.following
  9. end
  10. def followers
  11. @followers = @account.followers
  12. end
  13. def statuses
  14. @statuses = @account.statuses.with_includes.with_counts.order('created_at desc')
  15. end
  16. def follow
  17. @follow = current_user.account.follow!(@account)
  18. render action: :show
  19. end
  20. def unfollow
  21. @unfollow = current_user.account.unfollow!(@account)
  22. render action: :show
  23. end
  24. private
  25. def set_account
  26. @account = Account.find(params[:id])
  27. end
  28. end