package com.wzj.soopin.member.domain.bo;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wzj.soopin.member.domain.po.Fans;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.dromara.common.core.domain.BaseBO;
import org.dromara.common.excel.annotation.Excel;
import org.springframework.boot.actuate.integration.IntegrationGraphEndpoint;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Schema(description ="粉丝")
public class FansBO  extends BaseBO<Fans> {


    /**
     *  用户
     */
    @Schema(description ="用户id")
    private String memberId;



    /**
     *  博主id
     */
    @Schema(description ="博主id")
    private String vloggerId;

    /**
     *  粉丝id
     */
    @Schema(description ="粉丝id")
    private String fanId;

    /**
     *  是否互相关注
     */
    @Schema(description ="是否是好友")
    private Integer friendFlag  ;

    /**
     *  是否互相关注
     */
    @Schema(description ="是否互相关注")
    private Integer bothFriend;

    @Override
    public LambdaQueryWrapper<Fans> toWrapper() {
        return super.toWrapper()
            .eq(vloggerId!=null,Fans::getVloggerId,vloggerId)
            .eq(fanId!=null,Fans::getFanId,fanId)
            .eq(friendFlag!=null,Fans::getFriendFlag,friendFlag)
            .eq(bothFriend!=null,Fans::getBothFriend,bothFriend);
    }
}
