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_ )
def list(self, _email): authInfo = AuthenticationManager().get(_email) NetworkManager().get( self.URI_LIST, hutil.getAuthHederInfo(_email, authInfo.getToken(), authInfo.getRefreshToken()), self._success_, self._fail_)
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_)
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_)
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_)
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_)
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_)
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_)