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

// AlimamaMode - alimama mode
enum AlimamaMode {
    // ALIMMM_KEEPALIVE - keepalive
    ALIMMM_KEEPALIVE = 0;
    // ALIMMM_SEARCH - search
    ALIMMM_SEARCH = 1;
    // ALIMMM_GETTOP - get top
    ALIMMM_GETTOP = 2;
    // ALIMMM_GETSHOP - get shop
    ALIMMM_GETSHOP = 3;
}

// AlimamaProduct - alimama product
message AlimamaProduct {
    string name = 1;
    string url = 2;
    string shop = 3;
    string img = 4;
    float lastCoupon = 5;
    float curPrice = 6;
    float rebate = 7;
    float commission = 8;
    float moneyQuan = 9;
    repeated string shopType = 10;
    int32 salesVolume = 11;     // 月销量
    string shopurl = 12;
    int32 salesVolume2 = 13;    // 销量，2小时销量，如果是预订，则是预订人数
    float presale = 14;         // 订金
    float presaleProfit = 15;   // 订金减多少
    string host = 16;
    string itemID = 17;
}

// AlimamaShop - alimama shop
message AlimamaShop {
    string name = 1;
    string url = 2;
    string shopID = 3;
    string boss = 4;
    int32 credit = 5;
    string address = 6;
    string sellerSum = 7;
    int32 salesVolume = 8;
    string majorBusiness = 9;
    repeated float serviceVolume = 10;
    repeated float serviceOther = 11;
    int64 lastUpdatedTime = 12;
    repeated string sellerTitle = 13;
}

// AliProduct - ali product
message AliProduct {
    string ID = 1;
    AlimamaProduct product = 2;
    repeated string tags = 3;
    string img = 4;
    int64 rankTimes = 5;
    int64 rankTimes2 = 6;
}

// AlimamaTopProducts - alimama top products
message AlimamaTopProducts {
    repeated string category = 1;
    repeated AlimamaProduct products = 2;
}

// AlimamaTopInfo - alimama top info
message AlimamaTopInfo {
    repeated AlimamaTopProducts lst = 1;
}

// AlimamaProducts - alimama products
message AlimamaProducts {
    string text = 1;
    repeated AlimamaProduct products = 2;
    repeated string textAnd = 3;
    repeated string textOr = 4;
    repeated string textNot = 5;
    SearchParam2 sp2 = 6;
}

// RequestAlimama - request alimama
message RequestAlimama {
    AlimamaMode mode = 1;
    string text = 2;
    string url = 3;
}

// ReplyAlimama - reply alimama
message ReplyAlimama {
    AlimamaMode mode = 1;

    oneof reply {
        AlimamaProducts products = 100;
        AlimamaTopInfo topInfo = 101;
        AlimamaShop shop = 102;
    }
}