using System.Linq;
using Mapster;
using Util;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace Model.Custom
{
public class ApiInfo
{
///
/// ID
///
public int id { get; set; }
///
/// 服务ID
///
public int serviceId { get; set; }
///
/// 接口分组ID
///
public int groupId { get; set; }
///
/// 板块名称
///
public string? tabName { get; set; }
///
/// 接口名称
///
public string? apiName { get; set; }
///
/// 接口类型
///
public int apiKind { get; set; }
public string apiMethod {
get
{
if(apiKind == 1 || apiKind == 2)
{
return "GET";
}
if(apiKind == 3)
{
return "POST";
}
if(apiKind == 4)
{
return "PUT";
}
if(apiKind == 5)
{
return "DELETE";
}
return "GET";
}
}
///
/// 方法名
///
public string? methodName { get; set; }
public string? methodNameUpper
{
get
{
return PublicFunction.transferName(methodName);
}
}
public string? methodNameFirstUpper
{
get
{
return PublicFunction.transferName(methodName, 1);
}
}
///
/// 接口表述
///
public string? apiDetail { get; set; }
///
/// 请求参数列表
/// "json")]
public List requestParam { get; set; }
///
/// 响应参数列表
/// "json")]
public List responseParam { get; set; }
///
/// 关联表ID
///
public int linkTableId { get; set; }
public string? linkTableTitle { get; set; }
public string? linkTableName { get; set; }
public string? linkTableNameUpper
{
get
{
return PublicFunction.transferName(linkTableName);
}
}
public string? linkTableNameFirstUpper
{
get
{
return PublicFunction.transferName(linkTableName, 1);
}
}
///
/// 分页
///
public bool pageFlag { get; set; }
///
/// 接口路径
///
public string apiPath { get; set; }
///
/// 接口g关键字
///
public string apiKey { get; set; }
///
/// 输出对象
///
public string outputObject { get; set; }
///
/// 加密方式
///
public string requestEncrypt { get; set; }
///
/// 加密参数
///
public string requestEncryptParam { get; set; }
}
public class ApiParamObject
{
public int id { get; set; }
///
/// 字段名称
///
public string fieldTitle { get; set; }
///
/// 字段名
///
public string fieldName { get; set; }
public string fieldNameUpper
{
get
{
return PublicFunction.transferName(fieldName);
}
}
public string fieldNameFirstUpper
{
get
{
return PublicFunction.transferName(fieldName, 1);
}
}
///
/// 字段类型
///
public string fieldType { get; set; }
///
/// 控件类型
///
public string editType { get; set; }
///
/// 请求参数
///
public bool reqParam { get; set; }
///
/// 返回字段
///
public bool resParam { get; set; }
///
/// 自定义
///
public bool customFlag { get; set; }
///
/// 返回类型
///
public string resType { get; set; }
///
/// 验证属性
///
public string[] checkAttribute { get; set; }
public string checkAttributeString
{
get
{
if (checkAttribute != null)
{
return string.Join(",", checkAttribute);
}
else
{
return "";
}
}
}
///
/// 排序方式
///
public string sortMode { get; set; }
///
/// 字段说明
///
public string fieldDetail { get; set; }
///
/// 关联表ID
///
public int linkTableId { get; set; }
public string? linkTableTitle { get; set; }
public string? linkTableName { get; set; }
public string? linkTableNameUpper
{
get
{
return PublicFunction.transferName(linkTableName);
}
}
public string? linkTableNameFirstUpper
{
get
{
return PublicFunction.transferName(linkTableName, 1);
}
}
///
/// 关联表主键字段
///
public string? linkTablePrimaryKeyName { get; set; }
///
/// 关联参数
///
public List linkParam { get; set; }
///
/// 关联参数数量
///
public int linkParamCount
{
get
{
if (linkParam != null)
{
return linkParam.Count;
}
else
{
return 0;
}
}
}
}
}