syntax = "proto3";
import "public.proto";

package pcds.hit.v1;


/*
 * 访问量统计
 * 
 * 
 */
service Hit{
	rpc GetHitListForRes (HitListRequest) returns (HitListReply){}
	rpc GetHits (HitRequest) returns (HitReply){}
}

message HitListRequest{
	string Id     = 1;
	string Search   = 3;
	EnumAllowingSearch SearchCol = 4;
	int32  CurrentPage = 5;
	int32  PerPage = 6;
	EnumAllowingOrderby OrderBy = 7;
	bool   Desc = 8;
}

enum EnumAllowingSearch{
	EAS_NAME = 0;
}
enum EnumAllowingOrderby{
	EAO_CREATE_AT =  0;
	EAO_NAME =  1;
}

enum EnumResType{
	ERT_CHAPTER = 0;
	ERT_ARTICLE = 1;
	ERT_COURSE = 2;
}

message HitRequest{
	string Id           = 1;
	EnumResType ResType = 2;
	int32 count         = 3;
}


message HitReply{
	bool ok = 1;
	string message = 2;
	HitRequest data = 3;
}

message HitListReply{
	bool ok = 1;
	string message = 2;
	message data{
		repeated HitRequest rows = 1;
		int32    Count = 2;
		int32    PageNo = 3;
		int32    PageSize = 4;
	}
}
