diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index acc826614..532f29ba1 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -313,6 +313,7 @@ class UsersController < ApplicationController :occupation, :technical_title, :school_id, :department_id, :province, :city, :custom_department, :identity, :student_id, :description, + :show_super_description, :super_description, :show_email, :show_location, :show_department] ) end diff --git a/app/models/user.rb b/app/models/user.rb index d661ab591..fa940c29e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -187,7 +187,7 @@ class User < Owner attr_accessor :password, :password_confirmation delegate :description, :gender, :department_id, :school_id, :location, :location_city, - :show_email, :show_location, :show_department, + :show_email, :show_location, :show_department, :super_description, :show_super_description, :technical_title, :province, :city, :custom_department, to: :user_extension, allow_nil: true before_save :update_hashed_password, :set_lastname diff --git a/app/models/user_extension.rb b/app/models/user_extension.rb index ee208af7e..379243bf8 100644 --- a/app/models/user_extension.rb +++ b/app/models/user_extension.rb @@ -2,35 +2,34 @@ # # Table name: user_extensions # -# id :integer not null, primary key -# user_id :integer not null -# birthday :date -# brief_introduction :string(255) -# gender :integer -# location :string(255) -# occupation :string(255) -# work_experience :integer -# zip_code :integer -# created_at :datetime not null -# updated_at :datetime not null -# technical_title :string(255) -# identity :integer -# student_id :string(255) -# teacher_realname :string(255) -# student_realname :string(255) -# location_city :string(255) -# school_id :integer -# description :string(255) default("") -# department_id :integer -# honor :text(65535) -# edu_background :integer -# edu_entry_year :integer -# province :string(255) -# city :string(255) -# custom_department :string(255) -# show_email :boolean default("0") -# show_location :boolean default("0") -# show_department :boolean default("0") +# id :integer not null, primary key +# user_id :integer not null +# birthday :date +# brief_introduction :string(255) +# gender :integer +# location :string(255) +# occupation :string(255) +# work_experience :integer +# zip_code :integer +# created_at :datetime not null +# updated_at :datetime not null +# technical_title :string(255) +# identity :integer +# student_id :string(255) +# teacher_realname :string(255) +# student_realname :string(255) +# location_city :string(255) +# school_id :integer +# description :string(255) default("") +# department_id :integer +# province :string(255) +# city :string(255) +# custom_department :string(255) +# show_email :boolean default("0") +# show_location :boolean default("0") +# show_department :boolean default("0") +# super_description :text(4294967295) +# show_super_description :boolean # # Indexes # diff --git a/app/views/users/get_user_info.json.jbuilder b/app/views/users/get_user_info.json.jbuilder index 5fa4df167..8fcadb1c8 100644 --- a/app/views/users/get_user_info.json.jbuilder +++ b/app/views/users/get_user_info.json.jbuilder @@ -21,5 +21,6 @@ json.province @user.province json.city @user.city json.custom_department @user.custom_department json.description @user.description -json.(@user, :show_email, :show_department, :show_location) +json.super_description @user.super_description +json.(@user, :show_email, :show_department, :show_location, :show_super_description) json.message_unread_total @message_unread_total diff --git a/app/views/users/show.json.jbuilder b/app/views/users/show.json.jbuilder index 1c9e7793f..f35705ce6 100644 --- a/app/views/users/show.json.jbuilder +++ b/app/views/users/show.json.jbuilder @@ -13,4 +13,5 @@ json.email @user.show_email ? @user.mail : nil json.province @user.show_location ? @user.province : nil json.city @user.show_location ? @user.city : nil json.custom_department @user.show_department ? @user.custom_department : nil +json.super_description @user.show_super_description ? @user.super_description : nil json.description @user.description \ No newline at end of file diff --git a/db/migrate/20220428015313_add_super_description_to_user_extensions.rb b/db/migrate/20220428015313_add_super_description_to_user_extensions.rb new file mode 100644 index 000000000..076516779 --- /dev/null +++ b/db/migrate/20220428015313_add_super_description_to_user_extensions.rb @@ -0,0 +1,6 @@ +class AddSuperDescriptionToUserExtensions < ActiveRecord::Migration[5.2] + def change + add_column :user_extensions, :super_description, :text, :limit => 4294967295 + add_column :user_extensions, :show_super_description, :boolean + end +end