You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.3 KiB

//
// CMessage.m
// tongxin
//
// Created by ecell on 2021/6/25.
// Copyright © 2021 xTT. All rights reserved.
//
#import "CMessage.h"
#import "User.h"
@implementation CMessage
/**
删除 消息 的接口
*/
+ (void)delectTrackWithMessageIds:(NSArray*)messageIds
success:(void (^)(id responseObject))success
failure:(void (^)(void))failure {
NSMutableDictionary *parameter = [NSMutableDictionary dictionary];
if(messageIds && messageIds.count > 0){
[parameter setValue:[messageIds mj_JSONString] forKey:@"messageIds"];
}
NSString *url = [MyHttp getURL:@"getway/accounts/[openid]/videoCall"
objArr:@[cUser]];
[xMyHttp URL:url
method:@"DELETE"
parameters:parameter
success:^(NSURLSessionDataTask *task, id responseObject) {
if ([responseObject[@"code"] intValue] == HTTP_SUCCESS) {
if(success){
success(responseObject);
}
}else{
if(failure){
failure();
}
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
if(failure){
failure();
}
}];
}
/**
获取通知数据
*/
+ (void)getCallMessageWithPage:(NSNumber *)page
success:(void (^)(NSMutableArray *arr))success
failure:(void (^)(NSError *error))failure {
NSString *url = [MyHttp getURL:@"getway/accounts/[openid]/videoCall"
objArr:@[cUser]];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
if (page) {
[parameters setObject:page forKey:@"page"];
}
[xMyHttp URL:url
method:@"GET" parameters:parameters
success:^(NSURLSessionDataTask *task, id responseObject)
{
if ([responseObject[@"code"] intValue] == HTTP_SUCCESS) {
NSMutableArray *arr = [CMessage mj_objectArrayWithKeyValuesArray:responseObject[@"videoRecords"]];
success(arr);
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
if (failure) {
failure(error);
}
}];
}
@end