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)
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)
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)
def user_detail(id): _a = DingDepartment() v = _a.get_user_detail(id) return jsonify(code=0, message='ok', data=v)
def delete_department(id): _a = DingDepartment() v = _a.delete_department(id) return jsonify(code=0, message='ok', data=v)
def create_department(): _a = DingDepartment() v = _a.create_department(request.json_dict) return jsonify(code=0, message='ok', data=v)
def department_userids(id): _a = DingDepartment() v = _a.get_department_userids(id) return jsonify(code=0, message='ok', data=v)
def admin_scopes(id): _a = DingDepartment() v = _a.get_admin_user_scopes(id) return jsonify(code=0, message='ok', data=v)
def departments(): _a = DingDepartment() v = _a.get_department_list() return jsonify(code=0, message='ok', data=v)