feat: 代码生成工具5分钟完成参数设置
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Yi.Framework.Template.Abstract
|
||||
|
||||
public ModelTemplateProvider(string modelName, string entityName, string nameSpaces) : base(modelName, entityName, nameSpaces)
|
||||
{
|
||||
AddIgnoreEntityField(/*"Id", */"TenantId", "IsDeleted", "LastModifierId", "LastModificationTime","OrderNum");
|
||||
AddIgnoreEntityField(/*"Id", */"TenantId", "IsDeleted", "LastModifierId", "LastModificationTime", "CreatorId");
|
||||
}
|
||||
|
||||
private string entityPath=string.Empty;
|
||||
|
||||
@@ -17,10 +17,12 @@ TemplateFactory templateFactory = new();
|
||||
//string modelName = "Identity";
|
||||
//string nameSpaces = "Yi.RBAC";
|
||||
//List<string> entityNames = new() { "_" };
|
||||
string modelName = "Dictionary";
|
||||
//string modelName = "Dictionary";
|
||||
//string nameSpaces = "Yi.RBAC";
|
||||
//List<string> entityNames = new() { "_", "_" };
|
||||
string modelName = "Setting";
|
||||
string nameSpaces = "Yi.RBAC";
|
||||
List<string> entityNames = new() { "_", "_" };
|
||||
|
||||
List<string> entityNames = new() { "_" };
|
||||
|
||||
|
||||
foreach (var entityName in entityNames)
|
||||
|
||||
@@ -74,5 +74,15 @@
|
||||
User服务抽象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Contracts.Setting.Dtos.ConfigCreateInputVo">
|
||||
<summary>
|
||||
Config输入创建对象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Contracts.Setting.IConfigService">
|
||||
<summary>
|
||||
Config服务抽象
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Setting.Dtos
|
||||
{
|
||||
/// <summary>
|
||||
/// Config输入创建对象
|
||||
/// </summary>
|
||||
public class ConfigCreateInputVo
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string ConfigName { get; set; } = string.Empty;
|
||||
public string ConfigKey { get; set; } = string.Empty;
|
||||
public string ConfigValue { get; set; } = string.Empty;
|
||||
public string? ConfigType { get; set; }
|
||||
public int OrderNum { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Setting.Dtos
|
||||
{
|
||||
public class ConfigGetListInputVo : PagedAndSortedResultRequestDto
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string ConfigName { get; set; } = string.Empty;
|
||||
public string ConfigKey { get; set; } = string.Empty;
|
||||
public string ConfigValue { get; set; } = string.Empty;
|
||||
public string? ConfigType { get; set; }
|
||||
public int OrderNum { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Setting.Dtos
|
||||
{
|
||||
public class ConfigGetListOutputDto : IEntityDto<long>
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string ConfigName { get; set; } = string.Empty;
|
||||
public string ConfigKey { get; set; } = string.Empty;
|
||||
public string ConfigValue { get; set; } = string.Empty;
|
||||
public string? ConfigType { get; set; }
|
||||
public int OrderNum { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Setting.Dtos
|
||||
{
|
||||
public class ConfigGetOutputDto : IEntityDto<long>
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string ConfigName { get; set; } = string.Empty;
|
||||
public string ConfigKey { get; set; } = string.Empty;
|
||||
public string ConfigValue { get; set; } = string.Empty;
|
||||
public string? ConfigType { get; set; }
|
||||
public int OrderNum { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Setting.Dtos
|
||||
{
|
||||
public class ConfigUpdateInputVo
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string ConfigName { get; set; } = string.Empty;
|
||||
public string ConfigKey { get; set; } = string.Empty;
|
||||
public string ConfigValue { get; set; } = string.Empty;
|
||||
public string? ConfigType { get; set; }
|
||||
public int OrderNum { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
public DateTime CreationTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.RBAC.Application.Contracts.Setting.Dtos;
|
||||
using Yi.Framework.Ddd.Services.Abstract;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Setting
|
||||
{
|
||||
/// <summary>
|
||||
/// Config服务抽象
|
||||
/// </summary>
|
||||
public interface IConfigService : ICrudAppService<ConfigGetOutputDto, ConfigGetListOutputDto, long, ConfigGetListInputVo, ConfigCreateInputVo, ConfigUpdateInputVo>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -163,5 +163,10 @@
|
||||
<param name="input"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Application.Setting.ConfigService">
|
||||
<summary>
|
||||
Config服务实现
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using Yi.RBAC.Application.Contracts.Setting;
|
||||
using NET.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Setting.Dtos;
|
||||
using Yi.RBAC.Domain.Setting.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
|
||||
namespace Yi.RBAC.Application.Setting
|
||||
{
|
||||
/// <summary>
|
||||
/// Config服务实现
|
||||
/// </summary>
|
||||
[AppService]
|
||||
public class ConfigService : CrudAppService<ConfigEntity, ConfigGetOutputDto, ConfigGetListOutputDto, long, ConfigGetListInputVo, ConfigCreateInputVo, ConfigUpdateInputVo>,
|
||||
IConfigService, IAutoApiService
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.RBAC.Domain.Shared.Setting.ConstClasses
|
||||
{
|
||||
/// <summary>
|
||||
/// 常量定义
|
||||
/// </summary>
|
||||
|
||||
public class ConfigConst
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -711,5 +711,40 @@
|
||||
<param name="postIds"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:Yi.RBAC.Domain.Setting.Entities.ConfigEntity">
|
||||
<summary>
|
||||
配置表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Domain.Setting.Entities.ConfigEntity.ConfigName">
|
||||
<summary>
|
||||
配置名称
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Domain.Setting.Entities.ConfigEntity.ConfigKey">
|
||||
<summary>
|
||||
配置键
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Domain.Setting.Entities.ConfigEntity.ConfigValue">
|
||||
<summary>
|
||||
配置值
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Domain.Setting.Entities.ConfigEntity.ConfigType">
|
||||
<summary>
|
||||
配置类别
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Domain.Setting.Entities.ConfigEntity.OrderNum">
|
||||
<summary>
|
||||
排序字段
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Yi.RBAC.Domain.Setting.Entities.ConfigEntity.Remark">
|
||||
<summary>
|
||||
描述
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Data.Auditing;
|
||||
using Yi.Framework.Data.Entities;
|
||||
using Yi.Framework.Ddd.Entities;
|
||||
|
||||
namespace Yi.RBAC.Domain.Setting.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 配置表
|
||||
/// </summary>
|
||||
[SugarTable("Config")]
|
||||
public class ConfigEntity : IEntity<long>, IAuditedObject, IOrderNum, ISoftDelete
|
||||
{
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 配置名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ConfigName")]
|
||||
public string ConfigName { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 配置键
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ConfigKey")]
|
||||
public string ConfigKey { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 配置值
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ConfigValue")]
|
||||
public string ConfigValue { get; set; } = string.Empty;
|
||||
/// <summary>
|
||||
/// 配置类别
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ConfigType")]
|
||||
public string? ConfigType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
public DateTime CreationTime { get; set; }
|
||||
|
||||
public long? CreatorId { get; set; }
|
||||
|
||||
public long? LastModifierId { get; set; }
|
||||
|
||||
public DateTime? LastModificationTime { get; set; }
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
// 查询参数列表
|
||||
export function listConfig(query) {
|
||||
return request({
|
||||
url: '/config/pageList',
|
||||
url: '/config',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@@ -12,7 +12,7 @@ export function listConfig(query) {
|
||||
// 查询参数详细
|
||||
export function getConfig(configId) {
|
||||
return request({
|
||||
url: '/config/getById/' + configId,
|
||||
url: '/config/' + configId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -28,7 +28,7 @@ export function getConfigKey(configKey) {
|
||||
// 新增参数配置
|
||||
export function addConfig(data) {
|
||||
return request({
|
||||
url: '/config/add',
|
||||
url: '/config',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -37,7 +37,7 @@ export function addConfig(data) {
|
||||
// 修改参数配置
|
||||
export function updateConfig(data) {
|
||||
return request({
|
||||
url: '/config/update',
|
||||
url: `/config/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@@ -45,15 +45,9 @@ export function updateConfig(data) {
|
||||
|
||||
// 删除参数配置
|
||||
export function delConfig(configId) {
|
||||
|
||||
if("string"==typeof(configId))
|
||||
{
|
||||
configId=[configId];
|
||||
}
|
||||
return request({
|
||||
url: '/config/delList',
|
||||
method: 'delete',
|
||||
data:configId
|
||||
url: `/config/${configId}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -108,9 +108,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<el-table-column label="创建时间" align="center" prop="creationTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
<span>{{ parseTime(scope.row.creationTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
|
||||
@@ -213,7 +213,7 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listConfig(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
|
||||
configList.value = response.data.data;
|
||||
configList.value = response.data.items;
|
||||
total.value = response.data.total;
|
||||
loading.value = false;
|
||||
});
|
||||
@@ -232,7 +232,7 @@ function reset() {
|
||||
configValue: undefined,
|
||||
configType: "Y",
|
||||
remark: undefined,
|
||||
isDeleted: false
|
||||
state: true
|
||||
};
|
||||
proxy.resetForm("configRef");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user