|
@@ -9,6 +9,7 @@ from werkzeug.datastructures import FileStorage
|
|
|
from app.defines import StatesCode
|
|
|
from app.database import engine
|
|
|
from app.modle.organization import Company, Department
|
|
|
+from app.utils.jwt_util import login_required
|
|
|
from app.utils.to_dict import to_dict
|
|
|
|
|
|
ns = Namespace('organization', description='组织管理接口')
|
|
@@ -20,6 +21,9 @@ company_list.add_argument(name='page', type=int, location='args', required=False
|
|
|
|
|
|
@ns.route('/company_list')
|
|
|
class CompanyListApi(Resource):
|
|
|
+
|
|
|
+ method_decorators = [login_required]
|
|
|
+
|
|
|
@ns.doc(id='get_company_list', description='获取公司列表')
|
|
|
@ns.expect(company_list)
|
|
|
def get(self):
|
|
@@ -54,6 +58,9 @@ delete_company.add_argument(name='company_id', type=int, location='form', requir
|
|
|
|
|
|
@ns.route('/company')
|
|
|
class CompanyApi(Resource):
|
|
|
+
|
|
|
+ method_decorators = [login_required]
|
|
|
+
|
|
|
@ns.doc(id='get_company', description='搜索公司')
|
|
|
@ns.expect()
|
|
|
def get(self):
|
|
@@ -132,6 +139,8 @@ get_company_details.add_argument(name='company_id', type=int, location='args', r
|
|
|
@ns.route('/company_details')
|
|
|
class CompanyDetailsApi(Resource):
|
|
|
|
|
|
+ method_decorators = [login_required]
|
|
|
+
|
|
|
@ns.doc(id='get_company_details', description='获取公司详情')
|
|
|
@ns.expect(get_company_details)
|
|
|
def get(self):
|
|
@@ -205,6 +214,8 @@ department_details.add_argument(name='censure', type=str, location='form', requi
|
|
|
@ns.route('/department')
|
|
|
class DepartmentApi(Resource):
|
|
|
|
|
|
+ method_decorators = [login_required]
|
|
|
+
|
|
|
@ns.doc(id='department_list', description='获取公司下部门列表')
|
|
|
@ns.expect(get_company_details)
|
|
|
def get(self):
|
|
@@ -286,6 +297,8 @@ get_department.add_argument(name='department_id', type=str, location='args', req
|
|
|
@ns.route('/department_details')
|
|
|
class DepartmentDetailsApi(Resource):
|
|
|
|
|
|
+ method_decorators = [login_required]
|
|
|
+
|
|
|
@ns.doc(id='get_department_details', description='获取部门详情')
|
|
|
@ns.expect(get_department)
|
|
|
def get(self):
|
|
@@ -348,6 +361,9 @@ batch_delete_company.add_argument(name='company_ids', type=list, location='form'
|
|
|
|
|
|
@ns.route('/batch_delete_company')
|
|
|
class BatchDeletecompanyApi(Resource):
|
|
|
+
|
|
|
+ method_decorators = [login_required]
|
|
|
+
|
|
|
@ns.doc(id='batch_delete_users', description='批量删除公司')
|
|
|
@ns.expect(batch_delete_company)
|
|
|
def delete(self):
|