-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathNetworkAPI.swift
57 lines (44 loc) · 1.83 KB
/
NetworkAPI.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// NetworkAPI.swift
// RxNetworks
//
// Created by Condy on 2021/10/5.
// https://github.com/yangKJ/RxNetworks
///`Moya`文档
/// https://github.com/Moya/Moya
///
///`Alamofire`文档
/// https://github.com/Alamofire/Alamofire
///
import Moya
public protocol NetworkAPI: Moya.TargetType {
/// Request host
var ip: APIHost { get }
/// Request parameters
var parameters: APIParameters? { get }
/// Plugin array
var plugins: APIPlugins { get }
/// Whether to go test data
var stubBehavior: APIStubBehavior { get }
/// Failed retry count, the default is zero
var retry: APINumber { get }
/// Identification key prefix, defaul MD5 request link.
var keyPrefix: String { get }
/// Default cache policy for requests. Default is `BoomingSetup.requestCachePolicy` value.
var requestCachePolicy: NSURLRequest.CachePolicy { get }
/// This will cause a timeout if no data is transmitted for the given timeout value.
/// Default is `BoomingSetup.timeoutIntervalForRequest` value.
var timeoutIntervalForRequest: Double { get }
/// Allow the session to set cookies on requests. Default is `BoomingSetup.HTTPShouldSetCookies` value.
var httpShouldHandleCookies: Bool { get }
/// Allow the use of HTTP pipelining. Default is `BoomingSetup.HTTPShouldUsePipelining` value.
var httpShouldUsePipelining: Bool { get }
/// Mapped to json, Default is `BoomingSetup.mapped2JSON` value.
var mapped2JSON: Bool { get }
/// A responsible for returning an `EndpointSampleResponse`.
var sampleResponse: Moya.EndpointSampleResponse { get }
/// Remove all HUDs displayed to `LevelStatusBarWindowController`.
func removeHUD()
/// Remove displaying in the window`BoomingSetup.loadingPluginNames` loading.
func removeLoading()
}