add: home index models
This commit is contained in:
parent
2273b4817e
commit
94075717e2
|
@ -0,0 +1,17 @@
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: topics
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# type :string(255)
|
||||||
|
# title :string(255)
|
||||||
|
# uuid :integer
|
||||||
|
# image_url :string(255)
|
||||||
|
# url :string(255)
|
||||||
|
# order_index :integer
|
||||||
|
#
|
||||||
|
|
||||||
|
class Topic < ApplicationRecord
|
||||||
|
|
||||||
|
default_scope { order(order_index: :desc)}
|
||||||
|
end
|
|
@ -0,0 +1,17 @@
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: topics
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# type :string(255)
|
||||||
|
# title :string(255)
|
||||||
|
# uuid :integer
|
||||||
|
# image_url :string(255)
|
||||||
|
# url :string(255)
|
||||||
|
# order_index :integer
|
||||||
|
#
|
||||||
|
|
||||||
|
# 首页平台动态
|
||||||
|
class Topic::ActivityForum < Topic
|
||||||
|
|
||||||
|
end
|
|
@ -0,0 +1,16 @@
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: topics
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# type :string(255)
|
||||||
|
# title :string(255)
|
||||||
|
# uuid :integer
|
||||||
|
# image_url :string(255)
|
||||||
|
# url :string(255)
|
||||||
|
# order_index :integer
|
||||||
|
#
|
||||||
|
|
||||||
|
# 首页banner
|
||||||
|
class Topic::Banner < Topic
|
||||||
|
end
|
|
@ -0,0 +1,16 @@
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: topics
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# type :string(255)
|
||||||
|
# title :string(255)
|
||||||
|
# uuid :integer
|
||||||
|
# image_url :string(255)
|
||||||
|
# url :string(255)
|
||||||
|
# order_index :integer
|
||||||
|
#
|
||||||
|
|
||||||
|
# 首页卡片内容
|
||||||
|
class Topic::Card < Topic
|
||||||
|
end
|
|
@ -0,0 +1,16 @@
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: topics
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# type :string(255)
|
||||||
|
# title :string(255)
|
||||||
|
# uuid :integer
|
||||||
|
# image_url :string(255)
|
||||||
|
# url :string(255)
|
||||||
|
# order_index :integer
|
||||||
|
#
|
||||||
|
|
||||||
|
# 首页合作伙伴
|
||||||
|
class Topic::Cooperator < Topic
|
||||||
|
end
|
|
@ -0,0 +1,17 @@
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: topics
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# type :string(255)
|
||||||
|
# title :string(255)
|
||||||
|
# uuid :integer
|
||||||
|
# image_url :string(255)
|
||||||
|
# url :string(255)
|
||||||
|
# order_index :integer
|
||||||
|
#
|
||||||
|
|
||||||
|
# 首页优秀项目
|
||||||
|
class Topic::ExcellentProject < Topic
|
||||||
|
|
||||||
|
end
|
|
@ -0,0 +1,16 @@
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: topics
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# type :string(255)
|
||||||
|
# title :string(255)
|
||||||
|
# uuid :integer
|
||||||
|
# image_url :string(255)
|
||||||
|
# url :string(255)
|
||||||
|
# order_index :integer
|
||||||
|
#
|
||||||
|
|
||||||
|
# 首页经验分享
|
||||||
|
class Topic::ExperienceForum < Topic
|
||||||
|
end
|
|
@ -0,0 +1,16 @@
|
||||||
|
# == Schema Information
|
||||||
|
#
|
||||||
|
# Table name: topics
|
||||||
|
#
|
||||||
|
# id :integer not null, primary key
|
||||||
|
# type :string(255)
|
||||||
|
# title :string(255)
|
||||||
|
# uuid :integer
|
||||||
|
# image_url :string(255)
|
||||||
|
# url :string(255)
|
||||||
|
# order_index :integer
|
||||||
|
#
|
||||||
|
|
||||||
|
# 首页精选文章
|
||||||
|
class Topic::PinnedForum < Topic
|
||||||
|
end
|
|
@ -0,0 +1,12 @@
|
||||||
|
class CreateTopics < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
create_table :topics do |t|
|
||||||
|
t.string :type
|
||||||
|
t.string :title
|
||||||
|
t.integer :uuid
|
||||||
|
t.string :image_url
|
||||||
|
t.string :url
|
||||||
|
t.integer :order_index
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe Topic, type: :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in New Issue