新增:simple show

This commit is contained in:
yystopf 2024-01-12 14:24:14 +08:00
parent 424a5977a1
commit 9f23022c3d
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

@ -99,6 +99,17 @@ class MemosService
end
end
def show_simple
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