syntax = "proto3";
package jarviscrawlercore;
option go_package = "github.com/zhs007/jccclient/pb";

// JDMode - jd mode
enum JDMode {
    // JDM_PRODUCT - product
    JDM_PRODUCT = 0;
    // JDM_ACTIVE - active
    JDM_ACTIVE = 1;
    // JDM_ACTIVEPAGE - active page
    JDM_ACTIVEPAGE = 2;
}

// JDPingou - jd pingou
message JDPingou {
    int32 preOrders = 1;
    string strLastTime = 2;
    float scheduledPrice = 3;
    float price = 4;
}

// JDShangou - jd shangou
message JDShangou {
    float oldPrice = 1;
    float price = 2;
    string strLastTime = 3;
}

// JDPromotional - jd promotional
message JDPromotional {
    string title = 1;
    string info = 2;
}

// JDNormalPrice - jd normal price
message JDNormalPrice {
    float oldPrice = 1;
    float price = 2;
    repeated JDPromotional promotionals = 3;
    repeated string coupons = 4;
}

// JDSKUInfo - jd sku info
message JDSKUInfo {
    string skuID = 1;
    string type = 2;
    string color = 3;
    string series = 4;
    string variety = 5;
    string size = 6;
    string model = 7;
    string purchase = 8;
    bool disabled = 9;
    bool selected = 10;
    string category = 11;
    string productType = 12;
}

// JDCommentType - jd comments type
message JDCommentsType {
    string type = 1;
    int32 nums = 2;
}

// JDCommentsInfo - jd comments infomation
message JDCommentsInfo {
    float percent = 1;
    repeated string tags = 2;
    repeated JDCommentsType lst = 3;
}

// JDActive - jd active
message JDActive {
    repeated string urlActive = 1;
    repeated string urlProduct = 2;
    int64 lastUpdatedTime = 3;
    string url = 4;
    string title = 5;
}

// JDProduct - jd product
message JDProduct {
    string url = 1;
    string name = 2;
    repeated string breadCrumbs = 3;
    string info = 4;
    string nameTag = 5;
    JDPingou pingou = 6;
    string summaryService = 7;
    string strShipTime = 8;
    string strWeight = 9;
    string brandChs = 10;
    string brandEng = 11;
    repeated JDSKUInfo SKUs = 12;
    JDCommentsInfo comment = 13;
    int64 lastUpdatedTime = 14;
    JDNormalPrice price = 15;
    JDShangou shangou = 16;
}

// RequestJD - request jd
message RequestJD {
    JDMode mode = 1;
    string url = 2;
}

// ReplyJD - reply jd
message ReplyJD {
    JDMode mode = 1;

    oneof reply {
        JDProduct product = 100;
        JDActive active = 101;
    }
}