mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-20 19:55:56 +08:00
init project
This commit is contained in:
34
app/services/gitea/repository/create_service.rb
Normal file
34
app/services/gitea/repository/create_service.rb
Normal file
@@ -0,0 +1,34 @@
|
||||
class Gitea::Repository::CreateService < Gitea::ClientService
|
||||
attr_reader :token, :params
|
||||
|
||||
# params EX:
|
||||
# {
|
||||
# "auto_init": true,
|
||||
# "description": "string",
|
||||
# "gitignores": "string",
|
||||
# "issue_labels": "string",
|
||||
# "license": "string",
|
||||
# "name": "string", *
|
||||
# "private": true,
|
||||
# "readme": "string"
|
||||
# }
|
||||
def initialize(token, params)
|
||||
@token = token
|
||||
@params = params
|
||||
end
|
||||
|
||||
def call
|
||||
post(url, request_params)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def request_params
|
||||
Hash.new.merge(token: token, data: params)
|
||||
end
|
||||
|
||||
def url
|
||||
"/user/repos".freeze
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user