package com.fs.wxcid.dto.friend;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

@Data
public class SearchContactResponse {

    @JSONField(name = "country")
    private String country;

    @JSONField(name = "small_head_img_url")
    private String smallHeadImgUrl;

    @JSONField(name = "big_head_img_url")
    private String bigHeadImgUrl;

    @JSONField(name = "signature")
    private String signature;

    @JSONField(name = "sex")
    private Integer sex;

    @JSONField(name = "verify_flag")
    private Integer verifyFlag;

    @JSONField(name = "personal_card")
    private Integer personalCard;

    @JSONField(name = "antispam_ticket") // 👈 新增字段
    private String antispamTicket;

    @JSONField(name = "nick_name")
    private NickNameWrapper nickName;

    @JSONField(name = "user_name")
    private UserNameWrapper userName;

    @JSONField(name = "quan_pin")
    private QuanPinWrapper quanPin;

    @JSONField(name = "pyinitial")
    private PyInitialWrapper pyinitial;

    // --- Wrappers ---
    @Data
    public static class NickNameWrapper {
        @JSONField(name = "str")
        private String str;
    }

    @Data
    public static class UserNameWrapper {
        @JSONField(name = "str")
        private String str;
    }

    @Data
    public static class QuanPinWrapper {
        @JSONField(name = "str")
        private String str;
    }

    @Data
    public static class PyInitialWrapper {
        @JSONField(name = "str")
        private String str;
    }

    // --- Helper Getters ---
    public String getNickNameStr() {
        return nickName != null ? nickName.getStr() : null;
    }

    public String getUserNameStr() {
        return userName != null ? userName.getStr() : null;
    }

    public String getQuanPinStr() {
        return quanPin != null ? quanPin.getStr() : null;
    }

    public String getPyInitialStr() {
        return pyinitial != null ? pyinitial.getStr() : null;
    }
}