<?php 
//微博收藏
class FriendshipsApi extends Api{
	
	//关注某用户
	function create(){
		$result = D('Follow','weibo')->dofollow($this->mid,$this->user_id);
		if ($result == '00' || $result == '10') {
			$result = array('is_followed' => 'unfollow');
		}else if ($result == '13') {
			$result = array('is_followed' => 'eachfollow');
		}else {
			$result = array('is_followed' => 'havefollow');
		}
		return $result;
	}
	
	//取消关注
	function destroy(){
		$result = D('Follow','weibo')->unfollow($this->mid,$this->user_id);
		return array('is_followed' => $result ? 'unfollow' : 'havefollow');
	}
	
	// 获取关注详情
	function show(){
		return getFollowState($this->user_id, $this->mid);
	}
	
	
}
?>