|
@@ -57,6 +57,14 @@ public let kProductCartIsSelApi = "/product/isSelect"
|
|
/// 购物车-全选
|
|
/// 购物车-全选
|
|
public let kProductCartAllSelApi = "/product/isSelectAll"
|
|
public let kProductCartAllSelApi = "/product/isSelectAll"
|
|
|
|
|
|
|
|
+// MARK: - 退款原因
|
|
|
|
+/// 退款原因
|
|
|
|
+public let kProductRefundReasonApi = "/product/config"
|
|
|
|
+
|
|
|
|
+// MARK: - 新增商品评价
|
|
|
|
+/// 新增商品评价
|
|
|
|
+public let kProductAddCommentApi = "/product/commentCreate"
|
|
|
|
+
|
|
|
|
|
|
/// 商品
|
|
/// 商品
|
|
///
|
|
///
|
|
@@ -72,6 +80,8 @@ public let kProductCartAllSelApi = "/product/isSelectAll"
|
|
/// - productCartAmount: 购物车-数量
|
|
/// - productCartAmount: 购物车-数量
|
|
/// - productCartIsSel: 购物车-选中
|
|
/// - productCartIsSel: 购物车-选中
|
|
/// - productCartAllSel: 购物车-全选
|
|
/// - productCartAllSel: 购物车-全选
|
|
|
|
+/// - productRefundReason: 退款原因
|
|
|
|
+/// - productAddComment: 新增商品评价
|
|
public enum SwiftMoyaServiceProductApi {
|
|
public enum SwiftMoyaServiceProductApi {
|
|
case productSearch(parameters:Dictionary<String, Any>)
|
|
case productSearch(parameters:Dictionary<String, Any>)
|
|
case productCategory(parameters:Dictionary<String, Any>)
|
|
case productCategory(parameters:Dictionary<String, Any>)
|
|
@@ -85,6 +95,8 @@ public enum SwiftMoyaServiceProductApi {
|
|
case productCartAmount(parameters:Dictionary<String, Any>)
|
|
case productCartAmount(parameters:Dictionary<String, Any>)
|
|
case productCartIsSel(parameters:Dictionary<String, Any>)
|
|
case productCartIsSel(parameters:Dictionary<String, Any>)
|
|
case productCartAllSel(parameters:Dictionary<String, Any>)
|
|
case productCartAllSel(parameters:Dictionary<String, Any>)
|
|
|
|
+ case productRefundReason(parameters:Dictionary<String, Any>)
|
|
|
|
+ case productAddComment(parameters:Dictionary<String, Any>)
|
|
}
|
|
}
|
|
|
|
|
|
extension SwiftMoyaServiceProductApi: TargetType {
|
|
extension SwiftMoyaServiceProductApi: TargetType {
|
|
@@ -102,7 +114,9 @@ extension SwiftMoyaServiceProductApi: TargetType {
|
|
.productCartDelete,
|
|
.productCartDelete,
|
|
.productCartAmount,
|
|
.productCartAmount,
|
|
.productCartIsSel,
|
|
.productCartIsSel,
|
|
- .productCartAllSel
|
|
|
|
|
|
+ .productCartAllSel,
|
|
|
|
+ .productRefundReason,
|
|
|
|
+ .productAddComment
|
|
:
|
|
:
|
|
return URL(string: kApiDataPrefix())!
|
|
return URL(string: kApiDataPrefix())!
|
|
}
|
|
}
|
|
@@ -134,12 +148,17 @@ extension SwiftMoyaServiceProductApi: TargetType {
|
|
return kProductCartIsSelApi
|
|
return kProductCartIsSelApi
|
|
case .productCartAllSel:
|
|
case .productCartAllSel:
|
|
return kProductCartAllSelApi
|
|
return kProductCartAllSelApi
|
|
|
|
+ case .productRefundReason:
|
|
|
|
+ return kProductRefundReasonApi
|
|
|
|
+ case .productAddComment:
|
|
|
|
+ return kProductAddCommentApi
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public var method: Moya.Method {
|
|
public var method: Moya.Method {
|
|
switch self {
|
|
switch self {
|
|
- case.productCartAdd
|
|
|
|
|
|
+ case .productCartAdd,
|
|
|
|
+ .productAddComment
|
|
:
|
|
:
|
|
return .post
|
|
return .post
|
|
case .productCartAmount,
|
|
case .productCartAmount,
|
|
@@ -153,7 +172,8 @@ extension SwiftMoyaServiceProductApi: TargetType {
|
|
.productCartList,
|
|
.productCartList,
|
|
.productDetail,
|
|
.productDetail,
|
|
.productCommentList,
|
|
.productCommentList,
|
|
- .productHotSale
|
|
|
|
|
|
+ .productHotSale,
|
|
|
|
+ .productRefundReason
|
|
:
|
|
:
|
|
return .get
|
|
return .get
|
|
case .productCartDelete
|
|
case .productCartDelete
|
|
@@ -176,7 +196,9 @@ extension SwiftMoyaServiceProductApi: TargetType {
|
|
.productCartDelete(var parameters),
|
|
.productCartDelete(var parameters),
|
|
.productCartAmount(var parameters),
|
|
.productCartAmount(var parameters),
|
|
.productCartIsSel(var parameters),
|
|
.productCartIsSel(var parameters),
|
|
- .productCartAllSel(var parameters)
|
|
|
|
|
|
+ .productCartAllSel(var parameters),
|
|
|
|
+ .productRefundReason(var parameters),
|
|
|
|
+ .productAddComment(var parameters)
|
|
:
|
|
:
|
|
let sign = SwiftSign.shared().sign(signType:.AccessToken, parameters: parameters)
|
|
let sign = SwiftSign.shared().sign(signType:.AccessToken, parameters: parameters)
|
|
parameters.updateValue(sign, forKey: "sign")
|
|
parameters.updateValue(sign, forKey: "sign")
|
|
@@ -210,7 +232,9 @@ extension SwiftMoyaServiceProductApi: TargetType {
|
|
.productCartDelete,
|
|
.productCartDelete,
|
|
.productCartAmount,
|
|
.productCartAmount,
|
|
.productCartIsSel,
|
|
.productCartIsSel,
|
|
- .productCartAllSel
|
|
|
|
|
|
+ .productCartAllSel,
|
|
|
|
+ .productRefundReason,
|
|
|
|
+ .productAddComment
|
|
:
|
|
:
|
|
return (headerParameters(headerType: .tokenHeader) as! [String : String])
|
|
return (headerParameters(headerType: .tokenHeader) as! [String : String])
|
|
}
|
|
}
|