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

// DoubanMode - douban mode
enum DoubanMode {
    // DBM_SEARCH - search
    DBM_SEARCH = 0;
    // DBM_BOOK - book
    DBM_BOOK = 1;
}

// DoubanType - douban type
enum DoubanType {
    // DBT_BOOK - book
    DBT_BOOK = 0;
}

// DoubanSubject - douban subject
message DoubanSubject {
    string title = 1;
    string url = 2;
    DoubanType doubanType = 3;
    string id = 4;
}

// DoubanSearch - douban search
message DoubanSearch {
    string text = 1;
    repeated DoubanSubject subjects = 2;
    DoubanType doubanType = 3;
}

// DoubanBook - douban book
message DoubanBook {
    string title = 1;
    string url = 2;
    string id = 3;
    string cover = 4;
    repeated string authors = 5;
    float score = 6;
    int32 ratingNums = 7;
    string intro = 8;
    repeated DoubanSubject lstLink = 9;
    repeated string tags = 10;
    repeated string otherTitle = 11;
    int64 lastUpdatedTime = 12;
}

// DoubanComic - douban comic
message DoubanComic {
    string title = 1;
    repeated string covers = 2;
    repeated string authors = 3;
    float score = 4;
    int32 ratingNums = 5;
    string intro = 6;
    repeated string tags = 7;
    int64 lastUpdatedTime = 8;
    repeated DoubanBook books = 9;
    repeated DoubanSubject lstLink = 10;
    repeated string linkComics = 11;
}

// RequestDouban - request douban
message RequestDouban {
    DoubanMode mode = 1;
    string text = 2;
    string id = 3;
    DoubanType doubanType = 4;
}

// ReplyDouban - reply douban
message ReplyDouban {
    DoubanMode mode = 1;

    oneof reply {
        DoubanSearch search = 100;
        DoubanBook book = 101;
    }
}