1、初始化仓库
This commit is contained in:
27
Yjpp36/service/CopyService.vb
Normal file
27
Yjpp36/service/CopyService.vb
Normal file
@ -0,0 +1,27 @@
|
||||
Imports System.Net.Http
|
||||
|
||||
Public Class CopyService
|
||||
'本地缓存'
|
||||
Public LocalKeyWords As KeywordItem() = {}
|
||||
Public client As HttpClient = New HttpClient
|
||||
|
||||
''' <summary>
|
||||
''' 缓存关键词数据
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Async Function InitLocal(baseUrl As String) As Task
|
||||
Try
|
||||
Dim url As String = $"{baseUrl}/mm-machine/keywords"
|
||||
|
||||
Dim response As HttpResponseMessage = Await client.GetAsync(url)
|
||||
If response.IsSuccessStatusCode Then
|
||||
Dim responseText As String = Await response.Content.ReadAsStringAsync()
|
||||
If responseText = "成功更新数据" Then
|
||||
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
Reference in New Issue
Block a user