jsdw_ios/QuickLocation/Service/GroupService.swift

41 lines
1.3 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// GroupService.swift
// QuickLocation
//
// Created by 八条 on 2026/6/1.
//
import RxSwift
import Moya
struct GroupService {
static let disposeBag = DisposeBag()
/// 圈子信息
static func groupInfo() -> Observable<UserGroupResponse> {
let api = GroupAPI.groupInfo.multiTarget
return APIProvider.request(token: api)
.map(UserGroupResponse.self)
.asObservable()
}
/// 圈子操作(创建、解散、设为默认等)
/// - Parameters:
/// - opType: create、dismiss、setdefault
/// - requestData:[String: Any] 根据操作传入对应的值
static func operate(opType: String, requestData: [String: Any]) -> Observable<ResponseModel> {
let api = GroupAPI.operate(opType: opType, requestData: requestData).multiTarget
return APIProvider.request(token: api)
.map(ResponseModel.self)
.asObservable()
}
/// 推荐
static func recommand(count: Int) -> Observable<RecommandGroupResponse> {
let api = GroupAPI.operate(opType: "recommand", requestData: ["recommand_count": count]).multiTarget
return APIProvider.request(token: api)
.map(RecommandGroupResponse.self)
.asObservable()
}
}