You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
560 B
29 lines
560 B
5 years ago
|
class Gitea::User::RegisterService < Gitea::ClientService
|
||
|
def initialize(options = {})
|
||
|
options.each_pair do |key, value|
|
||
|
instance_variable_set("@#{key}", value)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def call
|
||
|
url = "/admin/users"
|
||
|
params = {}
|
||
|
params = params.merge(data: user_params)
|
||
|
post(url, params)
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
attr_reader :email, :username, :password, :url
|
||
|
|
||
|
def user_params
|
||
|
{
|
||
|
email: email,
|
||
|
username: username,
|
||
|
password: password,
|
||
|
must_change_password: false #允许不更改秘密就可以登录
|
||
|
}
|
||
|
end
|
||
|
|
||
|
end
|