FIX:参数校验
Showing
1 changed file
with
14 additions
and
2 deletions
... | @@ -97,6 +97,18 @@ employee_args = { | ... | @@ -97,6 +97,18 @@ employee_args = { |
97 | 'business_type': fields.Str(required=True, validate=validate.Length(max=64)), | 97 | 'business_type': fields.Str(required=True, validate=validate.Length(max=64)), |
98 | } | 98 | } |
99 | 99 | ||
100 | q_gb_file_args = { | ||
101 | 'file_path': fields.Str(required=True, validate=validate.Length(max=255)), | ||
102 | 'business_type': fields.Str(required=True, validate=validate.Length(max=64)), | ||
103 | } | ||
104 | |||
105 | d_gb_file_args = { | ||
106 | 'object_id': fields.Str(required=True, validate=validate.Length(max=64)), | ||
107 | 'save_path': fields.Str(required=True, validate=validate.Length(max=255)), | ||
108 | 'business_type': fields.Str(required=True, validate=validate.Length(max=64)), | ||
109 | } | ||
110 | |||
111 | |||
100 | go_args = { | 112 | go_args = { |
101 | 'image': fields.Raw(required=True), | 113 | 'image': fields.Raw(required=True), |
102 | } | 114 | } |
... | @@ -1884,7 +1896,7 @@ class SearchGBHistoryFileView(GenericView): | ... | @@ -1884,7 +1896,7 @@ class SearchGBHistoryFileView(GenericView): |
1884 | permission_classes = [IsAuthenticated] | 1896 | permission_classes = [IsAuthenticated] |
1885 | authentication_classes = [OAuth2AuthenticationWithUser] | 1897 | authentication_classes = [OAuth2AuthenticationWithUser] |
1886 | 1898 | ||
1887 | @use_args(employee_args, location='data') | 1899 | @use_args(q_gb_file_args, location='data') |
1888 | def post(self, request, args): | 1900 | def post(self, request, args): |
1889 | 1901 | ||
1890 | file_path = args.get('file_path') | 1902 | file_path = args.get('file_path') |
... | @@ -1922,7 +1934,7 @@ class DownloadGBHistoryFileView(GenericView): | ... | @@ -1922,7 +1934,7 @@ class DownloadGBHistoryFileView(GenericView): |
1922 | permission_classes = [IsAuthenticated] | 1934 | permission_classes = [IsAuthenticated] |
1923 | authentication_classes = [OAuth2AuthenticationWithUser] | 1935 | authentication_classes = [OAuth2AuthenticationWithUser] |
1924 | 1936 | ||
1925 | @use_args(employee_args, location='data') | 1937 | @use_args(d_gb_file_args, location='data') |
1926 | def post(self, request, args): | 1938 | def post(self, request, args): |
1927 | 1939 | ||
1928 | business_type = args.get('business_type') | 1940 | business_type = args.get('business_type') | ... | ... |
-
Please register or sign in to post a comment