using System;
using System.Collections.Generic;
using System.Text;

namespace JiaZhiQuan.Common.ElasticSearch.Models
{
    /*
DELETE /postsharerecord

PUT /postsharerecord
{
  "mappings": {
    "properties": {
      "id": {
        "type": "keyword"
      },
      "notValidRecord": {
        "type": "boolean"
      },
      "isMock": {
        "type": "boolean"
      },
      "postId": {
        "type": "long"
      },
      "authorId": {
        "type": "long"
      },
      "categoryType": {
        "type": "integer"
      },
      "isAuthor": {
        "type": "boolean"
      },
      "userId": {
        "type": "long"
      },
      "ip": {
        "type": "keyword"
      },
      "clientId": {
        "type": "keyword"
      },
      "createAt": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss"
      }
    }
  }
}
    */
    /// <summary>
    /// 分享记录
    /// </summary>
    public class ESPostShareRecordModel
    {
        /// <summary>
        /// 如果是已登录的，则为 postId_userId，其他为 guid
        /// 这里将记录所有分享记录，id变为guid，不再存postId_userId形式
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 是否不是有效分享
        /// </summary>
        public bool notValidRecord { get; set; }
        /// <summary>
        /// 是否是模拟数据
        /// </summary>
        public bool isMock { get; set; }
        public long postId { get; set; }
        public long authorId { get; set; }
        public int categoryType { get; set; }
        public bool isAuthor { get; set; }
        /// <summary>
        /// 当前分享的用户编号，未登录则为0
        /// </summary>
        public long userId { get; set; }
        public string ip { get; set; }
        /// <summary>
        /// 用户客户端的编号，如果是H5，则为生成的GUID
        /// </summary>
        public string clientId { get; set; }
        public string createAt { get; set; }
    }
}
