//
//  SLFriendPowerVc.m
//  SLAiELTS
//
//  Created by Gusont on 2023/4/25.
//

#import "SLFriendPowerVc.h"

@interface SLFriendPowerVc ()

@property (weak, nonatomic) IBOutlet UISwitch *toMeSwitch;


@property (weak, nonatomic) IBOutlet UISwitch *toSheSwitch;

@end

@implementation SLFriendPowerVc

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"朋友权限";
    self.toMeSwitch.on = self.friendModel.dontLetHeLook;
    self.toSheSwitch.on = self.friendModel.dontLookHe;
}

- (IBAction)toMe:(id)sender {
    [self switchChange];
}

- (IBAction)toShe:(id)sender {
    [self switchChange];
}

- (void)switchChange {
    NSDictionary *parameter = @{@"userId" : self.friendModel.userId,
                                @"dontLookHe" : self.toSheSwitch.on ? @"true" : @"false",
                                @"dontLetHeLook" : self.toMeSwitch.on ? @"true" : @"false"};
    [[SLHttpCenter SharedInstance] getWithUrl:@"/api/Friend/SetFriendCircleAuth" parameter:parameter success:^(id responseObject) {
        
    } failure:^(SPRequestError *error) {
        
    }];
}
@end
