delete some interface

This commit is contained in:
qyzh 2020-12-11 17:01:52 +08:00
parent c963a80e8c
commit ffbe4942b7
19 changed files with 227 additions and 151 deletions

View File

@ -346,7 +346,8 @@ class ApplicationController < ActionController::Base
User.current = User.find 8686
elsif params[:debug] == 'admin'
logger.info "@@@@@@@@@@@@@@@@@@@@@@ debug mode....."
user = User.find 36480
# user = User.find 36480
user = User.find 5
User.current = user
cookies.signed[:user_id] = user.id
end

View File

@ -1,7 +1,7 @@
module Ci::DbConnectable
extend ActiveSupport::Concern
include do
included do
end
# Dynamically sets the database connection.

View File

@ -1,6 +1,7 @@
class SponsorTiersController < ApplicationController
before_action :set_sponsor_tier, only: [:show, :edit, :update, :destroy]
before_action :check_sponsor, only: [:show]
before_action :require_login, only: [:create, :update, :destroy]
# GET /sponsor_tiers
# GET /sponsor_tiers.json
@ -16,16 +17,6 @@ class SponsorTiersController < ApplicationController
end
# GET /sponsor_tiers/new
def new
# @sponsor_tier = SponsorTier.new
# User.current.create
end
# GET /sponsor_tiers/1/edit
def edit
end
# POST /sponsor_tiers
# POST /sponsor_tiers.json
def create

View File

@ -1,7 +1,7 @@
class SponsorshipsController < ApplicationController
before_action :set_sponsorship, only: [:show, :edit, :update, :destroy]
# before_action :require_login, except: [:index, :stopped, :sponsored, :sponsoring, :stopped_sponsored, :stopped_sponsoring]
before_action :require_login, only: [:show, :new, :create, :edit, :update, :destroy]
before_action :require_login, only: [:new, :create, :edit, :update, :destroy]
skip_after_action :user_trace_log, only: [:update]
# GET /sponsorships
@ -71,15 +71,6 @@ class SponsorshipsController < ApplicationController
def show
end
# GET /sponsorships/new
def new
@sponsorship = Sponsorship.new
end
# GET /sponsorships/1/edit
def edit
end
# POST /sponsorships
# POST /sponsorships.json
def create

View File

@ -9,7 +9,7 @@
# disk_filename :string(255) default(""), not null
# filesize :integer default("0"), not null
# content_type :string(255) default("")
# digest :string(40) default(""), not null
# digest :string(60) default(""), not null
# downloads :integer default("0"), not null
# author_id :integer default("0"), not null
# created_on :datetime
@ -18,17 +18,23 @@
# attachtype :integer default("1")
# is_public :integer default("1")
# copy_from :integer
# quotes :integer
# quotes :integer default("0")
# is_publish :integer default("1")
# publish_time :datetime
# memo_image :boolean default("0")
# extra_type :integer default("0")
# resource_bank_id :integer
# unified_setting :boolean default("1")
# cloud_url :string(255) default("")
# course_second_category_id :integer default("0")
# delay_publish :boolean default("0")
#
# Indexes
#
# index_attachments_on_author_id (author_id)
# index_attachments_on_container_id_and_container_type (container_id,container_type)
# index_attachments_on_course_second_category_id (course_second_category_id)
# index_attachments_on_created_on (created_on)
# index_attachments_on_is_public (is_public)
# index_attachments_on_quotes (quotes)
#
class Attachment < ApplicationRecord

View File

@ -45,10 +45,10 @@
# is_shixun_marker :boolean default("0")
# is_sync_pwd :boolean default("1")
# watchers_count :integer default("0")
# visibility :string(255) default("public")
# repo_admin_change_team_access :boolean default("1")
# is_org :boolean default("0")
# website :string(255)
# sponsor_certification :integer default("0")
# sponsor_num :integer default("0")
# sponsored_num :integer default("0")
# description :text(65535)
# devops_step :integer default("0")
#
# Indexes

View File

@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: coin_changes
#
# id :integer not null, primary key
# amount :integer
# description :string(255)
# reason :string(255)
# to_wallet_id :integer
# from_wallet_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class CoinChange < ApplicationRecord
belongs_to :to_wallet, class_name: 'Wallet'
belongs_to :from_wallet, class_name: 'Wallet'

View File

@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: passed_waitlists
#
# id :integer not null, primary key
# applicant_id :string(255)
# integer :string(255)
# reviewer_id :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class PassedWaitlist < ApplicationRecord
belongs_to :applicant, class_name: 'User'
belongs_to :reviewer, class_name: 'User'

View File

@ -6,10 +6,14 @@
# user_id :integer not null
# praise_tread_object_id :integer
# praise_tread_object_type :string(255)
# praise_or_tread :integer
# praise_or_tread :integer default("1")
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# praise_tread (praise_tread_object_id,praise_tread_object_type)
#
class PraiseTread < ApplicationRecord
belongs_to :user

View File

@ -4,7 +4,7 @@
#
# id :integer not null, primary key
# name :string(255) default(""), not null
# description :text(4294967295)
# description :text(65535)
# homepage :string(255) default("")
# is_public :boolean default("1"), not null
# parent_id :integer
@ -48,10 +48,6 @@
# issue_tags_count :integer default("0")
# closed_issues_count :integer default("0")
# open_devops :boolean default("0")
# gitea_webhook_id :integer
# open_devops_count :integer default("0")
# recommend :boolean default("0")
# platform :integer default("0")
#
# Indexes
#

View File

@ -18,9 +18,6 @@
# issue_id :integer
# fork_project_id :integer
# is_original :boolean default("0")
# comments_count :integer default("0")
# commits_count :integer default("0")
# files_count :integer default("0")
#
class PullRequest < ApplicationRecord

View File

@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: sponsor_tiers
#
# id :integer not null, primary key
# tier :integer
# created_at :datetime not null
# updated_at :datetime not null
# description :string(255) default("")
# user_id :integer
#
class SponsorTier < ApplicationRecord
belongs_to :user

View File

@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: sponsorships
#
# id :integer not null, primary key
# amount :integer
# visible :integer
# sponsor_id :integer
# developer_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# accumulate :integer default("0")
#
class Sponsorship < ApplicationRecord
belongs_to :sponsor, class_name: 'User'
belongs_to :developer, class_name: 'User'

View File

@ -1,3 +1,18 @@
# == Schema Information
#
# Table name: stopped_sponsorships
#
# id :integer not null, primary key
# amount :integer
# sponsor_id :integer
# developer_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# start_time :datetime
# visible :integer
# accumulate :integer default("0")
#
class StoppedSponsorship < ApplicationRecord
belongs_to :sponsor, class_name: 'User'
belongs_to :developer, class_name: 'User'

View File

@ -45,10 +45,10 @@
# is_shixun_marker :boolean default("0")
# is_sync_pwd :boolean default("1")
# watchers_count :integer default("0")
# visibility :string(255) default("public")
# repo_admin_change_team_access :boolean default("1")
# is_org :boolean default("0")
# website :string(255)
# sponsor_certification :integer default("0")
# sponsor_num :integer default("0")
# sponsored_num :integer default("0")
# description :text(65535)
# devops_step :integer default("0")
#
# Indexes

View File

@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: waitlists
#
# id :integer not null, primary key
# applicant_id :string(255)
# integer :string(255)
# reviewer_id :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Waitlist < ApplicationRecord
belongs_to :applicant, class_name: 'User'
belongs_to :reviewer, class_name: 'User', optional: true

View File

@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: wallets
#
# id :integer not null, primary key
# balance :integer
# user_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class Wallet < ApplicationRecord
belongs_to :user
has_many :outcome, class_name: 'CoinChange', foreign_key: 'from_wallet_id', dependent: :destroy

View File

@ -31,8 +31,8 @@ Rails.application.routes.draw do
# post 'log/download', to: 'log#download'
match 'log/download/:filename' => 'log#download', :constraints => { filename: /[0-z\.]+/ }, via:[:get]
resources :sponsor_tiers
resources :sponsorships do
resources :sponsor_tiers, only: [:index, :show, :create, :update, :destroy]
resources :sponsorships, only: [:index, :show, :create, :update, :destroy] do
collection do
get :sponsored
get :sponsoring

View File

@ -44,7 +44,7 @@ RSpec.describe SponsorTiersController, type: :controller do
describe "GET #index" do
it "returns a success response" do
SponsorTier.create! valid_attributes
get :index, params: {}, session: valid_session
get :index, params: {login: qyzh123123}, session: valid_session
expect(response).to be_successful
end
end