merge from dev_forum

This commit is contained in:
yystopf 2024-01-12 14:33:49 +08:00
commit 59cc64038d
3 changed files with 17 additions and 0 deletions

View File

@ -27,6 +27,11 @@ class MemosController < ApplicationController
render json: targets
end
def show_simple
targets = MemosService.new.show_simple params, current_user
render json: targets
end
def show
targets = MemosService.new.show params, current_user
render json: targets

View File

@ -100,6 +100,17 @@ class MemosService
end
end
def show_simple params, current_user
memo = Memo.find(params[:id])
memo_info = {id: memo.id,
subject: memo.subject,
published_time: rename_time_minute(memo.published_at),
viewed_count: memo.viewed_count, #浏览
}
{status: 0, memo: memo_info}
end
# params
# :id 帖子id
# return

View File

@ -73,6 +73,7 @@ Rails.application.routes.draw do
get :more_reply
post :confirm_delete
post :plus
get :show_simple
end
end
# resources :sync_forge, only: [:create] do