Class: OrcaApi::UserService

Inherits:
Service
  • Object
show all
Defined in:
lib/orca_api/user_service.rb

Overview

ユーザーを扱うサービスを表現したクラス

Instance Attribute Summary

Attributes inherited from Service

#orca_api

Instance Method Summary collapse

Methods inherited from Service

#initialize, reuse_session

Constructor Details

This class inherits a constructor from OrcaApi::Service

Constructor Details

This class inherits a constructor from OrcaApi::Service

Instance Method Details

#create(params) ⇒ OrcaApi::Result

ユーザー作成

Parameters:

  • params (Hash)

    ユーザー情報

Options Hash (params):

  • Group_Number (String)

    職員区分

  • User_Id (String)

    ユーザーID

  • User_Password (String)

    ユーザーパスワード

  • Full_Name (String)

    ユーザー氏名

  • Kana_Name (String)

    ユーザーカナ氏名

Returns:

See Also:



38
39
40
41
42
43
44
# File 'lib/orca_api/user_service.rb', line 38

def create(params)
  req = {
    "Request_Number" => "02",
    "User_Information" => params
  }
  call req
end

#destroy(user_id) ⇒ OrcaApi::Result

ユーザー削除



74
75
76
77
78
79
80
81
82
# File 'lib/orca_api/user_service.rb', line 74

def destroy(user_id)
  req = {
    "Request_Number" => "04",
    "User_Information" => {
      "User_Id" => user_id
    }
  }
  call req
end

#list(base_date = "") ⇒ OrcaApi::Result

ユーザー一覧

Parameters:

  • base_date (String) (defaults to: "")

    基準日。YYYY-mm-dd形式。

Returns:

See Also:



17
18
19
20
21
22
23
# File 'lib/orca_api/user_service.rb', line 17

def list(base_date = "")
  req = {
    "Request_Number" => "01",
    "Base_Date" => base_date,
  }
  call req
end

#update(user_id, params) ⇒ OrcaApi::Result

ユーザー更新

Parameters:

  • user_id (String)

    ユーザーID

  • params (Hash)

    ユーザー情報

Options Hash (params):

  • New_User_Password (String)

    ユーザーパスワード

  • New_Full_Name (String)

    ユーザー氏名

  • New_Kana_Name (String)

    ユーザーカナ氏名

Returns:

See Also:



58
59
60
61
62
63
64
# File 'lib/orca_api/user_service.rb', line 58

def update(user_id, params)
  req = {
    "Request_Number" => "03",
    "User_Information" => params.merge("User_Id" => user_id)
  }
  call req
end