新增:uuid或者url字段

This commit is contained in:
yystopf 2025-05-19 10:50:54 +08:00
parent 4f4296c0ff
commit f750d14c85
6 changed files with 20 additions and 1 deletions

View File

@ -53,6 +53,6 @@ class Admins::Topic::TechnicalDiscussionsController < Admins::Topic::BaseControl
end
def discussion_params
params.require(:topic_technical_discussion).permit(:title, :description, :date, :order_index)
params.require(:topic_technical_discussion).permit(:title, :description, :identifier, :date, :order_index)
end
end

View File

@ -22,6 +22,12 @@
</label>
<%= p.text_area :content,class: "form-control input-lg",required: true%>
</div>
<div class="form-group">
<label>
uuid/url <span class="ml10 color-orange mr20">*</span>
</label>
<%= p.text_field :url_or_uuid,class: "form-control input-lg",required: true%>
</div>
<div class="form-group">
<label>
标签(多个请用,隔开) <span class="ml10 color-orange mr20">*</span>

View File

@ -27,6 +27,12 @@
</label>
<%= p.text_field :date,class: "form-control input-lg",required: true%>
</div>
<div class="form-group">
<label>
uuid/url <span class="ml10 color-orange mr20">*</span>
</label>
<%= p.text_field :description,class: "form-control input-lg",required: true%>
</div>
<div class="form-group">
<label>
排序等级

View File

@ -8,5 +8,6 @@ json.communicates do
json.watched current_user.watched?(communicate)
json.enroll_field communicate.enroll_field.to_s.split(",")
json.enroll_info current_user.watched?(communicate) ? communicate.watched_ext_info(current_user.id) : []
json.url_or_uuid communicate.url_or_uuid
end
end

View File

@ -1 +1,2 @@
json.(technical_discussion, :id, :title, :description, :date, :order_index)
json.url_or_uuid technical_discussion.identifier

View File

@ -0,0 +1,5 @@
class AddUrlOrUuidToPlatformCommunicates < ActiveRecord::Migration[5.2]
def change
add_column :platform_communicates, :url_or_uuid, :string
end
end