Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more properties on contact #2036

Closed
windmemory opened this issue Aug 13, 2020 · 2 comments
Closed

Support more properties on contact #2036

windmemory opened this issue Aug 13, 2020 · 2 comments

Comments

@windmemory
Copy link
Member

Currently we are moving forward on Multi-Platform, and we might need to add more properties(or say property getters) onto contact class.


Describe the solution you'd like

Contact

  • corp(): get the corp info for a contact (eg: 句子互动)
  • title(): get the title for the contact (eg: 开发攻城狮)
  • description(): get the description for the contact (eg: 老写Bug)
  • external(): check whether the contact is an external contact
  • isWeixin(): check whether the contact is a weixin account (WeChat Work specific)

More info for the two new flags:

In WeChat Work:

internal external
weixin
work

So I think we need two flags to express this type of contact.


Contact Raw Data

WeChat Work

{
    "avatar": "http://wework.qpic.cn/wwhead/xxxxx/0",
    "conversation_id": "S:168xxx_1688xxxxx",
    "corp_id": "1970xxxxx",
    "desc": "老写Bug还自己不会修",
    "external_job": "开发攻城狮",
    "nickname": "小开",
    "position": "开发",
    "realname": "开小发",
    "remark": "老Bu",
    "sex": 1,
    "user_id": "1688xxxx",
    "username": "小开"
}

DingDing

Internal contact

{
    "errcode": 0,
    "unionid": "PiiiPyQqBNBii0HnCJ3zljcxxxxxx",
    "remark": "remark",
    "userid": "zhangsan",
    "isLeaderInDepts": "{1:false}",
    "isBoss": false,
    "hiredDate": 1520265600000,
    "isSenior": false,
    "tel": "xxx-xxxxxxxx",
    "department": [1,2],
    "workPlace": "place",
    "email": "test@xxx.com",
    "orderInDepts": "{1:71738366882504}",
    "mobile": "1xxxxxxxxxx",
    "errmsg": "ok",
    "active": false,
    "avatar": "xxx",
    "isAdmin": false,
    "isHide": false,
    "jobnumber": "001",
    "name": "张三",
    "extattr": {},
    "stateCode": "86",
    "position": "manager",
    "roles": [
        {
            "id": 149507744,
            "name": "总监",
            "groupName": "职务"
        }
    ]
}

External contact

{
  "title":"开发工程师",
  "share_dept_ids":[]
  "label_ids":[1,2,3],
  "remark":"备注内容",
  "address":"地址内容",
  "name":"张三",
  "follower_user_id":"userid2",
  "state_code":"86",
  "company_name":"钉钉",
  "share_user_ids":["userid3"],
  "mobile":"1xxxxxxxxxx",
  "userid":"userid1",
  "email":"111@1.com"
},

Lark

{
  "name":"zhang san",
  "name_py":"zhang san",
  "en_name":"John",
  "employee_id":"a0615a67",
  "employee_no":"235634",
  "open_id":"ou_e03053f0541cecc3269d7a9dc34a0b21",
  "union_id":"on_7dba11ff38a2119f89349876b12af65c",
  "status":2,
  "employee_type": 1,
  "avatar_72": "https://sf3-ttcdn-tos.pstatp.com/img/avatar/62db96e8-c5b6-4077-bb9d-2697d65a29eb~72x72.png",
  "avatar_240": "https://sf3-ttcdn-tos.pstatp.com/img/avatar/62db96e8-c5b6-4077-bb9d-2697d65a29eb~240x240.png",
  "avatar_640": "https://sf3-ttcdn-tos.pstatp.com/img/avatar/62db96e8-c5b6-4077-bb9d-2697d65a29eb~640x640.png",
  "avatar_url":"https://sf3-ttcdn-tos.pstatp.com/img/avatar/62db96e8-c5b6-4077-bb9d-2697d65a29eb~noop.png",
  "gender":1,
  "email":"zhangsan@gmail.com",
  "mobile":"+8615343335730",
  "description": "",
  "country": "CN",
  "city":"Beijing",
  "work_station":"Poly, F6-123",  
  "is_tenant_manager":false,
  "join_time":1562342314,
  "update_time":1569140032,
  "leader_employee_id":"a0615a67",
  "leader_open_id":"ou_e03053f0541cecc3269d7a9dc34a0b21",
  "leader_union_id":"on_c132837f686587dd494aa54f5f65b552",
  "departments":[
    "TT-0001"
  ],
  "open_departments": [
    "od-8c6c97ab9a34c1a649001d7ad36b97a7"
  ],
  "custom_attrs": {
    "C-6702376000044400907": {
      "value": "value1"
    },
    "C-6702376000048595214": {
      "value": "value2"
    }
  }     
}
@windmemory
Copy link
Member Author

I've PRed a rough design.

@windmemory
Copy link
Member Author

Let's close this issue since this is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant