Browse Source

add column to statistics

pull/317/head
qyzh 4 years ago
parent
commit
fc3f50a2bf
6 changed files with 30 additions and 12 deletions
  1. +6
    -0
      app/controllers/application_controller.rb
  2. +5
    -3
      app/models/gitea/pull.rb
  3. +5
    -3
      app/models/gitea/webhook.rb
  4. +6
    -6
      app/models/gitea/webhook_task.rb
  5. +2
    -0
      app/models/statistic.rb
  6. +6
    -0
      db/migrate/20211224071147_add_column_to_statistics.rb

+ 6
- 0
app/controllers/application_controller.rb View File

@@ -837,6 +837,12 @@ class ApplicationController < ActionController::Base
end

private
def update_last_login_on
if current_user.logged?
current_user.update_column(:last_login_on, Time.now)
end
end

def object_not_found
uid_logger("Missing template or cant't find record, responding with 404")
render json: {message: "您访问的页面不存在或已被删除", status: 404}


+ 5
- 3
app/models/gitea/pull.rb View File

@@ -6,9 +6,6 @@
# type :integer
# status :integer
# conflicted_files :text(65535)
# commits_ahead :integer
# commits_behind :integer
# changed_protected_files :text(65535)
# issue_id :integer
# index :integer
# head_repo_id :integer
@@ -20,6 +17,11 @@
# merged_commit_id :string(40)
# merger_id :integer
# merged_unix :integer
# commits_ahead :integer
# commits_behind :integer
# changed_protected_files :text(65535)
# commit_num :integer
# changed_files :integer
#
# Indexes
#


+ 5
- 3
app/models/gitea/webhook.rb View File

@@ -6,19 +6,21 @@
# repo_id :integer
# org_id :integer
# url :text(65535)
# signature :text(65535)
# http_method :string(255)
# content_type :integer
# secret :text(65535)
# events :text(65535)
# is_ssl :boolean
# is_active :boolean
# hook_task_type :integer
# meta :text(65535)
# last_status :integer
# created_unix :integer
# updated_unix :integer
# is_system_webhook :boolean default("0"), not null
# type :string(16)
# branch_filter :text(65535)
# signature :text(65535)
# is_ssl :boolean
# hook_task_type :integer
#
# Indexes
#


+ 6
- 6
app/models/gitea/webhook_task.rb View File

@@ -6,19 +6,19 @@
# repo_id :integer
# hook_id :integer
# uuid :string(255)
# type :integer
# url :text(65535)
# signature :text(65535)
# payload_content :text(65535)
# http_method :string(255)
# content_type :integer
# event_type :string(255)
# is_ssl :boolean
# is_delivered :boolean
# delivered :integer
# is_succeed :boolean
# request_content :text(65535)
# response_content :text(65535)
# type :string(255)
# url :text(65535)
# signature :text(65535)
# http_method :string(255)
# content_type :integer
# is_ssl :boolean
#
# Indexes
#


+ 2
- 0
app/models/statistic.rb View File

@@ -6,6 +6,8 @@
# dau :integer
# created_at :datetime not null
# updated_at :datetime not null
# wau :integer
# mau :integer
#

class Statistic < ApplicationRecord


+ 6
- 0
db/migrate/20211224071147_add_column_to_statistics.rb View File

@@ -0,0 +1,6 @@
class AddColumnToStatistics < ActiveRecord::Migration[5.2]
def change
add_column :statistics, :wau, :integer
add_column :statistics, :mau, :integer
end
end

Loading…
Cancel
Save