コード例 #1
0
ファイル: views.py プロジェクト: qjw/dingtalk-api-sample
def login_callback():
    code = request.args.get("code")
    if code is None:
        abort(400)

    _a = DingDepartment()
    user = _a.get_user_by_code(code)
    return jsonify(code=0, message='ok', data=user)
コード例 #2
0
from dingding_api.department import DingDepartment

depart = DingDepartment()

# 获取部门列表
print(depart.get_department_list())

# 获取部门详情
users_detail = depart.get_department_users_detail(1)
for u in users_detail:
    print(u)

コード例 #3
0
def get_org_user_count():
    _a = DingDepartment()
    v = _a.get_org_user_count(request.query_dict['active'])
    return jsonify(code=0, message='ok', data=v)
コード例 #4
0
def user_detail(id):
    _a = DingDepartment()
    v = _a.get_user_detail(id)
    return jsonify(code=0, message='ok', data=v)
コード例 #5
0
def delete_department(id):
    _a = DingDepartment()
    v = _a.delete_department(id)
    return jsonify(code=0, message='ok', data=v)
コード例 #6
0
def create_department():
    _a = DingDepartment()
    v = _a.create_department(request.json_dict)
    return jsonify(code=0, message='ok', data=v)
コード例 #7
0
def department_userids(id):
    _a = DingDepartment()
    v = _a.get_department_userids(id)
    return jsonify(code=0, message='ok', data=v)
コード例 #8
0
def admin_scopes(id):
    _a = DingDepartment()
    v = _a.get_admin_user_scopes(id)
    return jsonify(code=0, message='ok', data=v)
コード例 #9
0
def departments():
    _a = DingDepartment()
    v = _a.get_department_list()
    return jsonify(code=0, message='ok', data=v)