UNPKG

1.44 kBJavaScriptView Raw
1'use strict';
2
3/**
4 * Parse Profile of User
5 *
6 * @param {Object|String} json
7 * @return {Object}
8 * @api private
9 */
10
11var Profile = {};
12
13Profile.parse = function parseProfile (obj) {
14 if (typeof obj === 'string') {
15 obj = JSON.parse(obj);
16 }
17
18 var profile = {};
19
20 /* jshint ignore:start */
21 /*
22 code Number response code for this request
23 message String response message for this request
24 userId Number user id
25 nickName String user nickname 사용자 별명
26 email String email address 사용자 이메일 정보
27 phone String phone number 사용자 휴대폰 번호
28 agreementSMS Bool agreement for SMS 문자 수신 동의 여부
29 agreementEmail Bool agreement for Email 이메일 수신 동의 여부
30 meteringDay Number metering day 검침일
31 contractType Number contract type (mW)
32 contractPower Number contract power
33 maxLimitUsage Number planed usage
34 maxLimitUsageBill Number expected bill for planed usage
35 needUpdate Bool whether mobile app need to be updated
36 */
37 profile.id = obj.userId;
38 profile.displayName = obj.nickName;
39 profile.email = obj.email;
40 profile.phone = obj.phone;
41 profile.meteringDay = obj.meteringDay;
42 profile.contractType = obj.contractType;
43 profile.contractPower = obj.contractPower;
44 profile.maxLimitUsage = obj.maxLimitUsage;
45 profile.maxLimitUsageBill = obj.maxLimitUsageBill;
46
47 /* jshint ignore:end */
48
49 return profile;
50};
51
52module.exports = exports = Profile;
\No newline at end of file