关闭匿评
This commit is contained in:
parent
89e0f98034
commit
b6207c0a47
|
@ -35,7 +35,7 @@ module Mobile
|
||||||
params do
|
params do
|
||||||
requires :token, type: String
|
requires :token, type: String
|
||||||
end
|
end
|
||||||
post ':id/alert_homework_anonymous_comment' do
|
post ':id/start_anonymous_comment' do
|
||||||
statue = Homeworks.get_service.start_anonymous_comment params,current_user.nil? ? User.find(2):current_user
|
statue = Homeworks.get_service.start_anonymous_comment params,current_user.nil? ? User.find(2):current_user
|
||||||
messages = ""
|
messages = ""
|
||||||
case statue
|
case statue
|
||||||
|
@ -50,6 +50,15 @@ module Mobile
|
||||||
present :status, statue
|
present :status, statue
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "关闭匿评"
|
||||||
|
params do
|
||||||
|
requires :token, type: String
|
||||||
|
end
|
||||||
|
post ':id/stop_anonymous_comment' do
|
||||||
|
Homeworks.get_service.stop_anonymous_comment params,current_user.nil? ? User.find(2):current_user
|
||||||
|
present :status, 0
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -86,6 +86,15 @@ class HomeworkService
|
||||||
end
|
end
|
||||||
@statue
|
@statue
|
||||||
end
|
end
|
||||||
|
#关闭匿评
|
||||||
|
def stop_anonymous_comment params,current_user
|
||||||
|
@bid = Bid.find(params[:id])
|
||||||
|
@course = @bid.courses.first
|
||||||
|
unless is_course_teacher(current_user,@course) || current_user.admin?
|
||||||
|
raise '403'
|
||||||
|
end
|
||||||
|
@bid.update_column('comment_status', 2)
|
||||||
|
end
|
||||||
|
|
||||||
# 匿评作品详情
|
# 匿评作品详情
|
||||||
# attachs 该作品的所有附件
|
# attachs 该作品的所有附件
|
||||||
|
|
Loading…
Reference in New Issue