示例#1
0
 def getInfo(self , _email , _id):
     authInfo = AuthenticationManager().get(_email)
     NetworkManager().get(self.INFO_URI+'/'+_id
                          ,headers=hutil.getAuthHederInfo(authInfo.getEmail() , authInfo.getToken() , authInfo.getRefreshToken())
                          ,_success= self._successFunc_
                          ,_failed= self._failedFunc_
                          )
示例#2
0
 def list(self, _email):
     authInfo = AuthenticationManager().get(_email)
     NetworkManager().get(
         self.URI_LIST,
         hutil.getAuthHederInfo(_email, authInfo.getToken(),
                                authInfo.getRefreshToken()), self._success_,
         self._fail_)
示例#3
0
 def refresh(self, _email):
     authInfo = AuthenticationManager().get(_email)
     NetworkManager().get(self.REFRESH_URI,
                          headers=hhutil.getAuthHederInfo(
                              authInfo.getEmail(), authInfo.getToken(),
                              authInfo.getRefreshToken()),
                          _success=self._refreshSuccess_,
                          _failed=self._refreshFailed_)
示例#4
0
 def info(self, _email, _id):
     authInfo = AuthenticationManager().get(_email)
     infoUrl = ''.join([self.URI_INFO, f'/{_id}'])
     NetworkManager().get(
         infoUrl,
         hutil.getAuthHederInfo(_email, authInfo.getToken(),
                                authInfo.getRefreshToken()), self._success_,
         self._fail_)
示例#5
0
 def registry(self, _email, _name, _cd):
     authInfo = AuthenticationManager().get(_email)
     cr = CategoryRequest(_name, _cd)
     NetworkManager().post(
         self.URI_REG, cr.toJSON(),
         hutil.getAuthHederInfo(_email, authInfo.getToken(),
                                authInfo.getRefreshToken()), self._success_,
         self._fail_)
示例#6
0
    def registry(self, _email, _name, _path):
        authInfo = AuthenticationManager().get(_email)

        data = MDirRegistryRequest(_name, _path)
        NetworkManager().post(self.URI_REGISTRY,
                              data=data.toJSON(),
                              headers=hutil.getAuthHederInfo(
                                  _email, authInfo.getToken(),
                                  authInfo.getRefreshToken()),
                              _success=self._success_,
                              _failed=self._failed_)
示例#7
0
 def search(self , _email , _searchType , _value , _page = 0 , _size = 10):
     authInfo = AuthenticationManager().get(_email)
     r = MFileSearchRequest(_searchType , _value , _page , _size)
     NetworkManager().post(self.SEARCH_URI
                           ,data = r.toJSON()
                           ,headers = hutil.getAuthHederInfo(authInfo.getEmail() , authInfo.getToken() , authInfo.getRefreshToken())
                           , _success=self._successFunc_
                           , _failed=self._failedFunc_)
示例#8
0
 def getList(self, _email):
     authInfo = AuthenticationManager().get(_email)
     NetworkManager().get(self.LIST_URI
                          ,headers = hutil.getAuthHederInfo(authInfo.getEmail() , authInfo.getToken() , authInfo.getRefreshToken())
                          ,_success= self._successFunc_
                          ,_failed= self._failedFunc_)