package docs

type loginLogs struct {
	defaultIndex string
}

var LoginLog = &loginLogs{
	defaultIndex: "login_logs",
}

func (d *loginLogs) SetIndex(index string) *loginLogs {
	d.defaultIndex = index
	return d
}

func (d *loginLogs) GetIndex() string {
	return d.defaultIndex
}

func (d *loginLogs) Model() string {
	return `{
            "settings": {
				"number_of_shards": 1,
				"number_of_replicas": 0,
				"max_result_window": 100000,
				"refresh_interval": "1s"
            },
            "mappings": {
                "properties": {
                    "id": {
                        "type": "long"
                    },
                    "channel_id": {
                        "type": "keyword"
                    },
                    "user_id": {
                        "type": "long"
                    },
                    "server_id": {
                        "type": "integer"
                    },
                    "event_id": {
                        "type": "integer"
                    },
                    "user_created_at": {
                        "type": "integer"
                    },
                    "event_at": {
                        "type": "integer"
                    },
                    "cost_time": {
                        "type": "long"
                    },
                    "flag": {
                        "type": "integer"
                    }
                }
            }
        }`
}
