Module: KuaiJieQian::ClientMethod::UserSign

Defined in:
lib/kuai_jie_qian/client_method/user_sign.rb

Instance Method Summary collapse

Instance Method Details

#user_sign(account_id, seal_data, file_stream, seal_position_info, sign_type = "Key") ⇒ Hash

平台用户签署摘要(文件流)

Parameters:

  • account_id (String)

    签署账户标识

  • seal_data (String)

    印章图片base64

  • file_stream (file)

    文件流

  • seal_position_info (hash)

    签章信息

    • pos_page [String] 签署页码, 若为多页签章,支持页码格式“1-3,5,8“, 坐标定位时不可空

    • pos_type [Integer] 默认0(若为关键字定位,签章类型(signType)必须指定为关键字定位才生效)

    • key [String] 关键字

    • pos_x [Float] 签署位置X坐标

    • pos_y [Float] 签署位置Y坐标

    • width [Float] 印章展现高度

  • sign_type (String) (defaults to: "Key")

    签章类型,Single(单页签章)、Multi(多页签章)、Edges(签骑缝章)、Key(关键字签章)

Returns:

  • (Hash)

    结果集

    • errCode [Integer] 错误码

    • msg [String] 错误信息

    • errShow [Boolean] 错误信息是否显示

    • signServiceId [String] 签署记录id

    • stream [String] 签署后的文件base64



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/kuai_jie_qian/client_method/user_sign.rb', line 27

def user_sign(, seal_data, file_stream, seal_position_info, sign_type="Key")
  path = "tech-sdkwrapper/timevale/sign/userStreamSign"

  params = {
    "accountId": ,
    "sealData": seal_data,
    "file": file_stream,
    "signType": sign_type,
    "signPos": seal_position_info.to_json
  }

  result = KuaiJieQian::Http.post(@config[:host], @config[:project_config][:projectId], path, params, nil)

  Base64.decode64(result[:stream])
end

#user_sign_with_file(account_id, seal_data, file_info, sign_type, sign_pos) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/kuai_jie_qian/client_method/user_sign.rb', line 43

def user_sign_with_file(, seal_data, file_info, sign_type, sign_pos)
  path = "tech-sdkwrapper/timevale/sign/userFileSign"

  params = {
    "accountId": ,
    "sealData": seal_data,
    "file": file_info,
    "signType": sign_type,
    "signPos": sign_pos
  }

  KuaiJieQian::Http.post(@config[:host], @config[:project_config][:projectId], path, params)

end