syntax = "proto3";
option go_package = "./pb";

package pb;

import "models/model_http_access_log.proto";

// 访问日志相关服务
service HTTPAccessLogService {
	// 创建访问日志
	rpc createHTTPAccessLogs (CreateHTTPAccessLogsRequest) returns (CreateHTTPAccessLogsResponse);

	// 列出单页访问日志
	rpc listHTTPAccessLogs (ListHTTPAccessLogsRequest) returns (ListHTTPAccessLogsResponse);

	// 查找单个日志
	rpc findHTTPAccessLog (FindHTTPAccessLogRequest) returns (FindHTTPAccessLogResponse);
}

// 创建访问日志
message CreateHTTPAccessLogsRequest {
	repeated HTTPAccessLog httpAccessLogs = 1;
}

message CreateHTTPAccessLogsResponse {

}

// 列出往前的单页访问日志
message ListHTTPAccessLogsRequest {
	string requestId = 1; // 上一页请求ID，可选
	int64 serverId = 2; // 服务ID
	int64 size = 3; // 单页条数
	string day = 4; // 日期，格式YYYYMMDD
	bool reverse = 5; // 是否反向查找，可选
	bool hasError = 6; // 是否有错误，可选
	int64 firewallPolicyId = 7; // WAF策略ID，可选
	int64 firewallRuleGroupId = 8; // WAF分组ID，可选
	int64 firewallRuleSetId = 9; // WAF规则集ID，可选
	int64 userId = 10; // 用户ID
	bool hasFirewallPolicy = 11; // 是否有WAF策略
	string keyword = 12; // 关键词
	string ip = 13;
	string domain = 14;
}

message ListHTTPAccessLogsResponse {
	repeated HTTPAccessLog accessLogs = 1 [deprecated = true];
	repeated HTTPAccessLog httpAccessLogs = 4;
	string requestId = 2;
	bool hasMore = 3;
}

// 查找单个日志
message FindHTTPAccessLogRequest {
	string requestId = 1;
}

message FindHTTPAccessLogResponse {
	HTTPAccessLog httpAccessLog = 1;
}
