Merge branch 'dev_master' of https://gitee.com/izory/ZrAdminNetCore into dev_master
This commit is contained in:
commit
e26c1225d0
@ -59,7 +59,7 @@ namespace Infrastructure.Extensions
|
||||
services.AddTransient(serviceType, type);
|
||||
break;
|
||||
}
|
||||
Console.WriteLine($"注册:{serviceType}");
|
||||
//Console.WriteLine($"注册:{serviceType}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -7,18 +7,10 @@ namespace Infrastructure
|
||||
public class OptionsSetting
|
||||
{
|
||||
public static string ConnAdmin = "conn_zrAdmin";
|
||||
public static string DbType = "conn_admin_Type";
|
||||
public static string ConnDbType = "dbType";
|
||||
public static string DbKey = "DbKey";
|
||||
public string Conn_Admin { get; set; }
|
||||
|
||||
public string AppName { get; set; }
|
||||
/// <summary>
|
||||
/// 主库
|
||||
/// </summary>
|
||||
public string Master { get; set; }
|
||||
|
||||
public string Redis { get; set; }
|
||||
|
||||
public string Database { get; set; }
|
||||
/// <summary>
|
||||
/// 是否演示模式
|
||||
|
||||
@ -2,7 +2,9 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Enums;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -31,10 +33,12 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
private CodeGeneraterService _CodeGeneraterService = new CodeGeneraterService();
|
||||
private IGenTableService GenTableService;
|
||||
private IGenTableColumnService GenTableColumnService;
|
||||
public CodeGeneratorController(IGenTableService genTableService, IGenTableColumnService genTableColumnService)
|
||||
private IWebHostEnvironment WebHostEnvironment;
|
||||
public CodeGeneratorController(IGenTableService genTableService, IGenTableColumnService genTableColumnService, IWebHostEnvironment webHostEnvironment)
|
||||
{
|
||||
GenTableService = genTableService;
|
||||
GenTableColumnService = genTableColumnService;
|
||||
WebHostEnvironment = webHostEnvironment;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -84,10 +88,13 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
var genTableInfo = GenTableService.GetGenTableInfo(dto.TableId);
|
||||
var getTableColumn = GenTableColumnService.GenTableColumns(dto.TableId);
|
||||
genTableInfo.Columns = getTableColumn;
|
||||
//DbTableInfo dbTableInfo = new() { Name = dto.tableName };
|
||||
CodeGeneratorTool.Generate(genTableInfo, dto);
|
||||
|
||||
return SUCCESS(genTableInfo);
|
||||
dto.ParentPath = WebHostEnvironment.WebRootPath + "\\Generatecode\\" + DateTime.Now.ToString("yyyyMMdd") + "\\";
|
||||
|
||||
CodeGeneratorTool.Generate(genTableInfo, dto);
|
||||
string zipPath = CodeGeneratorTool.ZipGenCode(dto);
|
||||
|
||||
return SUCCESS(new { zipPath });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -134,8 +141,8 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
long[] tableId = Tools.SpitLongArrary(tableIds);
|
||||
|
||||
GenTableService.DeleteGenTableByIds(tableId);
|
||||
return SUCCESS(1);
|
||||
int result = GenTableService.DeleteGenTableByIds(tableId);
|
||||
return SUCCESS(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -173,70 +180,28 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
TableComment = tabInfo.Description,
|
||||
Create_by = userName,
|
||||
};
|
||||
int rows = GenTableService.ImportGenTable(genTable);
|
||||
if (rows > 0)
|
||||
genTable.TableId = GenTableService.ImportGenTable(genTable);
|
||||
|
||||
if (genTable.TableId > 0)
|
||||
{
|
||||
//保存列信息
|
||||
List<DbColumnInfo> dbColumnInfos = _CodeGeneraterService.GetColumnInfo(dbName, tableName);
|
||||
List<GenTableColumn> genTableColumns = new();
|
||||
foreach (var column in dbColumnInfos)
|
||||
{
|
||||
GenTableColumn genTableColumn = new()
|
||||
{
|
||||
ColumnName = CodeGeneratorTool.FirstLowerCase(column.DbColumnName),
|
||||
ColumnComment = column.ColumnDescription,
|
||||
IsPk = column.IsPrimarykey,
|
||||
ColumnType = column.DataType,
|
||||
TableId = rows,
|
||||
TableName = tableName,
|
||||
CsharpType = TableMappingHelper.GetPropertyDatatype(column.DataType),
|
||||
CsharpField = column.DbColumnName.Substring(0, 1).ToUpper() + column.DbColumnName[1..],
|
||||
IsRequired = !column.IsNullable,
|
||||
IsIncrement = column.IsIdentity,
|
||||
Create_by = userName,
|
||||
Create_time = DateTime.Now,
|
||||
IsInsert = !column.IsIdentity && !column.IsPrimarykey,
|
||||
IsEdit = !column.IsIdentity && !column.IsPrimarykey,
|
||||
IsList = true,
|
||||
IsQuery = false,
|
||||
HtmlType = GenConstants.HTML_INPUT
|
||||
};
|
||||
|
||||
if (CodeGeneratorTool.imageFiled.Any(f => column.DbColumnName.ToLower().Contains(f.ToLower())))
|
||||
{
|
||||
genTableColumn.HtmlType = GenConstants.HTML_IMAGE_UPLOAD;
|
||||
}
|
||||
else if (genTableColumn.CsharpType.ToLower().Contains("datetime"))
|
||||
{
|
||||
genTableColumn.HtmlType = GenConstants.HTML_DATETIME;
|
||||
}
|
||||
else if (CodeGeneratorTool.radioFiled.Any(f => column.DbColumnName.Contains(f)))
|
||||
{
|
||||
genTableColumn.HtmlType = GenConstants.HTML_RADIO;
|
||||
}
|
||||
else if (CodeGeneratorTool.selectFiled.Any(f => column.DbColumnName.Contains(f)))
|
||||
{
|
||||
genTableColumn.HtmlType = GenConstants.HTML_SELECT;
|
||||
}
|
||||
else if (column.Length > 300)
|
||||
{
|
||||
genTableColumn.HtmlType = GenConstants.HTML_TEXTAREA;
|
||||
}
|
||||
|
||||
genTableColumns.Add(genTableColumn);
|
||||
}
|
||||
List<GenTableColumn> genTableColumns = CodeGeneratorTool.InitGenTableColumn(genTable, dbColumnInfos);
|
||||
|
||||
GenTableColumnService.DeleteGenTableColumnByTableName(tableName);
|
||||
GenTableColumnService.InsertGenTableColumn(genTableColumns);
|
||||
genTable.Columns = genTableColumns;
|
||||
|
||||
return SUCCESS(genTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return SUCCESS(1);
|
||||
return ToRespose(ResultCode.FAIL);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成保存
|
||||
/// 修改保存代码生成业务
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
|
||||
@ -1,130 +0,0 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.System;
|
||||
using ZR.Service.System.IService;
|
||||
using Infrastructure.Model;
|
||||
using SqlSugar;
|
||||
using Mapster;
|
||||
using ZR.Model.System.Dto;
|
||||
using Infrastructure.Enums;
|
||||
using Infrastructure;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// T4代码自动生成
|
||||
/// </summary>
|
||||
|
||||
[Verify]
|
||||
[Route("system/SysFile")]
|
||||
public class SysFile1Controller: BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件管理接口
|
||||
/// </summary>
|
||||
private readonly ISysFileService _SysFileService;
|
||||
|
||||
public SysFile1Controller(ISysFileService SysFileService)
|
||||
{
|
||||
_SysFileService = SysFileService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询文件管理列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
//[ActionPermissionFilter(Permission = "system:SysFile:list")]
|
||||
public IActionResult Query([FromQuery] SysFileQueryDto parm)
|
||||
{
|
||||
//开始拼装查询条件
|
||||
var predicate = Expressionable.Create<SysFile>();
|
||||
|
||||
//TODO 搜索条件
|
||||
//predicate = predicate.And(m => m.Name.Contains(parm.Name));
|
||||
|
||||
var response = _SysFileService.GetPages(predicate.ToExpression(), parm);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询文件管理详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{id}")]
|
||||
public IActionResult Get(string id)
|
||||
{
|
||||
var response = _SysFileService.GetId(id);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加文件管理
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
//[ActionPermissionFilter(Permission = "system:SysFile:add")]
|
||||
[Log(Title = "文件管理添加", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult Create([FromBody] SysFile parm)
|
||||
{
|
||||
if (parm == null)
|
||||
{
|
||||
throw new CustomException("请求参数错误");
|
||||
}
|
||||
//从 Dto 映射到 实体
|
||||
var addModel = parm.Adapt<SysFile>().ToCreate();
|
||||
//addModel.CreateID = User.Identity.Name;
|
||||
|
||||
return SUCCESS(_SysFileService.Add(addModel));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新文件管理
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut("edit")]
|
||||
//[ActionPermissionFilter(Permission = "system:SysFile:update")]
|
||||
[Log(Title = "文件管理修改", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult Update([FromBody] SysFile parm)
|
||||
{
|
||||
//从 Dto 映射到 实体
|
||||
var addModel = parm.Adapt<SysFile>().ToCreate();
|
||||
//addModel.CreateID = User.Identity.Name;
|
||||
//TODO 字段映射
|
||||
var response = _SysFileService.Update(addModel);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除文件管理
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{id}")]
|
||||
//[ActionPermissionFilter(Permission = "system:SysFile:delete")]
|
||||
[Log(Title = "文件管理删除", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult Delete(int id = 0)
|
||||
{
|
||||
if (id <= 0) { return OutputJson(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
// 删除文件管理
|
||||
var response = _SysFileService.Delete(id);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,145 +0,0 @@
|
||||
<#@ template debug="false" hostspecific="false" language="C#" #>
|
||||
<#@ assembly name="System.Core" #>
|
||||
<#@ import namespace="System.Linq" #>
|
||||
<#@ import namespace="System.Text" #>
|
||||
<#@ import namespace="System.Collections.Generic" #>
|
||||
<#@ output extension=".cs" #>
|
||||
|
||||
<#
|
||||
string ModelName="SysFile";
|
||||
string ControllerName="SysFile";
|
||||
string ServiceName="SysFileService";
|
||||
string FileName="文件管理";
|
||||
string ModelNameSpace="ZRAdmin.Controllers";
|
||||
#>
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZRAdmin.Filters;
|
||||
using ZR.Model;
|
||||
using ZR.Model.System;
|
||||
using ZR.Model.Vo;
|
||||
using ZR.Service.IService;
|
||||
using Infrastructure.Model;
|
||||
using SqlSugar;
|
||||
using Mapster;
|
||||
using ZR.Model.Dto.System;
|
||||
using Infrastructure.Enums;
|
||||
using Infrastructure;
|
||||
using ZRAdmin.Extensions;
|
||||
|
||||
namespace <#=ModelNameSpace#>
|
||||
{
|
||||
/// <summary>
|
||||
/// T4代码自动生成
|
||||
/// </summary>
|
||||
|
||||
[Verify]
|
||||
[Route("system/<#=ModelName#>")]
|
||||
public class <#=ControllerName#>1Controller: BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// <#=FileName#>接口
|
||||
/// </summary>
|
||||
private readonly I<#=ServiceName#> _<#=ServiceName#>;
|
||||
|
||||
public <#=ControllerName#>1Controller(I<#=ServiceName#> <#=ServiceName#>)
|
||||
{
|
||||
_<#=ServiceName#> = <#=ServiceName#>;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询<#=FileName#>列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
//[ActionPermissionFilter(Permission = "system:<#=ModelName#>:list")]
|
||||
public IActionResult Query([FromQuery] <#=ModelName#>QueryDto parm)
|
||||
{
|
||||
//开始拼装查询条件
|
||||
var predicate = Expressionable.Create<<#=ModelName#>>();
|
||||
|
||||
//TODO 搜索条件
|
||||
//predicate = predicate.And(m => m.Name.Contains(parm.Name));
|
||||
|
||||
var response = _<#=ServiceName#>.GetPages(predicate.ToExpression(), parm);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询<#=FileName#>详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{id}")]
|
||||
public IActionResult Get(string id)
|
||||
{
|
||||
var response = _<#=ServiceName#>.GetId(id);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加<#=FileName#>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
//[ActionPermissionFilter(Permission = "system:<#=ModelName#>:add")]
|
||||
[Log(Title = "<#=FileName#>添加", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult Create([FromBody] <#=ModelName#> parm)
|
||||
{
|
||||
if (parm == null)
|
||||
{
|
||||
throw new CustomException("请求参数错误");
|
||||
}
|
||||
//从 Dto 映射到 实体
|
||||
var addModel = parm.Adapt<<#=ModelName#>>().ToCreate();
|
||||
//addModel.CreateID = User.Identity.Name;
|
||||
|
||||
return SUCCESS(_<#=ServiceName#>.Add(addModel));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新<#=FileName#>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut("edit")]
|
||||
//[ActionPermissionFilter(Permission = "system:<#=ModelName#>:update")]
|
||||
[Log(Title = "<#=FileName#>修改", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult Update([FromBody] <#=ModelName#> parm)
|
||||
{
|
||||
//从 Dto 映射到 实体
|
||||
var addModel = parm.Adapt<<#=ModelName#>>().ToCreate();
|
||||
//addModel.CreateID = User.Identity.Name;
|
||||
//TODO 字段映射
|
||||
var response = _<#=ServiceName#>.Update(addModel);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除<#=FileName#>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{id}")]
|
||||
//[ActionPermissionFilter(Permission = "system:<#=ModelName#>:delete")]
|
||||
[Log(Title = "<#=FileName#>删除", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult Delete(int id = 0)
|
||||
{
|
||||
if (id <= 0) { return OutputJson(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
// 删除<#=FileName#>
|
||||
var response = _<#=ServiceName#>.Delete(id);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -15,6 +15,11 @@
|
||||
<ItemGroup>
|
||||
<Compile Remove="Filters\GlobalExceptionFilter.cs" />
|
||||
<Compile Remove="Middleware\RequestIPMiddleware.cs" />
|
||||
<Compile Remove="Template\Controller.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Template\Controller.tt" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -53,10 +58,6 @@
|
||||
<None Update="ip2region.db">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Template\Controller.tt">
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>Controller.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Update="Template\ControllersTemplate.txt">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
@ -86,6 +87,7 @@
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\business\" />
|
||||
<Folder Include="wwwroot\" />
|
||||
<Folder Include="wwwroot\Generatecode\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -102,12 +104,4 @@
|
||||
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Template\Controller.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Controller.tt</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -28,9 +28,9 @@
|
||||
},
|
||||
"gen": {
|
||||
"conn": "server=127.0.0.1;user=zr;pwd=abc;database={database}",
|
||||
"dbType": 1,
|
||||
"dbType": 0, //MySql = 0, SqlServer = 1
|
||||
"autoPre": true, //自动去除表前缀
|
||||
"author": "zhaorui",
|
||||
"author": "zr",
|
||||
"tablePrefix": "live_,sys_" //"表前缀(生成类名不会包含表前缀,多个用逗号分隔)",
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ using {ModelsNamespace}.Models;
|
||||
using {ServicesNamespace}.Business;
|
||||
using {ApiControllerNamespace}.Extensions;
|
||||
using {ApiControllerNamespace}.Filters;
|
||||
using ZR.Common;
|
||||
|
||||
namespace {ApiControllerNamespace}.Controllers
|
||||
{
|
||||
@ -59,7 +60,7 @@ namespace {ApiControllerNamespace}.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpGet("{{PrimaryKey}}")]
|
||||
[ActionPermissionFilter(Permission = "{Permission}:query")]
|
||||
public IActionResult Get{ModelName}({KeyTypeName} {PrimaryKey})
|
||||
public IActionResult Get{ModelName}({PKCsharpType} {PrimaryKey})
|
||||
{
|
||||
var response = _{ModelName}Service.GetId({PrimaryKey});
|
||||
|
||||
@ -117,14 +118,15 @@ namespace {ApiControllerNamespace}.Controllers
|
||||
/// 删除{TableDesc}
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{{PrimaryKey}}")]
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "{Permission}:delete")]
|
||||
[Log(Title = "{TableDesc}删除", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult Delete{ModelName}({KeyTypeName} {PrimaryKey} = 0)
|
||||
public IActionResult Delete{ModelName}(string ids)
|
||||
{
|
||||
if ({PrimaryKey} <= 0) { return OutputJson(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0) { return OutputJson(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _{ModelName}Service.Delete({PrimaryKey});
|
||||
var response = _{ModelName}Service.Delete(idsArr);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
@ -107,6 +107,7 @@ export default {
|
||||
// this.getDicts("sys_normal_disable").then((response) => {
|
||||
// this.statusOptions = response.data;
|
||||
// });
|
||||
{MountedMethod}
|
||||
},
|
||||
methods: {
|
||||
// 查询数据
|
||||
@ -166,7 +167,8 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
del{ModelTypeName}(row.{primaryKey}).then((res) => {
|
||||
const {primaryKey}s = row.{primaryKey} || this.ids;
|
||||
del{ModelTypeName}({primaryKey}s.toString()).then((res) => {
|
||||
this.msgSuccess("删除成功");
|
||||
this.handleQuery();
|
||||
});
|
||||
@ -184,7 +186,6 @@ export default {
|
||||
});
|
||||
},
|
||||
beforeFileUpload(file) { },
|
||||
//文件上传成功方法
|
||||
{vueJsMethod}
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
@ -15,17 +15,28 @@ namespace ZR.CodeGenerator
|
||||
/// </summary>
|
||||
/// <param name="dbColumnInfo"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetVueJsMethod(GenTableColumn dbColumnInfo)
|
||||
public static string GetVueJsMethod(GenTableColumn dbFieldInfo)
|
||||
{
|
||||
string columnName = dbColumnInfo.ColumnName;
|
||||
string columnName = dbFieldInfo.ColumnName;
|
||||
string js = "";
|
||||
if (dbColumnInfo.HtmlType.Equals(GenConstants.HTML_IMAGE_UPLOAD))
|
||||
if (dbFieldInfo.HtmlType.Equals(GenConstants.HTML_IMAGE_UPLOAD))
|
||||
{
|
||||
js += " //文件上传成功方法\r\n";
|
||||
js += $" handleUpload{columnName}Success(res, file) {{\r\n";
|
||||
js += $" this.form.{columnName} = URL.createObjectURL(file.raw);\r\n";
|
||||
js += " // this.$refs.upload.clearFiles();\r\n";
|
||||
js += " },\r";
|
||||
}
|
||||
//有下拉框选项初列表查询数据
|
||||
if (dbFieldInfo.HtmlType == GenConstants.HTML_SELECT && !string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
{
|
||||
var sb = new System.Text.StringBuilder(500);
|
||||
sb.AppendLine(@$" // {dbFieldInfo.ColumnComment}字典翻译");
|
||||
sb.AppendLine($" {columnName}Format(row, column) {{");
|
||||
sb.AppendLine(@$" return this.selectDictLabel(this.{columnName}Options, row.{columnName});");
|
||||
sb.AppendLine(@" },");
|
||||
js += sb.ToString();
|
||||
}
|
||||
return js;
|
||||
}
|
||||
|
||||
@ -79,7 +90,7 @@ namespace ZR.CodeGenerator
|
||||
public static string GetDtoProperty(GenTableColumn dbFieldInfo)
|
||||
{
|
||||
string InputDtoContent = "";
|
||||
if (CodeGeneratorTool.inputDtoNoField.Any(f => f.Replace("_", "").ToLower().Contains(dbFieldInfo.CsharpField.ToLower().Replace("_", ""))))
|
||||
if (GenConstants.inputDtoNoField.Any(f => f.Replace("_", "").ToLower().Contains(dbFieldInfo.CsharpField.ToLower().Replace("_", ""))))
|
||||
{
|
||||
return InputDtoContent;
|
||||
}
|
||||
@ -98,7 +109,7 @@ namespace ZR.CodeGenerator
|
||||
public static string GetQueryDtoProperty(GenTableColumn dbFieldInfo)
|
||||
{
|
||||
string QueryDtoContent = "";
|
||||
if (dbFieldInfo.IsQuery && !CodeGeneratorTool.inputDtoNoField.Any(f => f.Replace("_", "").ToLower().Contains(dbFieldInfo.CsharpField.ToLower().Replace("_", ""))))
|
||||
if (dbFieldInfo.IsQuery && !GenConstants.inputDtoNoField.Any(f => f.Replace("_", "").ToLower().Contains(dbFieldInfo.CsharpField.ToLower().Replace("_", ""))))
|
||||
{
|
||||
QueryDtoContent += $" public {dbFieldInfo.CsharpType} {dbFieldInfo.CsharpField} {{ get; set; }}\r\n";
|
||||
}
|
||||
@ -114,7 +125,7 @@ namespace ZR.CodeGenerator
|
||||
string vueViewFromContent = "";
|
||||
string labelDisabled = dbFieldInfo.IsPk ? ":disabled=\"true\"" : "";
|
||||
string placeHolder = dbFieldInfo.IsIncrement ? "" : $"请输入{labelName}";
|
||||
if (CodeGeneratorTool.inputDtoNoField.Any(f => f.Replace("_", "").ToLower().Contains(dbFieldInfo.CsharpField.ToLower().Replace("_", ""))))
|
||||
if (GenConstants.inputDtoNoField.Any(f => f.Replace("_", "").ToLower().Contains(dbFieldInfo.CsharpField.ToLower().Replace("_", ""))))
|
||||
{
|
||||
return vueViewFromContent;
|
||||
}
|
||||
@ -157,9 +168,10 @@ namespace ZR.CodeGenerator
|
||||
}
|
||||
else if (dbFieldInfo.HtmlType == GenConstants.HTML_SELECT && !string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
{
|
||||
string value = TableMappingHelper.IsNumber(dbFieldInfo.CsharpType) ? "parseInt(item.dictValue)" : "item.dictValue";
|
||||
vueViewFromContent += $" <el-form-item label=\"{ labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">\r\n";
|
||||
vueViewFromContent += $" <el-select v-model=\"form.{columnName}\" > ";
|
||||
vueViewFromContent += $" <el-option v-for=\"item in {columnName}Options\" :key=\"item.dictValue\" :label=\"item.dictLabel\" :value=\"item.dictValue\"></el-option>\r\n";
|
||||
vueViewFromContent += $" <el-select v-model=\"form.{columnName}\">\r\n";
|
||||
vueViewFromContent += $" <el-option v-for=\"item in {columnName}Options\" :key=\"item.dictValue\" :label=\"item.dictLabel\" :value=\"{value}\"></el-option>\r\n";
|
||||
vueViewFromContent += " </el-select>\r\n";
|
||||
vueViewFromContent += " </el-form-item>\r\n";
|
||||
}
|
||||
@ -208,12 +220,10 @@ namespace ZR.CodeGenerator
|
||||
string columnName = dbFieldInfo.ColumnName;
|
||||
string label = CodeGeneratorTool.GetLabelName(dbFieldInfo.ColumnComment, columnName);
|
||||
string vueViewListContent = "";
|
||||
string showToolTip = dbFieldInfo.CsharpType == "string" ? ":show-overflow-tooltip=\"true\"" : "";
|
||||
if (!dbFieldInfo.IsList)
|
||||
{
|
||||
string showToolTip = dbFieldInfo.ColumnType.Contains("varchar") ? ":show-overflow-tooltip=\"true\"" : "";
|
||||
string formatter = !string.IsNullOrEmpty(dbFieldInfo.DictType) ? $" :formatter=\"{columnName}Format\"" : "";
|
||||
|
||||
}
|
||||
else if (dbFieldInfo.HtmlType.Equals(GenConstants.HTML_IMAGE_UPLOAD))
|
||||
if (dbFieldInfo.IsList && dbFieldInfo.HtmlType.Equals(GenConstants.HTML_IMAGE_UPLOAD))
|
||||
{
|
||||
vueViewListContent += $" <el-table-column prop=\"{columnName}\" label=\"图片\">\r\n";
|
||||
vueViewListContent += " <template slot-scope=\"scope\">\r\n";
|
||||
@ -230,9 +240,9 @@ namespace ZR.CodeGenerator
|
||||
// vueViewListContent += " </template>\r\n";
|
||||
// vueViewListContent += " </el-table-column>\r\n";
|
||||
//}
|
||||
else
|
||||
else if(dbFieldInfo.IsList)
|
||||
{
|
||||
vueViewListContent += $" <el-table-column prop=\"{columnName}\" label=\"{label}\" align=\"center\" width=\"100\" {showToolTip} />\r\n";
|
||||
vueViewListContent += $" <el-table-column prop=\"{columnName}\" label=\"{label}\" align=\"center\" {showToolTip}{formatter}/>\r\n";
|
||||
}
|
||||
return vueViewListContent;
|
||||
}
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
using Infrastructure;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using ZR.CodeGenerator.CodeGenerator;
|
||||
using ZR.CodeGenerator.Model;
|
||||
using ZR.Model.System.Generate;
|
||||
|
||||
@ -20,24 +22,15 @@ namespace ZR.CodeGenerator
|
||||
/// 代码生成器配置
|
||||
/// </summary>
|
||||
private static CodeGenerateOption _option = new CodeGenerateOption();
|
||||
/// <summary>
|
||||
/// InputDto输入实体是不包含字段
|
||||
/// </summary>
|
||||
public static readonly string[] inputDtoNoField = new string[] { "createTime", "updateTime", "addtime" };
|
||||
public static readonly string[] imageFiled = new string[] { "icon", "img", "image", "url", "pic", "photo" };
|
||||
public static readonly string[] selectFiled = new string[] { "status", "type", "state", "sex", "gender" };
|
||||
public static readonly string[] radioFiled = new string[] { "status", "state", "isShow", "isHidden", "ishide" };
|
||||
|
||||
/// <summary>
|
||||
/// 代码生成器入口方法
|
||||
/// </summary>
|
||||
/// <param name="dbTableInfo"></param>
|
||||
/// <param name="dto"></param>
|
||||
public static void Generate(GenTable dbTableInfo, GenerateDto dto)
|
||||
public static List<string> Generate(GenTable dbTableInfo, GenerateDto dto)
|
||||
{
|
||||
_option.BaseNamespace = "ZR.";
|
||||
//_option.TableList = listTable;
|
||||
_option.ReplaceTableNameStr = dto.replaceTableNameStr;
|
||||
_option.BaseNamespace = dbTableInfo.BaseNameSpace;
|
||||
_option.DtosNamespace = _option.BaseNamespace + "Model";
|
||||
_option.ModelsNamespace = _option.BaseNamespace + "Model";
|
||||
_option.RepositoriesNamespace = _option.BaseNamespace + "Repository";
|
||||
@ -46,7 +39,43 @@ namespace ZR.CodeGenerator
|
||||
_option.ServicesNamespace = _option.BaseNamespace + "Service";
|
||||
_option.ApiControllerNamespace = _option.BaseNamespace + "Admin.WebApi";
|
||||
|
||||
GenerateSingle(dbTableInfo?.Columns, dbTableInfo, dto);
|
||||
List<string> list = GenerateSingle(dbTableInfo?.Columns, dbTableInfo, dto);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打包压缩代码
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public static string ZipGenCode(GenerateDto dto)
|
||||
{
|
||||
try
|
||||
{
|
||||
string zipPath = Environment.CurrentDirectory + "\\wwwroot\\Generatecode\\";
|
||||
//生成压缩包
|
||||
string zipReturnFileName = dto.baseSpace + DateTime.Now.ToString("yyyyMMddHHmmss") + ".zip";
|
||||
|
||||
if (!Directory.Exists(zipPath))
|
||||
{
|
||||
Directory.CreateDirectory(zipPath);
|
||||
}
|
||||
string zipFileName = zipPath + "\\" + zipReturnFileName;
|
||||
if (File.Exists(zipFileName))
|
||||
{
|
||||
File.Delete(zipFileName);
|
||||
}
|
||||
Console.WriteLine(zipFileName);
|
||||
FileHelper.ZipFileDirectory(dto.ParentPath, zipFileName, 7, "", "", "*.*");
|
||||
FileHelper.DeleteDirectory(dto.ParentPath);
|
||||
return zipFileName;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -55,10 +84,11 @@ namespace ZR.CodeGenerator
|
||||
/// <param name="listField">表字段集合</param>
|
||||
/// <param name="tableInfo">表信息</param>
|
||||
/// <param name="dto"></param>
|
||||
public static void GenerateSingle(List<GenTableColumn> listField, GenTable tableInfo, GenerateDto dto)
|
||||
public static List<string> GenerateSingle(List<GenTableColumn> listField, GenTable tableInfo, GenerateDto dto)
|
||||
{
|
||||
string PKName = "id";
|
||||
string PKType = "int";
|
||||
List<string> genPathList = new();
|
||||
ReplaceDto replaceDto = new();
|
||||
replaceDto.ModelTypeName = tableInfo.ClassName;//表名对应C# 实体类名
|
||||
replaceDto.TableName = tableInfo.TableName;
|
||||
@ -88,15 +118,19 @@ namespace ZR.CodeGenerator
|
||||
{
|
||||
replaceDto.InsertColumn += $"it.{dbFieldInfo.CsharpField}, ";
|
||||
}
|
||||
//查询
|
||||
//TODO 查询
|
||||
//if (dbFieldInfo.IsQuery)
|
||||
//{
|
||||
// replaceDto.Querycondition += $"predicate = predicate.And(m => m.{dbFieldInfo.CsharpField}.Contains(parm.Name));";
|
||||
//}
|
||||
if (dbFieldInfo.HtmlType == GenConstants.HTML_SELECT && !string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
if ((dbFieldInfo.HtmlType == GenConstants.HTML_SELECT || dbFieldInfo.HtmlType == GenConstants.HTML_RADIO) && !string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
{
|
||||
replaceDto.VueDataContent += $"// {dbFieldInfo.ColumnComment}选项列表\n";
|
||||
replaceDto.VueDataContent += $"{FirstLowerCase(dbFieldInfo.CsharpField)}Options: [],";
|
||||
|
||||
replaceDto.MountedMethod += $" this.getDicts(\"{dbFieldInfo.DictType}\").then((response) => {{\n";
|
||||
replaceDto.MountedMethod += $" this.{FirstLowerCase(dbFieldInfo.CsharpField)}Options = response.data;\n";
|
||||
replaceDto.MountedMethod += " })\n";
|
||||
}
|
||||
|
||||
replaceDto.QueryProperty += CodeGenerateTemplate.GetQueryDtoProperty(dbFieldInfo);
|
||||
@ -113,29 +147,44 @@ namespace ZR.CodeGenerator
|
||||
|
||||
if (dto.genFiles.Contains(1))
|
||||
{
|
||||
GenerateModels(replaceDto, dto);
|
||||
Tuple<string, string> tuple = GenerateModels(replaceDto, dto);
|
||||
genPathList.Add(tuple.Item1);
|
||||
//WriteAndSave(tuple.Item1, tuple.Item2);
|
||||
}
|
||||
if (dto.genFiles.Contains(2))
|
||||
{
|
||||
GenerateInputDto(replaceDto, dto);
|
||||
Tuple<string, string> tuple = GenerateInputDto(replaceDto, dto);
|
||||
genPathList.Add(tuple.Item1);
|
||||
//WriteAndSave(tuple.Item1, tuple.Item2);
|
||||
}
|
||||
if (dto.genFiles.Contains(3))
|
||||
{
|
||||
GenerateRepository(replaceDto, dto);
|
||||
Tuple<string, string> tuple = GenerateRepository(replaceDto, dto);
|
||||
genPathList.Add(tuple.Item1);
|
||||
//WriteAndSave(tuple.Item1, tuple.Item2);
|
||||
}
|
||||
if (dto.genFiles.Contains(4))
|
||||
{
|
||||
GenerateIService(replaceDto, dto);
|
||||
GenerateService(replaceDto, dto);
|
||||
Tuple<string, string> tuple = GenerateIService(replaceDto, dto);
|
||||
Tuple<string, string> tuple_1 = GenerateService(replaceDto, dto);
|
||||
genPathList.Add(tuple.Item1);
|
||||
genPathList.Add(tuple_1.Item1);
|
||||
//WriteAndSave(tuple.Item1, tuple.Item2);
|
||||
//WriteAndSave(tuple_1.Item1, tuple_1.Item2);
|
||||
}
|
||||
if (dto.genFiles.Contains(5))
|
||||
{
|
||||
GenerateControllers(replaceDto, dto);
|
||||
Tuple<string, string> tuple = GenerateControllers(replaceDto, dto);
|
||||
genPathList.Add(tuple.Item1);
|
||||
//WriteAndSave(tuple.Item1, tuple.Item2);
|
||||
}
|
||||
if (dto.genFiles.Contains(6))
|
||||
{
|
||||
GenerateVueViews(replaceDto, dto);
|
||||
Tuple<string, string> tuple = GenerateVueViews(replaceDto, dto);
|
||||
genPathList.Add(tuple.Item1);
|
||||
//WriteAndSave(tuple.Item1, tuple.Item2);
|
||||
}
|
||||
return genPathList;
|
||||
//GenerateIRepository(modelTypeName, modelTypeDesc, keyTypeName, ifExsitedCovered);
|
||||
//GenerateOutputDto(modelTypeName, modelTypeDesc, outputDtocontent, ifExsitedCovered);
|
||||
}
|
||||
@ -150,7 +199,7 @@ namespace ZR.CodeGenerator
|
||||
/// <param name="replaceDto">替换实体</param>
|
||||
private static Tuple<string, string> GenerateModels(ReplaceDto replaceDto, GenerateDto generateDto)
|
||||
{
|
||||
var parentPath = "..";
|
||||
var parentPath = generateDto.ParentPath;
|
||||
//../ZR.Model
|
||||
var servicesPath = parentPath + "\\" + _option.ModelsNamespace + "\\Models\\";
|
||||
if (!Directory.Exists(servicesPath))
|
||||
@ -159,7 +208,7 @@ namespace ZR.CodeGenerator
|
||||
}
|
||||
// ../ZR.Model/Models/User.cs
|
||||
var fullPath = servicesPath + replaceDto.ModelTypeName + ".cs";
|
||||
Console.WriteLine(fullPath);
|
||||
|
||||
if (File.Exists(fullPath) && !generateDto.coverd)
|
||||
return Tuple.Create(fullPath, "");
|
||||
var content = ReadTemplate("ModelTemplate.txt");
|
||||
@ -174,7 +223,6 @@ namespace ZR.CodeGenerator
|
||||
return Tuple.Create(fullPath, content);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 生成InputDto文件
|
||||
/// </summary>
|
||||
@ -182,7 +230,7 @@ namespace ZR.CodeGenerator
|
||||
/// <param name="replaceDto">替换实体</param>
|
||||
private static Tuple<string, string> GenerateInputDto(ReplaceDto replaceDto, GenerateDto generateDto)
|
||||
{
|
||||
var parentPath = "..";
|
||||
var parentPath = generateDto.ParentPath;
|
||||
var servicesPath = parentPath + "\\" + _option.ModelsNamespace + "\\Dto\\";
|
||||
if (!Directory.Exists(servicesPath))
|
||||
{
|
||||
@ -190,7 +238,7 @@ namespace ZR.CodeGenerator
|
||||
}
|
||||
// ../ZR.Model/Dto/User.cs
|
||||
var fullPath = servicesPath + replaceDto.ModelTypeName + "Dto.cs";
|
||||
Console.WriteLine(fullPath);
|
||||
|
||||
if (File.Exists(fullPath) && !generateDto.coverd)
|
||||
return Tuple.Create(fullPath, ""); ;
|
||||
var content = ReadTemplate("InputDtoTemplate.txt");
|
||||
@ -215,14 +263,14 @@ namespace ZR.CodeGenerator
|
||||
/// <param name="replaceDto">替换实体</param>
|
||||
private static Tuple<string, string> GenerateRepository(ReplaceDto replaceDto, GenerateDto generateDto)
|
||||
{
|
||||
var parentPath = "..";
|
||||
var parentPath = generateDto.ParentPath;
|
||||
var repositoryPath = parentPath + "\\" + _option.RepositoriesNamespace + "\\Repositories\\";
|
||||
if (!Directory.Exists(repositoryPath))
|
||||
{
|
||||
Directory.CreateDirectory(repositoryPath);
|
||||
}
|
||||
var fullPath = repositoryPath + "\\" + replaceDto.ModelTypeName + "Repository.cs";
|
||||
Console.WriteLine(fullPath);
|
||||
|
||||
if (File.Exists(fullPath) && !generateDto.coverd)
|
||||
return Tuple.Create(fullPath, "");
|
||||
var content = ReadTemplate("RepositoryTemplate.txt");
|
||||
@ -247,7 +295,7 @@ namespace ZR.CodeGenerator
|
||||
/// <param name="replaceDto">替换实体</param>
|
||||
private static Tuple<string, string> GenerateIService(ReplaceDto replaceDto, GenerateDto generateDto)
|
||||
{
|
||||
var parentPath = "..";
|
||||
var parentPath = generateDto.ParentPath;
|
||||
var iServicesPath = parentPath + "\\" + _option.IServicsNamespace + "\\Business\\IBusService\\";
|
||||
if (!Directory.Exists(iServicesPath))
|
||||
{
|
||||
@ -274,7 +322,7 @@ namespace ZR.CodeGenerator
|
||||
/// </summary>
|
||||
private static Tuple<string, string> GenerateService(ReplaceDto replaceDto, GenerateDto generateDto)
|
||||
{
|
||||
var parentPath = "..";
|
||||
var parentPath = generateDto.ParentPath;
|
||||
var servicesPath = parentPath + "\\" + _option.ServicesNamespace + "\\Business\\";
|
||||
if (!Directory.Exists(servicesPath))
|
||||
{
|
||||
@ -306,14 +354,13 @@ namespace ZR.CodeGenerator
|
||||
/// </summary>
|
||||
private static Tuple<string, string> GenerateControllers(ReplaceDto replaceDto, GenerateDto generateDto)
|
||||
{
|
||||
var parentPath = "..";
|
||||
var parentPath = generateDto.ParentPath;
|
||||
var servicesPath = parentPath + "\\" + _option.ApiControllerNamespace + "\\Controllers\\business\\";
|
||||
if (!Directory.Exists(servicesPath))
|
||||
{
|
||||
Directory.CreateDirectory(servicesPath);
|
||||
}
|
||||
var fullPath = servicesPath + replaceDto.ModelTypeName + "Controller.cs";
|
||||
Console.WriteLine(fullPath);
|
||||
if (File.Exists(fullPath) && !generateDto.coverd)
|
||||
return Tuple.Create(fullPath, "");
|
||||
var content = ReadTemplate("ControllersTemplate.txt");
|
||||
@ -327,7 +374,7 @@ namespace ZR.CodeGenerator
|
||||
.Replace("{PrimaryKey}", replaceDto.PKName)
|
||||
.Replace("{UpdateColumn}", replaceDto.UpdateColumn)
|
||||
.Replace("{InsertColumn}", replaceDto.InsertColumn)
|
||||
.Replace("{KeyTypeName}", replaceDto.PKType);
|
||||
.Replace("{PKCsharpType}", replaceDto.PKType);
|
||||
WriteAndSave(fullPath, content);
|
||||
return Tuple.Create(fullPath, content);
|
||||
}
|
||||
@ -339,14 +386,14 @@ namespace ZR.CodeGenerator
|
||||
private static Tuple<string, string> GenerateVueViews(ReplaceDto replaceDto, GenerateDto generateDto)
|
||||
{
|
||||
//var parentPath = "..\\CodeGenerate";//若要生成到项目中将路径改成 “..\\ZR.Vue\\src”
|
||||
var parentPath = "..\\ZR.Vue\\src";
|
||||
var parentPath = $"{generateDto.ParentPath}\\ZR.Vue\\src";
|
||||
var servicesPath = parentPath + "\\views\\" + FirstLowerCase(replaceDto.ModelTypeName);
|
||||
if (!Directory.Exists(servicesPath))
|
||||
{
|
||||
Directory.CreateDirectory(servicesPath);
|
||||
}
|
||||
var fullPath = servicesPath + "\\" + "index.vue";
|
||||
Console.WriteLine(fullPath);
|
||||
|
||||
if (File.Exists(fullPath) && !generateDto.coverd)
|
||||
return Tuple.Create(fullPath, ""); ;
|
||||
var content = ReadTemplate("VueTemplate.txt");
|
||||
@ -360,8 +407,8 @@ namespace ZR.CodeGenerator
|
||||
.Replace("{vueJsMethod}", replaceDto.VueJsMethod)
|
||||
.Replace("{vueQueryFormHtml}", replaceDto.VueQueryFormHtml)
|
||||
.Replace("{VueDataContent}", replaceDto.VueDataContent)
|
||||
//.Replace("{VueViewSaveBindContent}", vueViewSaveBindContent)
|
||||
.Replace("{primaryKey}", FirstLowerCase(replaceDto.PKName))
|
||||
.Replace("{MountedMethod}", replaceDto.MountedMethod)
|
||||
.Replace("{VueViewEditFormRuleContent}", replaceDto.VueViewEditFormRuleContent);//添加、修改表单验证规则
|
||||
WriteAndSave(fullPath, content);
|
||||
|
||||
@ -369,14 +416,14 @@ namespace ZR.CodeGenerator
|
||||
servicesPath = parentPath + "\\api\\";
|
||||
Directory.CreateDirectory(servicesPath);
|
||||
fullPath = servicesPath + "\\" + FirstLowerCase(replaceDto.ModelTypeName) + ".js";
|
||||
Console.WriteLine(fullPath);
|
||||
|
||||
if (File.Exists(fullPath) && !generateDto.coverd)
|
||||
return Tuple.Create(fullPath, "");
|
||||
content = ReadTemplate("VueJsTemplate.txt");
|
||||
content = content
|
||||
.Replace("{ModelTypeName}", replaceDto.ModelTypeName)
|
||||
.Replace("{ModelTypeDesc}", replaceDto.TableDesc);
|
||||
//.Replace("{fileClassName}", fileClassName)
|
||||
|
||||
WriteAndSave(fullPath, content);
|
||||
return Tuple.Create(fullPath, content);
|
||||
}
|
||||
@ -437,8 +484,9 @@ namespace ZR.CodeGenerator
|
||||
/// <returns></returns>
|
||||
private static string ReadTemplate(string templateName)
|
||||
{
|
||||
var path = AppDomain.CurrentDomain.BaseDirectory;
|
||||
string fullName = $"{path}\\Template\\{templateName}";
|
||||
string path = Environment.CurrentDirectory;
|
||||
//var path = AppDomain.CurrentDomain.BaseDirectory;
|
||||
string fullName = $"{path}\\wwwroot\\CodeGenTemplate\\{templateName}";
|
||||
string temp = fullName;
|
||||
string str = "";
|
||||
if (!File.Exists(temp))
|
||||
@ -485,5 +533,74 @@ namespace ZR.CodeGenerator
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 初始化列属性字段数据
|
||||
/// </summary>
|
||||
/// <param name="genTable"></param>
|
||||
/// <param name="dbColumnInfos"></param>
|
||||
public static List<GenTableColumn> InitGenTableColumn(GenTable genTable, List<DbColumnInfo> dbColumnInfos)
|
||||
{
|
||||
List<GenTableColumn> genTableColumns = new();
|
||||
foreach (var column in dbColumnInfos)
|
||||
{
|
||||
GenTableColumn genTableColumn = new()
|
||||
{
|
||||
ColumnName = FirstLowerCase(column.DbColumnName),
|
||||
ColumnComment = column.ColumnDescription,
|
||||
IsPk = column.IsPrimarykey,
|
||||
ColumnType = column.DataType,
|
||||
TableId = genTable.TableId,
|
||||
TableName = genTable.TableName,
|
||||
CsharpType = TableMappingHelper.GetCSharpDatatype(column.DataType),
|
||||
CsharpField = column.DbColumnName.Substring(0, 1).ToUpper() + column.DbColumnName[1..],
|
||||
IsRequired = !column.IsNullable,
|
||||
IsIncrement = column.IsIdentity,
|
||||
Create_by = genTable.Create_by,
|
||||
Create_time = DateTime.Now,
|
||||
IsInsert = !column.IsIdentity,//非自增字段都需要插入
|
||||
IsQuery = false,
|
||||
HtmlType = GenConstants.HTML_INPUT
|
||||
};
|
||||
|
||||
if (GenConstants.imageFiled.Any(f => column.DbColumnName.ToLower().Contains(f.ToLower())))
|
||||
{
|
||||
genTableColumn.HtmlType = GenConstants.HTML_IMAGE_UPLOAD;
|
||||
}
|
||||
else if (GenConstants.COLUMNTYPE_TIME.Any(f => genTableColumn.CsharpType.ToLower().Contains(f.ToLower())))
|
||||
{
|
||||
genTableColumn.HtmlType = GenConstants.HTML_DATETIME;
|
||||
}
|
||||
else if (GenConstants.radioFiled.Any(f => column.DbColumnName.EndsWith(f, StringComparison.OrdinalIgnoreCase)) ||
|
||||
GenConstants.radioFiled.Any(f => column.DbColumnName.StartsWith(f, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
genTableColumn.HtmlType = GenConstants.HTML_RADIO;
|
||||
}
|
||||
else if (GenConstants.selectFiled.Any(f => column.DbColumnName == f) ||
|
||||
GenConstants.selectFiled.Any(f => column.DbColumnName.EndsWith(f, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
genTableColumn.HtmlType = GenConstants.HTML_SELECT;
|
||||
}
|
||||
else if (column.Length > 500)
|
||||
{
|
||||
genTableColumn.HtmlType = GenConstants.HTML_TEXTAREA;
|
||||
}
|
||||
//编辑字段
|
||||
if (GenConstants.COLUMNNAME_NOT_EDIT.Any(f => column.DbColumnName.Contains(f)) && !column.IsIdentity && !column.IsPrimarykey)
|
||||
{
|
||||
genTableColumn.IsEdit = true;
|
||||
}
|
||||
//列表字段
|
||||
if (GenConstants.COLUMNNAME_NOT_LIST.Any(f => column.DbColumnName.Contains(f) && !column.IsPrimarykey))
|
||||
{
|
||||
genTableColumn.IsList = true;
|
||||
}
|
||||
|
||||
genTableColumns.Add(genTableColumn);
|
||||
}
|
||||
return genTableColumns;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ namespace ZR.CodeGenerator
|
||||
if (string.IsNullOrEmpty(dbName))
|
||||
{
|
||||
connStr = ConfigUtils.Instance.GetConnectionStrings(OptionsSetting.ConnAdmin);
|
||||
dbType = ConfigUtils.Instance.GetAppConfig<int>(OptionsSetting.DbType);
|
||||
dbType = ConfigUtils.Instance.GetAppConfig<int>(OptionsSetting.ConnDbType);
|
||||
}
|
||||
var db = new SqlSugarScope(new List<ConnectionConfig>()
|
||||
{
|
||||
|
||||
182
ZR.CodeGenerator/FileHelper.cs
Normal file
182
ZR.CodeGenerator/FileHelper.cs
Normal file
@ -0,0 +1,182 @@
|
||||
using ICSharpCode.SharpZipLib.Checksum;
|
||||
using ICSharpCode.SharpZipLib.Zip;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ZR.CodeGenerator
|
||||
{
|
||||
public class FileHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 制作压缩包(多个文件压缩到一个压缩包,支持加密、注释)
|
||||
/// </summary>
|
||||
/// <param name="fileNames">要压缩的文件</param>
|
||||
/// <param name="topDirectoryName">压缩文件目录</param>
|
||||
/// <param name="zipedFileName">压缩包文件名</param>
|
||||
/// <param name="compresssionLevel">压缩级别 1-9</param>
|
||||
/// <param name="password">密码</param>
|
||||
/// <param name="comment">注释</param>
|
||||
public static void ZipFiles(string[] fileNames, string topDirectoryName, string zipedFileName, int? compresssionLevel, string password = "", string comment = "")
|
||||
{
|
||||
using (ZipOutputStream zos = new ZipOutputStream(File.Open(zipedFileName, FileMode.OpenOrCreate)))
|
||||
{
|
||||
if (compresssionLevel.HasValue)
|
||||
{
|
||||
zos.SetLevel(compresssionLevel.Value);//设置压缩级别
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(password))
|
||||
{
|
||||
zos.Password = password;//设置zip包加密密码
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(comment))
|
||||
{
|
||||
zos.SetComment(comment);//设置zip包的注释
|
||||
}
|
||||
|
||||
foreach (string file in fileNames)
|
||||
{
|
||||
//string fileName = string.Format("{0}/{1}", topDirectoryName, file);
|
||||
string fileName = file;
|
||||
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
FileInfo item = new FileInfo(fileName);
|
||||
FileStream fs = File.OpenRead(item.FullName);
|
||||
byte[] buffer = new byte[fs.Length];
|
||||
fs.Read(buffer, 0, buffer.Length);
|
||||
|
||||
ZipEntry entry = new ZipEntry(item.Name);
|
||||
zos.PutNextEntry(entry);
|
||||
zos.Write(buffer, 0, buffer.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 压缩多层目录
|
||||
/// </summary>
|
||||
/// <param name="topDirectoryName">压缩文件目录</param>
|
||||
/// <param name="zipedFileName">压缩包文件名</param>
|
||||
/// <param name="compresssionLevel">压缩级别 1-9 </param>
|
||||
/// <param name="password">密码</param>
|
||||
/// <param name="comment">注释</param>
|
||||
/// <param name="filetype">文件类型</param>
|
||||
public static void ZipFileDirectory(string topDirectoryName, string zipedFileName, int compresssionLevel, string password, string comment, string filetype)
|
||||
{
|
||||
using (System.IO.FileStream ZipFile = File.Open(zipedFileName, FileMode.OpenOrCreate))
|
||||
{
|
||||
using (ZipOutputStream zos = new ZipOutputStream(ZipFile))
|
||||
{
|
||||
if (compresssionLevel != 0)
|
||||
{
|
||||
zos.SetLevel(compresssionLevel);//设置压缩级别
|
||||
}
|
||||
if (!string.IsNullOrEmpty(password))
|
||||
{
|
||||
zos.Password = password;//设置zip包加密密码
|
||||
}
|
||||
if (!string.IsNullOrEmpty(comment))
|
||||
{
|
||||
zos.SetComment(comment);//设置zip包的注释
|
||||
}
|
||||
ZipSetp(topDirectoryName, zos, "", filetype);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 递归遍历目录
|
||||
/// </summary>
|
||||
/// <param name="strDirectory">The directory.</param>
|
||||
/// <param name="s">The ZipOutputStream Object.</param>
|
||||
/// <param name="parentPath">The parent path.</param>
|
||||
private static void ZipSetp(string strDirectory, ZipOutputStream s, string parentPath, string filetype)
|
||||
{
|
||||
if (strDirectory[^1] != Path.DirectorySeparatorChar)
|
||||
{
|
||||
strDirectory += Path.DirectorySeparatorChar;
|
||||
}
|
||||
|
||||
Crc32 crc = new Crc32();
|
||||
|
||||
string[] filenames = Directory.GetFileSystemEntries(strDirectory, filetype);
|
||||
foreach (string file in filenames)// 遍历所有的文件和目录
|
||||
{
|
||||
if (Directory.Exists(file))// 先当作目录处理如果存在这个目录就递归Copy该目录下面的文件
|
||||
{
|
||||
string pPath = parentPath;
|
||||
pPath += file.Substring(file.LastIndexOf("\\") + 1);
|
||||
pPath += "\\";
|
||||
ZipSetp(file, s, pPath, filetype);
|
||||
}
|
||||
else // 否则直接压缩文件
|
||||
{
|
||||
//打开压缩文件
|
||||
using (FileStream fs = File.OpenRead(file))
|
||||
{
|
||||
byte[] buffer = new byte[fs.Length];
|
||||
fs.Read(buffer, 0, buffer.Length);
|
||||
string fileName = parentPath + file[(file.LastIndexOf("\\") + 1)..];
|
||||
ZipEntry entry = new ZipEntry(fileName);
|
||||
entry.DateTime = DateTime.Now;
|
||||
entry.Size = fs.Length;
|
||||
fs.Close();
|
||||
crc.Reset();
|
||||
crc.Update(buffer);
|
||||
entry.Crc = crc.Value;
|
||||
s.PutNextEntry(entry);
|
||||
s.Write(buffer, 0, buffer.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除指定目录下的所有文件及文件夹(保留目录)
|
||||
/// </summary>
|
||||
/// <param name="file">文件目录</param>
|
||||
public static void DeleteDirectory(string file)
|
||||
{
|
||||
try
|
||||
{
|
||||
//判断文件夹是否还存在
|
||||
if (Directory.Exists(file))
|
||||
{
|
||||
DirectoryInfo fileInfo = new DirectoryInfo(file);
|
||||
//去除文件夹的只读属性
|
||||
fileInfo.Attributes = FileAttributes.Normal & FileAttributes.Directory;
|
||||
foreach (string f in Directory.GetFileSystemEntries(file))
|
||||
{
|
||||
if (File.Exists(f))
|
||||
{
|
||||
//去除文件的只读属性
|
||||
File.SetAttributes(file, FileAttributes.Normal);
|
||||
//如果有子文件删除文件
|
||||
File.Delete(f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//循环递归删除子文件夹
|
||||
DeleteDirectory(f);
|
||||
}
|
||||
}
|
||||
//删除空文件夹
|
||||
Directory.Delete(file);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex) // 异常处理
|
||||
{
|
||||
//Log4NetHelper.Error("代码生成异常", ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace ZR.CodeGenerator
|
||||
{
|
||||
@ -17,6 +13,24 @@ namespace ZR.CodeGenerator
|
||||
public static string Gen_autoPre = "gen:autoPre";
|
||||
public static string Gen_tablePrefix = "gen:tablePrefix";
|
||||
|
||||
/// <summary>
|
||||
/// InputDto输入实体是不包含字段
|
||||
/// </summary>
|
||||
public static readonly string[] inputDtoNoField = new string[] { "createTime", "updateTime", "addtime" };
|
||||
/// <summary>
|
||||
/// 图片字段
|
||||
/// </summary>
|
||||
public static readonly string[] imageFiled = new string[] { "icon", "img", "image", "url", "pic", "photo", "avatar" };
|
||||
/// <summary>
|
||||
/// 下拉框字段
|
||||
/// </summary>
|
||||
public static readonly string[] selectFiled = new string[] { "status", "type", "state", "sex", "gender" };
|
||||
/// <summary>
|
||||
/// 单选按钮字段
|
||||
/// </summary>
|
||||
public static readonly string[] radioFiled = new string[] { "status", "state", "is"};
|
||||
|
||||
|
||||
/** 单表(增删改查) */
|
||||
public static string TPL_CRUD = "crud";
|
||||
|
||||
@ -55,14 +69,14 @@ namespace ZR.CodeGenerator
|
||||
"bit", "bigint", "float", "double", "decimal" };
|
||||
|
||||
/** 页面不需要编辑字段 */
|
||||
public static string[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
|
||||
public static string[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "delFlag" };
|
||||
|
||||
/** 页面不需要显示的列表字段 */
|
||||
public static string[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by",
|
||||
"update_time" };
|
||||
public static string[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "delFlag", "update_by",
|
||||
"update_time" , "password"};
|
||||
|
||||
/** 页面不需要查询字段 */
|
||||
public static string[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by",
|
||||
public static string[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "delFlag", "update_by",
|
||||
"update_time", "remark" };
|
||||
|
||||
/** Entity基类字段 */
|
||||
@ -102,17 +116,14 @@ namespace ZR.CodeGenerator
|
||||
public static string TYPE_STRING = "string";
|
||||
|
||||
/** 整型 */
|
||||
public static string TYPE_INTEGER = "Integer";
|
||||
public static string TYPE_INT = "int";
|
||||
|
||||
/** 长整型 */
|
||||
public static string TYPE_LONG = "Long";
|
||||
public static string TYPE_LONG = "long";
|
||||
|
||||
/** 浮点型 */
|
||||
public static string TYPE_DOUBLE = "Double";
|
||||
|
||||
/** 高精度计算类型 */
|
||||
public static string TYPE_BIGDECIMAL = "BigDecimal";
|
||||
|
||||
/** 时间类型 */
|
||||
public static string TYPE_DATE = "Date";
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ namespace ZR.CodeGenerator.Model
|
||||
/// <summary>
|
||||
/// 要删除表名的字符串用
|
||||
/// </summary>
|
||||
public string replaceTableNameStr { get; set; }
|
||||
//public string replaceTableNameStr { get; set; }
|
||||
/// <summary>
|
||||
/// 要生成的文件
|
||||
/// </summary>
|
||||
@ -34,5 +34,16 @@ namespace ZR.CodeGenerator.Model
|
||||
/// 如果目标文件存在,是否覆盖。默认为false
|
||||
/// </summary>
|
||||
public bool coverd { get; set; } = true;
|
||||
|
||||
#region 存储路径
|
||||
//public string ModelPath { get; set; }
|
||||
//public string ServicePath { get; set; }
|
||||
//public string RepositoryPath { get; set; }
|
||||
//public string ApiPath { get; set; }
|
||||
//public string VuePath { get; set; }
|
||||
//public string VueApiPath { get; set; }
|
||||
|
||||
public string ParentPath { get; set; } = "..";
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,5 +92,9 @@ namespace ZR.CodeGenerator.Model
|
||||
/// vue data内容
|
||||
/// </summary>
|
||||
public string VueDataContent { get; set; }
|
||||
/// <summary>
|
||||
/// vue mounted 方法
|
||||
/// </summary>
|
||||
public string MountedMethod { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,75 +45,33 @@ namespace ZR.CodeGenerator.CodeGenerator
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string GetPropertyDatatype(string sDatatype)
|
||||
/// <summary>
|
||||
/// 获取C# 类型
|
||||
/// </summary>
|
||||
/// <param name="sDatatype"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetCSharpDatatype(string sDatatype)
|
||||
{
|
||||
string sTempDatatype = string.Empty;
|
||||
sDatatype = sDatatype.ToLower();
|
||||
switch (sDatatype)
|
||||
string sTempDatatype = sDatatype switch
|
||||
{
|
||||
case "int":
|
||||
case "number":
|
||||
case "integer":
|
||||
case "smallint":
|
||||
sTempDatatype = "int";
|
||||
break;
|
||||
|
||||
case "bigint":
|
||||
sTempDatatype = "long";
|
||||
break;
|
||||
|
||||
case "tinyint":
|
||||
sTempDatatype = "byte";
|
||||
break;
|
||||
|
||||
case "numeric":
|
||||
case "real":
|
||||
sTempDatatype = "Single";
|
||||
break;
|
||||
|
||||
case "float":
|
||||
sTempDatatype = "float";
|
||||
break;
|
||||
|
||||
case "decimal":
|
||||
case "numer(8,2)":
|
||||
sTempDatatype = "decimal";
|
||||
break;
|
||||
|
||||
case "bit":
|
||||
sTempDatatype = "bool";
|
||||
break;
|
||||
|
||||
case "date":
|
||||
case "datetime":
|
||||
case "datetime2":
|
||||
case "smalldatetime":
|
||||
sTempDatatype = "DateTime";
|
||||
break;
|
||||
|
||||
case "money":
|
||||
case "smallmoney":
|
||||
sTempDatatype = "double";
|
||||
break;
|
||||
|
||||
case "char":
|
||||
case "varchar":
|
||||
case "nvarchar2":
|
||||
case "text":
|
||||
case "nchar":
|
||||
case "nvarchar":
|
||||
case "ntext":
|
||||
default:
|
||||
sTempDatatype = "string";
|
||||
break;
|
||||
}
|
||||
"int" or "number" or "integer" or "smallint" => "int",
|
||||
"bigint" => "long",
|
||||
"tinyint" => "byte",
|
||||
"numeric" or "real" or "float" => "float",
|
||||
"decimal" or "numer(8,2)" => "decimal",
|
||||
"bit" => "bool",
|
||||
"date" or "datetime" or "datetime2" or "smalldatetime" => "DateTime",
|
||||
"money" or "smallmoney" => "double",
|
||||
_ => "string",
|
||||
};
|
||||
return sTempDatatype;
|
||||
}
|
||||
|
||||
public static bool IsNumber(string tableDataType)
|
||||
{
|
||||
string[] arr = new string[] { "int", "long" };
|
||||
return arr.Any(f => f.Contains(GetPropertyDatatype(tableDataType)));
|
||||
return arr.Any(f => f.Contains(GetCSharpDatatype(tableDataType)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ namespace ZR.Repository.DbProvider
|
||||
{
|
||||
string connStr = ConfigUtils.Instance.GetConnectionStrings(OptionsSetting.ConnAdmin);
|
||||
string dbKey = ConfigUtils.Instance.GetAppConfig<string>(OptionsSetting.DbKey);
|
||||
string dbType = ConfigUtils.Instance.GetConnectionStrings(OptionsSetting.DbType);
|
||||
int dbType = ConfigUtils.Instance.GetAppConfig<int>(OptionsSetting.ConnDbType);
|
||||
if (!string.IsNullOrEmpty(dbKey))
|
||||
{
|
||||
connStr = NETCore.Encrypt.EncryptProvider.DESDecrypt(connStr, dbKey);
|
||||
@ -32,7 +32,7 @@ namespace ZR.Repository.DbProvider
|
||||
{
|
||||
new ConnectionConfig(){
|
||||
ConnectionString = connStr,
|
||||
DbType = (DbType)Convert.ToInt32(dbType),
|
||||
DbType = (DbType)dbType,
|
||||
IsAutoCloseConnection = true,//开启自动释放模式和EF原理一样
|
||||
InitKeyType = InitKeyType.Attribute,//从特性读取主键和自增列信息
|
||||
ConfigId = 0
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* 测试分页查询
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function listGendemo(data) {
|
||||
export function listGendemo(query) {
|
||||
return request({
|
||||
url: '/bus/Gendemo/list',
|
||||
url: 'bus/Gendemo/list',
|
||||
method: 'get',
|
||||
params: data,
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* 新增测试
|
||||
* @param data
|
||||
*/
|
||||
export function addGendemo(data) {
|
||||
@ -25,7 +25,7 @@ export function addGendemo(data) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* 修改测试
|
||||
* @param data
|
||||
*/
|
||||
export function updateGendemo(data) {
|
||||
@ -37,8 +37,8 @@ export function updateGendemo(data) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param {Id} Id
|
||||
* 获取测试详情
|
||||
* @param {Id} 测试Id
|
||||
*/
|
||||
export function getGendemo(id) {
|
||||
return request({
|
||||
|
||||
@ -42,11 +42,11 @@ export const constantRoutes = [
|
||||
component: (resolve) => require(['@/views/login'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
// {
|
||||
// path: '/demo',
|
||||
// component: (resolve) => require(['@/views/gift/index'], resolve),
|
||||
// hidden: true
|
||||
// },
|
||||
{
|
||||
path: '/demo',
|
||||
component: (resolve) => require(['@/views/userInfo/index'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: (resolve) => require(['@/views/error/404'], resolve),
|
||||
|
||||
@ -2,23 +2,10 @@
|
||||
<div class="app-container">
|
||||
<!-- :model属性用于表单验证使用 比如下面的el-form-item 的 prop属性用于对表单值进行验证操作 -->
|
||||
<el-form :model="queryParams" label-position="left" inline ref="queryForm" :label-width="labelWidth" v-show="showSearch" @submit.native.prevent>
|
||||
<el-form-item label="文本文字">
|
||||
<el-input v-model="queryParams.xxx" placeholder="" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数字">
|
||||
<el-input v-model.number="queryParams.xxx" placeholder="" />
|
||||
<el-form-item label="名称" :label-width="labelWidth">
|
||||
<el-input v-model="queryParams.name"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="下拉框">
|
||||
<el-select v-model="queryParams.xxx" placeholder="">
|
||||
<el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="时间范围">
|
||||
<el-date-picker size="small" style="width: 240px" v-model="timeRange" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-row class="mb8" style="text-align:center">
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@ -52,25 +39,23 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="showStatus" label="显示状态" align="center" width="100" />
|
||||
<el-table-column prop="addTime" label="添加时间" align="center" width="100" />
|
||||
<el-table-column prop="sex" label="用户性别" align="center" width="100" />
|
||||
<el-table-column prop="sort" label="排序" align="center" width="100" />
|
||||
|
||||
<el-table-column label="操作" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" v-hasPermi="['gendemo:update']" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @onConfirm="handleDelete(scope.row)" style="margin-left:10px">
|
||||
<el-popconfirm title="确定删除吗?" @confirm="handleDelete(scope.row)" style="margin-left:10px">
|
||||
<el-button slot="reference" v-hasPermi="['gendemo:delete']" size="mini" type="text" icon="el-icon-delete">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination class="mt10" background :total="total" :current-page.sync="queryParams.pageNum" layout="total, sizes, prev, pager, next, jumper" :page-size="queryParams.pageSize" :page-sizes="[20, 30, 50, 100]" @size-change="handleSizeChange"
|
||||
@current-change="getList" />
|
||||
<el-pagination class="mt10" background :total="total" :current-page.sync="queryParams.pageNum" :page-size="queryParams.pageSize" :page-sizes="[20, 30, 50, 100]" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" @current-change="getList" />
|
||||
|
||||
<!-- 添加或修改菜单对话框 -->
|
||||
<el-dialog :title="title" :lock-scroll="false" :visible.sync="open" >
|
||||
<el-form ref="form" :model="form" :rules="rules" :label-width="formLabelWidth">
|
||||
<el-form-item label="自增id" :label-width="labelWidth" prop="id">
|
||||
<el-input v-model="form.id" placeholder="" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" :label-width="labelWidth" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
@ -82,10 +67,14 @@
|
||||
<el-input v-model="form.icon" placeholder="请上传文件或手动输入文件地址"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="显示状态" :label-width="labelWidth" prop="showStatus">
|
||||
<el-input v-model="form.showStatus" placeholder="请输入显示状态" />
|
||||
<el-input v-model.number="form.showStatus" placeholder="请输入显示状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="添加时间" :label-width="labelWidth" prop="addTime">
|
||||
<el-date-picker v-model="form.addTime" type="datetime" placeholder="选择日期时间" default-time="12:00:00"> </el-date-picker>
|
||||
<el-form-item label="用户性别" :label-width="labelWidth" prop="sex">
|
||||
<el-select v-model="form.sex" > <el-option v-for="item in sexOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" :label-width="labelWidth" prop="sort">
|
||||
<el-input v-model.number="form.sort" placeholder="请输入排序" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
@ -103,11 +92,11 @@ import {
|
||||
addGendemo,
|
||||
delGendemo,
|
||||
updateGendemo,
|
||||
getGendemo,
|
||||
} from "@/api/gendemo.js";
|
||||
getGendemo
|
||||
} from '@/api/gendemo.js'
|
||||
|
||||
export default {
|
||||
name: "Gendemo",
|
||||
name: 'Gendemo',
|
||||
data() {
|
||||
return {
|
||||
labelWidth: "100px",
|
||||
@ -132,8 +121,8 @@ export default {
|
||||
form: {},
|
||||
// 时间范围数组
|
||||
timeRange: [],
|
||||
// xxx下拉框
|
||||
statusOptions: [],
|
||||
// 用户性别选项列表
|
||||
sexOptions: [],
|
||||
// 数据列表
|
||||
dataList: [],
|
||||
// 总记录数
|
||||
@ -142,10 +131,16 @@ export default {
|
||||
btnSubmitVisible: true,
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||
showStatus: [
|
||||
{ required: true, message: "请输入显示状态", trigger: "blur" },
|
||||
id: [
|
||||
{ type: 'number', message: 'id必须为数字值', trigger: "blur"},
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: "blur"},
|
||||
],
|
||||
showStatus: [
|
||||
{ required: true, message: '请输入显示状态', trigger: "blur"},
|
||||
],
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -161,14 +156,12 @@ export default {
|
||||
// 查询数据
|
||||
getList() {
|
||||
console.log(JSON.stringify(this.queryParams));
|
||||
listGendemo(this.addDateRange(this.queryParams, this.timeRange)).then(
|
||||
(res) => {
|
||||
listGendemo(this.addDateRange(this.queryParams, this.timeRange)).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.dataList = res.data.result;
|
||||
this.total = res.data.totalCount;
|
||||
}
|
||||
}
|
||||
);
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
@ -178,11 +171,12 @@ export default {
|
||||
// 重置数据表单
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
icon: undefined,
|
||||
showStatus: undefined,
|
||||
addTime: undefined,
|
||||
sex: undefined,
|
||||
sort: undefined,
|
||||
|
||||
//需个性化处理内容
|
||||
};
|
||||
@ -201,7 +195,7 @@ export default {
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length != 1;
|
||||
this.single = selection.length!=1
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 选择每页显示数量*/
|
||||
@ -245,14 +239,13 @@ export default {
|
||||
this.form.icon = URL.createObjectURL(file.raw);
|
||||
// this.$refs.upload.clearFiles();
|
||||
},
|
||||
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(JSON.stringify(this.form));
|
||||
|
||||
if (this.form.id != undefined || this.title === "修改数据") {
|
||||
if (this.form.id != undefined || this.title === '修改数据') {
|
||||
updateGendemo(this.form).then((res) => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
@ -274,6 +267,5 @@ export default {
|
||||
<style scoped>
|
||||
.table-td-thumb {
|
||||
width: 80px;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
71
ZRAdmin.xml
71
ZRAdmin.xml
@ -27,44 +27,44 @@
|
||||
<param name="data"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:ZR.Admin.WebApi.Controllers.GendemoController">
|
||||
<member name="T:ZR.Admin.WebApi.Controllers.UserInfoController">
|
||||
<summary>
|
||||
代码自动生成
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:ZR.Admin.WebApi.Controllers.GendemoController._GendemoService">
|
||||
<member name="F:ZR.Admin.WebApi.Controllers.UserInfoController._UserInfoService">
|
||||
<summary>
|
||||
测试接口
|
||||
用户信息接口
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.GendemoController.QueryGendemo(ZR.Model.Dto.GendemoQueryDto)">
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.UserInfoController.QueryUserInfo(ZR.Model.Dto.UserInfoQueryDto)">
|
||||
<summary>
|
||||
查询测试列表
|
||||
查询用户信息列表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.GendemoController.GetGendemo(System.Int32)">
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.UserInfoController.GetUserInfo(System.Int32)">
|
||||
<summary>
|
||||
查询测试详情
|
||||
查询用户信息详情
|
||||
</summary>
|
||||
<param name="Id"></param>
|
||||
<param name="Luid"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.GendemoController.AddGendemo(ZR.Model.Dto.GendemoDto)">
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.UserInfoController.AddUserInfo(ZR.Model.Dto.UserInfoDto)">
|
||||
<summary>
|
||||
添加测试
|
||||
添加用户信息
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.GendemoController.UpdateGendemo(ZR.Model.Dto.GendemoDto)">
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.UserInfoController.UpdateUserInfo(ZR.Model.Dto.UserInfoDto)">
|
||||
<summary>
|
||||
更新测试
|
||||
更新用户信息
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.GendemoController.DeleteGendemo(System.Int32)">
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.UserInfoController.DeleteUserInfo(System.String)">
|
||||
<summary>
|
||||
删除测试
|
||||
删除用户信息
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
@ -127,7 +127,7 @@
|
||||
</member>
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.CodeGeneratorController.EditSave(ZR.Model.System.Dto.GenTableDto)">
|
||||
<summary>
|
||||
代码生成保存
|
||||
修改保存代码生成业务
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
@ -792,47 +792,6 @@
|
||||
<param name="formFile"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:ZR.Admin.WebApi.Controllers.SysFile1Controller">
|
||||
<summary>
|
||||
T4代码自动生成
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:ZR.Admin.WebApi.Controllers.SysFile1Controller._SysFileService">
|
||||
<summary>
|
||||
文件管理接口
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.SysFile1Controller.Query(ZR.Model.System.Dto.SysFileQueryDto)">
|
||||
<summary>
|
||||
查询文件管理列表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.SysFile1Controller.Get(System.String)">
|
||||
<summary>
|
||||
查询文件管理详情
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.SysFile1Controller.Create(ZR.Model.System.SysFile)">
|
||||
<summary>
|
||||
添加文件管理
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.SysFile1Controller.Update(ZR.Model.System.SysFile)">
|
||||
<summary>
|
||||
更新文件管理
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:ZR.Admin.WebApi.Controllers.SysFile1Controller.Delete(System.Int32)">
|
||||
<summary>
|
||||
删除文件管理
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:ZR.Admin.WebApi.Extensions.HttpContextExtension">
|
||||
<summary>
|
||||
HttpContext扩展类
|
||||
|
||||
@ -253,13 +253,15 @@ INSERT INTO sys_menu VALUES (108, '日志管理', 1, 9, 'log', '', 0, 0, 'M', '0
|
||||
INSERT INTO sys_menu VALUES (105, '字典管理', 1, 5, 'dict', 'system/dict/index', 0, 0, 'C', '0', '0', 'system:dict:list', 'dict', '', SYSDATE(), '', NULL, '');
|
||||
INSERT INTO sys_menu VALUES (106, '分配用户', 1, 3, 'roleusers', 'system/roleusers/index', 0, 0, 'C', '0', '0', 'system:role:list', 'people', '', SYSDATE(), '', NULL, NULL);
|
||||
|
||||
-- 一级菜单 缓存监控
|
||||
INSERT INTO sys_menu VALUES (113, '缓存监控', 2, 5, 'cache', 'monitor/cache/index', 0, 0, 'C', '1', '1', 'monitor:cache:list', 'redis', '', SYSDATE(), '', NULL, '缓存监控菜单');
|
||||
|
||||
-- 一级菜单 系统工具
|
||||
INSERT INTO sys_menu VALUES (114, '表单构建', 3, 1, 'build', 'tool/build/index', 0, 0, 'C', '0', '0', 'tool:build:list', 'build', '', SYSDATE(), '', NULL, '表单构建菜单');
|
||||
INSERT INTO sys_menu VALUES (115, '代码生成', 3, 1, 'gen', 'tool/gen/index', 0, 0, 'C', '0', '0', 'tool:gen:list', 'code', '', SYSDATE(), '', NULL, '代码生成菜单');
|
||||
INSERT INTO sys_menu VALUES (116, '系统接口', 3, 3, 'swagger', 'tool/swagger/index', 0, 0, 'C', '0', '0', 'tool:swagger:list', 'swagger', '', SYSDATE(), '', NULL, '系统接口菜单');
|
||||
INSERT INTO sys_menu VALUES (117, '编辑表格', 3, 3, 'editTable', 'tool/gen/editTable', 0, 0, 'C', '1', '0', 'tool:gen:edittable', '', '', SYSDATE(), '', NULL, '代码生成编辑表格菜单');
|
||||
|
||||
-- 一级菜单 缓存监控
|
||||
INSERT INTO sys_menu VALUES (113, '缓存监控', 2, 5, 'cache', 'monitor/cache/index', 0, 0, 'C', '1', '1', 'monitor:cache:list', 'redis', '', SYSDATE(), '', NULL, '缓存监控菜单');
|
||||
|
||||
-- 日志管理
|
||||
INSERT INTO sys_menu VALUES (500, '操作日志', 108, 1, 'operlog', 'monitor/operlog/index', 0, 0, 'C', '0', '0', 'monitor:operlog:list', 'form', '', SYSDATE(), '', NULL, '操作日志菜单');
|
||||
@ -633,30 +635,32 @@ create table gen_table (
|
||||
-- 19、代码生成业务表字段
|
||||
-- ----------------------------
|
||||
drop table if exists gen_table_column;
|
||||
create table gen_table_column (
|
||||
columnId bigint(20) not null auto_increment comment '编号',
|
||||
tableId varchar(64) comment '归属表编号',
|
||||
tableName varchar(20) comment '表名',
|
||||
columnName varchar(200) comment '列名称',
|
||||
columnComment varchar(500) comment '列描述',
|
||||
columnType varchar(100) comment '列类型',
|
||||
csharpType varchar(500) comment 'JAVA类型',
|
||||
csharpField varchar(200) comment 'JAVA字段名',
|
||||
isPk char(1) comment '是否主键(1是)',
|
||||
isIncrement char(1) comment '是否自增(1是)',
|
||||
isRequired char(1) comment '是否必填(1是)',
|
||||
isInsert char(1) comment '是否为插入字段(1是)',
|
||||
isEdit char(1) comment '是否编辑字段(1是)',
|
||||
isList char(1) comment '是否列表字段(1是)',
|
||||
isQuery char(1) comment '是否查询字段(1是)',
|
||||
queryType varchar(200) default 'EQ' comment '查询方式(等于、不等于、大于、小于、范围)',
|
||||
htmlType varchar(200) comment '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)',
|
||||
dictType varchar(200) default '' comment '字典类型',
|
||||
sort int comment '排序',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime comment '更新时间',
|
||||
remark varchar(200),
|
||||
primary key (column_id)
|
||||
) engine=innodb auto_increment=1 comment = '代码生成业务表字段';
|
||||
CREATE TABLE `gen_table_column` (
|
||||
`columnId` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||
`tableName` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表名',
|
||||
`tableId` bigint(20) NULL DEFAULT NULL COMMENT '归属表编号',
|
||||
`columnName` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列名称',
|
||||
`columnComment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列描述',
|
||||
`columnType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '列类型',
|
||||
`csharpType` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'C#类型',
|
||||
`csharpField` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'C#字段名',
|
||||
`isPk` tinyint(1) NULL DEFAULT NULL COMMENT '是否主键(1是)',
|
||||
`isIncrement` tinyint(1) NULL DEFAULT NULL COMMENT '是否自增(1是)',
|
||||
`isRequired` tinyint(1) NULL DEFAULT NULL COMMENT '是否必填(1是)',
|
||||
`isInsert` tinyint(1) NULL DEFAULT NULL COMMENT '是否为插入字段(1是)',
|
||||
`isEdit` tinyint(1) NULL DEFAULT NULL COMMENT '是否编辑字段(1是)',
|
||||
`isList` tinyint(1) NULL DEFAULT NULL COMMENT '是否列表字段(1是)',
|
||||
`isQuery` tinyint(4) NULL DEFAULT NULL COMMENT '是否查询字段(1是)',
|
||||
`queryType` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'EQ' COMMENT '查询方式(等于、不等于、大于、小于、范围)',
|
||||
`htmlType` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)',
|
||||
`dictType` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '字典类型',
|
||||
`sort` int(11) NULL DEFAULT NULL COMMENT '排序',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`columnId`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 63 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代码生成业务表字段' ROW_FORMAT = Dynamic;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user