using Mapster;
using MediatR;
using Newtonsoft.Json;
using Swashbuckle.AspNetCore.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FlexJobApi.Core
{
///
/// 查询地区选择器
///
[Resource([EnumResourceController.Dictionary], AllowAnonymous = true)]
public class GetAreaSelectQuery : IRequest>
{
///
/// 最大深度
///
public int? MaxDeep { get; set; }
}
public class GetAreaSelectQueryResultOption
{
public GetAreaSelectQueryResultOption()
{
}
///
/// Id
///
[JsonProperty("areaCode")]
public string Value { get; set; }
///
/// 地区名称
///
[JsonProperty("areaName")]
public string Label { get; set; }
///
/// 数据
///
[JsonIgnore, SwaggerIgnore]
public GetDictionaryDataSelectQueryResultOption Data { get; set; }
///
/// 子级
///
public List Children
{
get
{
var children = Data.Children.Adapt>();
if (children.IsNull()) return null;
else return children;
}
}
///
/// Id
///
public Guid Id => Data.Id;
///
/// 上级编号
///
public string ParentCode => Data.ParentCode;
///
/// 层级
///
public int Leyer => Data.Deep;
///
/// 排序
///
public int Sort => Data.Sort;
///
/// 快速查询
///
public string QuickQuery => Data.Field2;
}
public class GetAreaSelectQueryResultOptionData
{
///
/// 子级
///
public List Children { get; set; }
///
/// 编号
///
public string AreaCode { get; set; }
///
/// 上级编号
///
public string ParentCode { get; set; }
///
/// 层级
///
public int Leyer { get; set; }
///
/// 排序
///
public int Sort { get; set; }
///
/// 快速查询
///
public string QuickQuery { get; set; }
}
}