package com.xunmei.common.core.domain.edu.domain;

import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.xunmei.common.core.web.domain.BaseEntity;

/**
 * 学习资料对象 sys_learning_materials
 *
 * @author xunmei
 * @date 2023-08-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_learning_materials")
@ApiModel(value = "SysLearningMaterials对象", description = "学习资料")
public class SysLearningMaterials extends BaseEntity {
    private static final long serialVersionUID = 1L;

    private Long id;

    @ApiModelProperty(value = "资料标题")
    private String title;

    @ApiModelProperty(value = "资料内容")
    private String content;

    @JsonSerialize(using = com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
    @ApiModelProperty(value = "资料类型(知识库标签)")
    private Long knowledgeId;

    @ApiModelProperty(value = "所属机构")
    private Long orgId;

    @ApiModelProperty(value = "机构名称")
    private String orgName;

    @ApiModelProperty(value = "机构path")
    private String orgPath;

    @ApiModelProperty(value = "是否公开,0:未公开,1:已公开")
    private Integer isOpen;

    @ApiModelProperty(value = "附件")
    private String file;

    @ApiModelProperty(value = "备注")
    private String remark;

    @TableLogic(value = "0", delval = "1")
    @ApiModelProperty(value = "是否删除,0:未删除,1:已删除")
    private Integer deleted;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("title", getTitle())
                .append("knowledgeId", getKnowledgeId())
                .append("orgId", getOrgId())
                .append("orgName", getOrgName())
                .append("orgPath", getOrgPath())
                .append("isOpen", getIsOpen())
                .append("file", getFile())
                .append("deleted", getDeleted())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
