using Hotline.Share.Dtos.CallCenter;
using Hotline.Share.Dtos.File;
using Hotline.Share.Dtos.FlowEngine;
using Hotline.Share.Dtos.Org;
using Hotline.Share.Dtos.Quality;
using Hotline.Share.Enums.Article;
using Hotline.Share.Enums.KnowledgeBase;
using Hotline.Share.Notifications.NewRockCallCenter;
using Hotline.Share.Requests;
using System.ComponentModel.DataAnnotations;
using XF.Utility.EnumExtensions;
namespace Hotline.Share.Dtos.Knowledge
{
///
/// 编辑
///
public class UpdateKnowledgeDto : AddKnowledgeDto
{
///
/// ID
///
public string Id { get; set; }
///
/// 标签名称
///
public List Tags { get; set; } = new();
}
///
/// 新增知识
///
public class AddKnowledgeDto : KnowledgeDto
{
///
/// 知识Code
///
public string Code { get; set; }
///
/// 标签名称
///
public List Tags { get; set; } = new();
///
/// 知识归属
///
public string? Attribution { get; set; }
///
/// 来源部门
///
public string? SourceOrganizeId { get; set; }
}
public class OffShelfKnowledgeDto
{
///
/// ID
///
public string Id { get; set; }
///
/// 下架原因
///
public string Opinion { get; set; }
}
public class DeleteKnowledgeDto
{
///
/// ID
///
public string Id { get; set; }
///
/// 删除原因
///
public string Opinion { get; set; }
}
///
/// 查询详情
///
public class KnowledgeInfoDto : KnowledgeDto
{
///
/// ID
///
public string Id { get; set; }
///
/// 知识Code
///
public string Code { get; set; }
///
/// 热点名称
///
public string HotspotName { get; set; }
///
/// 流程Id
///
public string? WorkflowId { get; set; }
///
/// 是否可办理
///
public bool? IsCanHandle { get; set; }
}
public record KnowledgeRelationTypeDto {
///
/// 知识库类型ID
///
public string KnowledgeTypeId { get; set; }
///
/// 知识库类型名称
///
public string KnowledgeTypeName { get; set; }
///
/// 知识库类型名称
///
public string KnowledgeTypeSpliceName { get; set; }
}
///
/// 基础
///
public class KnowledgeDto : KnowledgeBaseDto
{
///
/// 知识来源
///
public string? Source { get; set; }
///
/// 知识分类
///
public List KnowledgeType { get; set; }
///
/// 知识分类名称
///
public string KnowledgeTypeText => GetKnowledgeTypeText(KnowledgeType);
///
/// 获取知识分类名称
///
///
public string GetKnowledgeTypeText(List items)
{
if (KnowledgeType != null && KnowledgeType.Any())
{
var names = KnowledgeType.Select(x => x.KnowledgeTypeName).ToList();
return string.Join(",", names);
}
return "";
}
///
/// 热点
///
public string HotspotId { get; set; }
///
/// 标题
///
public string Title { get; set; }
///
/// 摘要
///
public string Summary { get; set; }
///
/// 内容
///
public string Content { get; set; }
///
/// 是否公开
///
public bool IsPublic { get; set; }
///
/// 文档状态,默认草稿
///
public EKnowledgeStatus Status { get; set; } = EKnowledgeStatus.Drafts;
public string StatusText => Status.GetDescription();
///
/// 到期时间
///
public DateTime? ExpiredTime { get; set; }
///
/// 关键词
///
public List Keywords { get; set; }
///
/// 附件
///
public List Additions { get; set; }
///
/// 外部数据(为前端提供级联功能)
///
public string HotspotExternal { get; set; }
///
/// 知识归属
///
public string? Attribution { get; set; }
///
/// 浏览量
///
public int PageView { get; set; } = 0;
///
/// 搜索量
///
public int? SearchNum { get; set; } = 0;
///
/// 评分
///
public decimal? Score { get; set; } = decimal.Zero;
///
/// 评论数
///
public int? CommentNum { get; set; } = 0;
///
/// 来源部门
///
public string? SourceOrganizeId { get; set; }
///
/// 来源部门
///
public OrgDto? SourceOrganize { get; set; }
public KnowledgeCollectDto Collect { get; set; }
///
/// 关联知识
///
public List Knowledges { get; set; }
///
/// 关联知识对象
///
public List KnowledgeDtos { get; set; }
///
/// 关键词
///
public List KeywordsDto { get; set; }
public List Files { get; set; }
public List? FileJson { get; set; }
}
public class KnowledgeBaseDto {
public DateTime? LastModificationTime { get; set; }
public bool IsDeleted { get; set; }
///
/// 删除时间
///
public DateTime? DeletionTime { get; set; }
///
/// 创建时间
///
public DateTime CreationTime { get; set; }
public string Id { get; set; }
///
/// 组织Id
///
public string? CreatorOrgId { get; set; }
public string? CreatorOrgName { get; set; }
///
/// 创建人
///
public string? CreatorId { get; set; }
public string? CreatorName { get; set; }
}
public class KnowledgeTitleDto {
///
/// ID
///
public string? Id { get; set; }
///
/// 标题
///
public string Title { get; set; }
}
public class KnowledgeSearchNumDto
{
///
/// ID
///
public string? Id { get; set; }
}
public class KnowledgeFindingDuplicateDto
{
///
/// 标题
///
public string Title { get; set; }
///
/// 摘要
///
public string? Summary { get; set; }
///
/// 内容
///
public string Content { get; set; }
///
/// ID
///
public string? Id { get; set; }
}
public class AddStartFlowDto : StartWorkflowDto
{
}
public class UpdateStartFlowDto : StartWorkflowDto
{
}
//public class DeleteStartFlowDto : StartWorkflowDto
//{
//}
public class DeleteStartFlowDto : StartWorkflowDto
{
}
public class OffShelfStartFlowDto : StartWorkflowDto
{
}
public class KnowledgeCollectGroupOutDto
{
///
/// Id
///
public string Id { get; set; }
///
/// 名字
///
public string Name { get; set; }
}
public class KnowledgeCollectGroupInDto
{
///
/// 名字
///
[Required]
public string Name { get; set; }
}
public record KnowledgeCollectGroupListInDto : PagedKeywordRequest
{ }
public class KnowledgeInfoExportInDto
{
///
/// 导入的知识Id集合
///
public string[] Ids { get; set; }
///
/// 导出格式
///
public EFileType FileType { get; set; }
}
public record PageViewInDto : PagedRequest
{
///
/// 标题
///
public string? Title { get; set; }
///
/// 浏览人
///
public string? CreatorName { get; set; }
///
/// 知识分类Id
///
public string? KnowledgeTypeId { get; set; }
///
/// 开始时间
///
public DateTime? StartTime { get; set; }
///
/// 结束时间
///
public DateTime? EndTime { get; set; }
}
public class PageViewOutDto
{
///
/// 标题
///
public string KnowledgeTitle { get; set; }
///
/// 浏览人
///
public string CreatorName { get; set; }
///
/// 浏览时间
///
public DateTime CreationTime { get; set; }
///
/// 浏览完成时间
///
public DateTime? PvEndTime { get; set; }
///
/// 浏览时长
///
public int? BrowseTime { get; set; } = 0;
}
public class KnowledgeWordOutDto
{
public KnowledgeWordOutDto()
{
}
public KnowledgeWordOutDto(string keyId, string tag)
{
Id = keyId;
Tag = tag;
}
///
/// Id
///
public string Id { get; set; }
///
/// 标签
///
public string Tag { get; set; }
}
public record KnowledgeHotWordInDto : PagedRequest
{
///
/// 热词
///
public string? KeyWord { get; set; }
///
/// 是否启用
///
public bool? IsEnable { get; set; }
///
/// 排序(需要被排序的字段名)
///
public string? SortField { get; set; }
///
/// 排序方向 (0: 升序Asc; 1: 降序Desc)
///
public int OrderByType { get; set; } = 1;
///
/// 热词类型
///
public EKnowledgeHotWordType? Type { get; set; }
}
public class UpdateKnowledgeHotWordInDto : AddKnowledgeHotWordInDto
{
///
/// Id
///
[Required]
public string Id { get; set; }
///
/// 点击次数
///
public int? SearchCount { get; set; }
///
/// 是否启用
///
public bool? IsEnable { get; set; }
}
public class AddKnowledgeHotWordInDto
{
///
/// 热词
///
public string? KeyWord { get; set; }
///
/// 排序
///
public int? Sort { get; set; }
///
/// 热词类型
///
public EKnowledgeHotWordType? Type { get; set; }
}
public class KnowledgeHotWordOutDto : UpdateKnowledgeHotWordInDto
{
///
/// 创建时间
///
public DateTime CreationTime { get; set; }
///
/// 热词类型
///
public string TypeTxt => Type?.GetDescription();
}
public class KnowledgeBatchAuditInDto
{
///
/// 知识Id集合
///
public string[] KnowledgeIds { get; set; }
///
/// 是否通过
///
public bool IsPass { get; set; }
///
/// 办理意见
///
public string Opinion { get; set; } = string.Empty;
///
/// 是否短信通知
///
public bool IsSms { get; set; }
}
}