FIX revert system_notification_histories

This commit is contained in:
jasder 2021-10-29 16:00:46 +08:00
parent ab2e1ffa0e
commit 6c67b92bb1
10 changed files with 178 additions and 44 deletions

View File

@ -10,6 +10,10 @@ class Admins::SystemNotificationsController < Admins::BaseController
@notifications = paginate(notifications) @notifications = paginate(notifications)
end end
def history
@users = @notification.users
end
def new def new
@notification = SystemNotification.new @notification = SystemNotification.new
end end

View File

@ -0,0 +1,15 @@
class Users::SystemNotificationHistoriesController < Users::BaseController
before_action :private_user_resources!, only: [:create]
def create
@history = observed_user.system_notification_histories.new(system_notification_id: params[:system_notification_id])
if @history.save
render_ok
else
Rails.logger.info @history.errors.as_json
render_error(@history.errors.full_messages.join(","))
end
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)
end
end

View File

@ -199,6 +199,36 @@ await octokit.request('GET /api/users/:login/messages.json')
Success Data. Success Data.
</aside> </aside>
## 用户阅读系统通知
用户阅读系统通知
> 示例:
```shell
curl -X POST http://localhost:3000/api/users/yystopf/system_notification_histories.json
```
```javascript
await octokit.request('GET /api/users/:login/system_notification_histories.json')
```
### HTTP 请求
`POST /api/users/:login/system_notification_histories.json`
### 请求字段说明:
参数 | 类型 | 字段说明
--------- | ----------- | -----------
|system_notification_id |integer |阅读的系统通知id |
> 返回的JSON示例:
```json
{
"status": 0,
"message": "success"
}
```
## 发送消息 ## 发送消息
发送消息, 目前只支持atme 发送消息, 目前只支持atme

View File

@ -15,6 +15,9 @@ class SystemNotification < ApplicationRecord
default_scope { order(created_at: :desc)} default_scope { order(created_at: :desc)}
has_many :system_notification_histories
has_many :users, through: :system_notification_histories
scope :is_top, lambda { where(is_top: true) } scope :is_top, lambda { where(is_top: true) }
def read_member?(user_id) def read_member?(user_id)

View File

@ -0,0 +1,23 @@
# == Schema Information
#
# Table name: system_notification_histories
#
# id :integer not null, primary key
# system_message_id :integer
# user_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_system_notification_histories_on_system_message_id (system_message_id)
# index_system_notification_histories_on_user_id (user_id)
#
class SystemNotificationHistory < ApplicationRecord
belongs_to :system_notification
belongs_to :user
validates :system_notification_id, uniqueness: { scope: :user_id, message: '只能阅读一次'}
end

View File

@ -173,6 +173,9 @@ class User < Owner
has_one :user_template_message_setting, dependent: :destroy has_one :user_template_message_setting, dependent: :destroy
has_many :system_notification_histories
has_many :system_notifications, through: :system_notification_histories
# Groups and active users # Groups and active users
scope :active, lambda { where(status: STATUS_ACTIVE) } scope :active, lambda { where(status: STATUS_ACTIVE) }
scope :like, lambda { |keywords| scope :like, lambda { |keywords|

View File

@ -0,0 +1,6 @@
zh-CN:
activerecord:
attributes:
system_notification_history:
system_notification: "系统通知"
system_notification_id: "系统通知"

View File

@ -273,6 +273,7 @@ Rails.application.routes.draw do
scope module: :users do scope module: :users do
get 'template_message_settings', to: 'template_message_settings#current_setting' get 'template_message_settings', to: 'template_message_settings#current_setting'
post 'template_message_settings/update_setting', to: 'template_message_settings#update_setting' post 'template_message_settings/update_setting', to: 'template_message_settings#update_setting'
resources :system_notification_histories, only: [:create]
resources :applied_messages, only: [:index] resources :applied_messages, only: [:index]
resources :applied_transfer_projects, only: [:index] do resources :applied_transfer_projects, only: [:index] do
member do member do
@ -680,7 +681,11 @@ Rails.application.routes.draw do
resources :project_licenses resources :project_licenses
resources :project_ignores resources :project_ignores
resources :reversed_keywords resources :reversed_keywords
resources :system_notifications resources :system_notifications do
member do
get :history
end
end
resources :message_templates, only: [:index, :edit, :update] do resources :message_templates, only: [:index, :edit, :update] do
collection do collection do
get :init_data get :init_data

View File

@ -0,0 +1,10 @@
class CreateSystemNotificationHistories < ActiveRecord::Migration[5.2]
def change
create_table :system_notification_histories do |t|
t.references :system_notification
t.references :user
t.timestamps
end
end
end

View File

@ -348,6 +348,9 @@
<li> <li>
<a href="#5b752913ae" class="toc-h2 toc-link" data-title="用户消息列表">用户消息列表</a> <a href="#5b752913ae" class="toc-h2 toc-link" data-title="用户消息列表">用户消息列表</a>
</li> </li>
<li>
<a href="#6087e717ed" class="toc-h2 toc-link" data-title="用户阅读系统通知">用户阅读系统通知</a>
</li>
<li> <li>
<a href="#94306b2fc3" class="toc-h2 toc-link" data-title="发送消息">发送消息</a> <a href="#94306b2fc3" class="toc-h2 toc-link" data-title="发送消息">发送消息</a>
</li> </li>
@ -1337,7 +1340,39 @@ Success — a happy kitten is an authenticated kitten!
<aside class="success"> <aside class="success">
Success Data. Success Data.
</aside> </aside>
<h2 id='94306b2fc3'>发送消息</h2> <h2 id='6087e717ed'>用户阅读系统通知</h2>
<p>用户阅读系统通知</p>
<blockquote>
<p>示例:</p>
</blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/system_notification_histories.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/system_notification_histories.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-3'>HTTP 请求</h3>
<p><code>POST /api/users/:login/system_notification_histories.json</code></p>
<h3 id='aa883f5d52-2'>请求字段说明:</h3>
<table><thead>
<tr>
<th>参数</th>
<th>类型</th>
<th>字段说明</th>
</tr>
</thead><tbody>
<tr>
<td>system_notification_id</td>
<td>integer</td>
<td>阅读的系统通知id</td>
</tr>
</tbody></table>
<blockquote>
<p>返回的JSON示例:</p>
</blockquote>
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
</span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"success"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div><h2 id='94306b2fc3'>发送消息</h2>
<p>发送消息, 目前只支持atme</p> <p>发送消息, 目前只支持atme</p>
<blockquote> <blockquote>
@ -1345,9 +1380,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/:login/messages.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/:login/messages.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/users/:login/messages.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/users/:login/messages.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-3'>HTTP 请求</h3> </code></pre></div><h3 id='http-4'>HTTP 请求</h3>
<p><code>POST api/users/yystopf/messages.json</code></p> <p><code>POST api/users/yystopf/messages.json</code></p>
<h3 id='aa883f5d52-2'>请求字段说明:</h3> <h3 id='aa883f5d52-3'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -1406,9 +1441,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/:login/messages/read.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/:login/messages/read.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/users/:login/messages/read.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/users/:login/messages/read.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-4'>HTTP 请求</h3> </code></pre></div><h3 id='http-5'>HTTP 请求</h3>
<p><code>POST api/users/yystopf/messages/read.json</code></p> <p><code>POST api/users/yystopf/messages/read.json</code></p>
<h3 id='aa883f5d52-3'>请求字段说明:</h3> <h3 id='aa883f5d52-4'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -1447,9 +1482,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> DELETE http://localhost:3000/api/users/:login/messages.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> DELETE http://localhost:3000/api/users/:login/messages.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">DELETE /api/users/:login/messages.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">DELETE /api/users/:login/messages.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-5'>HTTP 请求</h3> </code></pre></div><h3 id='http-6'>HTTP 请求</h3>
<p><code>DELETE api/users/yystopf/messages.json</code></p> <p><code>DELETE api/users/yystopf/messages.json</code></p>
<h3 id='aa883f5d52-4'>请求字段说明:</h3> <h3 id='aa883f5d52-5'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -1488,9 +1523,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> PATCH/PUT http://localhost:3000/api/users/yystopf.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> PATCH/PUT http://localhost:3000/api/users/yystopf.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">PATCH/PUT /api/users/:login.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">PATCH/PUT /api/users/:login.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-6'>HTTP 请求</h3> </code></pre></div><h3 id='http-7'>HTTP 请求</h3>
<p><code>PATCH/PUT /api/users/:login.json</code></p> <p><code>PATCH/PUT /api/users/:login.json</code></p>
<h3 id='aa883f5d52-5'>请求字段说明:</h3> <h3 id='aa883f5d52-6'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -1586,7 +1621,7 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/template_message_settings.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/template_message_settings.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/template_message_settings.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/template_message_settings.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-7'>HTTP 请求</h3> </code></pre></div><h3 id='http-8'>HTTP 请求</h3>
<p><code>GET /api/template_message_settings.json</code></p> <p><code>GET /api/template_message_settings.json</code></p>
<h3 id='7447e4874e-3'>返回字段说明:</h3> <h3 id='7447e4874e-3'>返回字段说明:</h3>
<table><thead> <table><thead>
@ -1729,7 +1764,7 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/template_message_settings.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/template_message_settings.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/uses/yystopf/template_message_settings.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/uses/yystopf/template_message_settings.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-8'>HTTP 请求</h3> </code></pre></div><h3 id='http-9'>HTTP 请求</h3>
<p><code>GET /api/users/:user_id/template_message_settings.json</code></p> <p><code>GET /api/users/:user_id/template_message_settings.json</code></p>
<h3 id='7447e4874e-4'>返回字段说明:</h3> <h3 id='7447e4874e-4'>返回字段说明:</h3>
<table><thead> <table><thead>
@ -1799,9 +1834,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/template_message_settings/update_setting.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/template_message_settings/update_setting.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/uses/yystopf/template_message_settings/update_setting.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/uses/yystopf/template_message_settings/update_setting.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-9'>HTTP 请求</h3> </code></pre></div><h3 id='http-10'>HTTP 请求</h3>
<p><code>POST /api/users/:user_id/template_message_settings/update_setting.json</code></p> <p><code>POST /api/users/:user_id/template_message_settings/update_setting.json</code></p>
<h3 id='aa883f5d52-6'>请求字段说明:</h3> <h3 id='aa883f5d52-7'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -1918,7 +1953,7 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/is_pinned_projects.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/is_pinned_projects.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/is_pinned_projects.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/is_pinned_projects.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-10'>HTTP 请求</h3> </code></pre></div><h3 id='http-11'>HTTP 请求</h3>
<p><code>GET api/users/:login/is_pinned_projects.json</code></p> <p><code>GET api/users/:login/is_pinned_projects.json</code></p>
<h3 id='7447e4874e-6'>返回字段说明:</h3> <h3 id='7447e4874e-6'>返回字段说明:</h3>
<table><thead> <table><thead>
@ -2105,9 +2140,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/is_pinned_projects/pin.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/is_pinned_projects/pin.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/is_pinned_projects/pin.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/is_pinned_projects/pin.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-11'>HTTP 请求</h3> </code></pre></div><h3 id='http-12'>HTTP 请求</h3>
<p><code>POST /api/users/:login/is_pinned_projects/pin.json</code></p> <p><code>POST /api/users/:login/is_pinned_projects/pin.json</code></p>
<h3 id='aa883f5d52-7'>请求字段说明:</h3><h4 id='0ca7f0efb8'>同时设定多个星标项目</h4> <h3 id='aa883f5d52-8'>请求字段说明:</h3><h4 id='0ca7f0efb8'>同时设定多个星标项目</h4>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -2151,9 +2186,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> PATCH http://localhost:3000/api/users/yystopf/is_pinned_projects/11.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> PATCH http://localhost:3000/api/users/yystopf/is_pinned_projects/11.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">PATCH/PUT /api/users/:login/is_pinned_projects/:id.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">PATCH/PUT /api/users/:login/is_pinned_projects/:id.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-12'>HTTP 请求</h3> </code></pre></div><h3 id='http-13'>HTTP 请求</h3>
<p><code>PATCH/PUT /api/users/:login/is_pinned_projects/:id.json</code></p> <p><code>PATCH/PUT /api/users/:login/is_pinned_projects/:id.json</code></p>
<h3 id='aa883f5d52-8'>请求字段说明:</h3> <h3 id='aa883f5d52-9'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -2192,7 +2227,7 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/statistics/activity.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/statistics/activity.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/statistics/activity.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/statistics/activity.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-13'>HTTP 请求</h3> </code></pre></div><h3 id='http-14'>HTTP 请求</h3>
<p><code>GET /api/users/:login/statistics/activity.json</code></p> <p><code>GET /api/users/:login/statistics/activity.json</code></p>
<h3 id='7447e4874e-7'>返回字段说明:</h3> <h3 id='7447e4874e-7'>返回字段说明:</h3>
<table><thead> <table><thead>
@ -2281,9 +2316,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/headmaps.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/headmaps.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/headmaps.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/headmaps.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-14'>HTTP 请求</h3> </code></pre></div><h3 id='http-15'>HTTP 请求</h3>
<p><code>GET api/users/:login/headmaps.json</code></p> <p><code>GET api/users/:login/headmaps.json</code></p>
<h3 id='aa883f5d52-9'>请求字段说明:</h3> <h3 id='aa883f5d52-10'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -2426,9 +2461,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/project_trends.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/project_trends.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/project_trends.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/project_trends.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-15'>HTTP 请求</h3> </code></pre></div><h3 id='http-16'>HTTP 请求</h3>
<p><code>GET api/users/:login/project_trends.json</code></p> <p><code>GET api/users/:login/project_trends.json</code></p>
<h3 id='aa883f5d52-10'>请求字段说明:</h3> <h3 id='aa883f5d52-11'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -2743,9 +2778,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/statistics/develop.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/statistics/develop.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/statistics/develop.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/statistics/develop.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-16'>HTTP 请求</h3> </code></pre></div><h3 id='http-17'>HTTP 请求</h3>
<p><code>GET /api/users/:login/statistics/develop.json</code></p> <p><code>GET /api/users/:login/statistics/develop.json</code></p>
<h3 id='aa883f5d52-11'>请求字段说明:</h3> <h3 id='aa883f5d52-12'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -2886,9 +2921,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/statistics/role.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/statistics/role.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/statistics/role.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/statistics/role.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-17'>HTTP 请求</h3> </code></pre></div><h3 id='http-18'>HTTP 请求</h3>
<p><code>GET /api/users/:login/statistics/role.json</code></p> <p><code>GET /api/users/:login/statistics/role.json</code></p>
<h3 id='aa883f5d52-12'>请求字段说明:</h3> <h3 id='aa883f5d52-13'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -2968,9 +3003,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/statistics/major.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/statistics/major.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/statistics/major.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/statistics/major.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-18'>HTTP 请求</h3> </code></pre></div><h3 id='http-19'>HTTP 请求</h3>
<p><code>GET /api/users/:login/statistics/major.json</code></p> <p><code>GET /api/users/:login/statistics/major.json</code></p>
<h3 id='aa883f5d52-13'>请求字段说明:</h3> <h3 id='aa883f5d52-14'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -3029,9 +3064,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/applied_messages.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/applied_messages.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_messages.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_messages.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-19'>HTTP 请求</h3> </code></pre></div><h3 id='http-20'>HTTP 请求</h3>
<p><code>GET /api/users/:login/applied_messages.json</code></p> <p><code>GET /api/users/:login/applied_messages.json</code></p>
<h3 id='aa883f5d52-14'>请求字段说明:</h3> <h3 id='aa883f5d52-15'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -3308,9 +3343,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/applied_transfer_projects.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/applied_transfer_projects.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_transfer_projects.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_transfer_projects.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-20'>HTTP 请求</h3> </code></pre></div><h3 id='http-21'>HTTP 请求</h3>
<p><code>GET /api/users/:login/applied_transfer_projects.json</code></p> <p><code>GET /api/users/:login/applied_transfer_projects.json</code></p>
<h3 id='aa883f5d52-15'>请求字段说明:</h3> <h3 id='aa883f5d52-16'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -3500,9 +3535,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/applied_transfer_projects/2/accept.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/applied_transfer_projects/2/accept.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_transfer_projects/:id/accept.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_transfer_projects/:id/accept.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-21'>HTTP 请求</h3> </code></pre></div><h3 id='http-22'>HTTP 请求</h3>
<p><code>GET /api/users/:login/applied_transfer_projects/:id/accept.json</code></p> <p><code>GET /api/users/:login/applied_transfer_projects/:id/accept.json</code></p>
<h3 id='aa883f5d52-16'>请求字段说明:</h3> <h3 id='aa883f5d52-17'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -3691,9 +3726,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/applied_transfer_projects/2/refuse.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/applied_transfer_projects/2/refuse.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_transfer_projects/:id/refuse.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_transfer_projects/:id/refuse.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-22'>HTTP 请求</h3> </code></pre></div><h3 id='http-23'>HTTP 请求</h3>
<p><code>GET /api/users/:login/applied_transfer_projects/:id/refuse.json</code></p> <p><code>GET /api/users/:login/applied_transfer_projects/:id/refuse.json</code></p>
<h3 id='aa883f5d52-17'>请求字段说明:</h3> <h3 id='aa883f5d52-18'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -3882,9 +3917,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/applied_projects.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/applied_projects.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_projects.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_projects.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-23'>HTTP 请求</h3> </code></pre></div><h3 id='http-24'>HTTP 请求</h3>
<p><code>GET /api/users/:login/applied_projects.json</code></p> <p><code>GET /api/users/:login/applied_projects.json</code></p>
<h3 id='aa883f5d52-18'>请求字段说明:</h3> <h3 id='aa883f5d52-19'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -4042,9 +4077,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/applied_projects/2/accept.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/applied_projects/2/accept.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_projects/:id/accept.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_projects/:id/accept.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-24'>HTTP 请求</h3> </code></pre></div><h3 id='http-25'>HTTP 请求</h3>
<p><code>GET /api/users/:login/applied_projects/:id/accept.json</code></p> <p><code>GET /api/users/:login/applied_projects/:id/accept.json</code></p>
<h3 id='aa883f5d52-19'>请求字段说明:</h3> <h3 id='aa883f5d52-20'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>
@ -4201,9 +4236,9 @@ Success — a happy kitten is an authenticated kitten!
</blockquote> </blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/applied_projects/2/refuse.json <div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/applied_projects/2/refuse.json
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_projects/:id/refuse.json</span><span class="dl">'</span><span class="p">)</span> </code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_projects/:id/refuse.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-25'>HTTP 请求</h3> </code></pre></div><h3 id='http-26'>HTTP 请求</h3>
<p><code>GET /api/users/:login/applied_projects/:id/refuse.json</code></p> <p><code>GET /api/users/:login/applied_projects/:id/refuse.json</code></p>
<h3 id='aa883f5d52-20'>请求字段说明:</h3> <h3 id='aa883f5d52-21'>请求字段说明:</h3>
<table><thead> <table><thead>
<tr> <tr>
<th>参数</th> <th>参数</th>