# 代码溯源 用户登录
class Trace::LoginService  < Trace::ClientService

  # 用户名 密码
  attr_accessor :username, :password

  def initialize(username, password) 
    @username = username 
    @password = password
  end

  def call 
    result = post(url, {data: request_params})
    response = render_response(result)
  end

  private 

  def request_params 
    {
      username: username,
      password: password, 
    }
  end

  def url
    "/user/login".freeze
  end
end