diff --git a/ZR.Admin.WebApi/Controllers/business/GendemoController.cs b/ZR.Admin.WebApi/Controllers/business/GendemoController.cs deleted file mode 100644 index 6cb7021..0000000 --- a/ZR.Admin.WebApi/Controllers/business/GendemoController.cs +++ /dev/null @@ -1,138 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using ZR.Admin.WebApi.Filters; -using ZR.Admin.WebApi.Controllers; -using ZR.Service.Business; -using SqlSugar; -using Infrastructure; -using Infrastructure.Attribute; -using Infrastructure.Enums; -using Infrastructure.Model; -using Mapster; -using ZR.Admin.WebApi.Extensions; -using ZR.Model.Dto; -using ZR.Model.Models; - -namespace ZRAdmin.Controllers -{ - /// - /// 代码自动生成 - /// - - //[Verify] - [Route("bus/gendemo")] - public class GendemoController : BaseController - { - /// - /// 接口 - /// - private readonly IGendemoService _GendemoService; - - public GendemoController(IGendemoService GendemoService) - { - _GendemoService = GendemoService; - } - - /// - /// 查询列表 - /// - /// - [HttpGet("list")] - [ActionPermissionFilter(Permission = "gendemo:list")] - public IActionResult Query([FromQuery] GendemoQueryDto parm) - { - //开始拼装查询条件 - var predicate = Expressionable.Create(); - - //TODO 搜索条件 - //predicate = predicate.And(m => m.Name.Contains(parm.Name)); - - var response = _GendemoService.GetPages(predicate.ToExpression(), parm); - - return SUCCESS(response); - } - - /// - /// 查询详情 - /// - /// - /// - [HttpGet("{Id}")] - [ActionPermissionFilter(Permission = "gendemo:query")] - public IActionResult Get(int Id) - { - var response = _GendemoService.GetId(Id); - - return SUCCESS(response); - } - - /// - /// 添加 - /// - /// - [HttpPost] - [ActionPermissionFilter(Permission = "gendemo:add")] - [Log(Title = "添加", BusinessType = BusinessType.INSERT)] - public IActionResult Create([FromBody] GendemoDto parm) - { - if (parm == null) - { - throw new CustomException("请求参数错误"); - } - //从 Dto 映射到 实体 - var addModel = parm.Adapt().ToCreate(); - //addModel.CreateID = User.Identity.Name; - - return SUCCESS(_GendemoService.Add(addModel)); - } - - /// - /// 更新 - /// - /// - [HttpPut] - [ActionPermissionFilter(Permission = "gendemo:update")] - [Log(Title = "修改", BusinessType = BusinessType.UPDATE)] - public IActionResult Update([FromBody] GendemoDto parm) - { - if (parm == null) - { - throw new CustomException("请求实体不能为空"); - } - //从 Dto 映射到 实体 - var updateModel = parm.Adapt().ToCreate(); - //updateModel.CreateID = User.Identity.Name; - - var response = _GendemoService.Update(w => w.Id == updateModel.Id, it => new Gendemo() - { - //TODO 字段映射 - Name = parm.Name, - Icon = parm.Icon, - ShowStatus = parm.ShowStatus, - AddTime = parm.AddTime, - - }); - - return SUCCESS(response); - } - - /// - /// 删除 - /// - /// - [HttpDelete("{Id}")] - [ActionPermissionFilter(Permission = "gendemo:delete")] - [Log(Title = "删除", BusinessType = BusinessType.DELETE)] - public IActionResult Delete(int Id = 0) - { - if (Id <= 0) { return OutputJson(ApiResult.Error($"删除失败Id 不能为空")); } - - // 删除 - var response = _GendemoService.Delete(Id); - - return SUCCESS(response); - } - } -} \ No newline at end of file diff --git a/ZR.Admin.WebApi/Template/RepositoryTemplate.txt b/ZR.Admin.WebApi/Template/RepositoryTemplate.txt index df6fa3d..e39f922 100644 --- a/ZR.Admin.WebApi/Template/RepositoryTemplate.txt +++ b/ZR.Admin.WebApi/Template/RepositoryTemplate.txt @@ -6,6 +6,7 @@ using {ModelsNamespace}.Models; namespace {RepositoriesNamespace} { /// + /// 代码生成器生成 /// {TableNameDesc}仓储接口的实现 /// [AppService(ServiceLifetime = LifeTime.Transient)] diff --git a/ZR.Admin.WebApi/Template/ServiceTemplate.txt b/ZR.Admin.WebApi/Template/ServiceTemplate.txt index 75058b6..1c88cf6 100644 --- a/ZR.Admin.WebApi/Template/ServiceTemplate.txt +++ b/ZR.Admin.WebApi/Template/ServiceTemplate.txt @@ -14,7 +14,7 @@ using {ServicesNamespace}.IService; namespace {ServicesNamespace}.Business { /// - /// {TableNameDesc}服务接口实现 + /// 代码生成器生成 /// [AppService(ServiceType = typeof(I{ModelTypeName}Service), ServiceLifetime = LifeTime.Transient)] public class {ModelTypeName}Service: BaseService<{ModelTypeName}>, I{ModelTypeName}Service @@ -24,5 +24,9 @@ namespace {ServicesNamespace}.Business { _repository = repository; } + + #region 业务逻辑代码 + + #endregion } } \ No newline at end of file diff --git a/ZR.Admin.WebApi/appsettings.Development.json b/ZR.Admin.WebApi/appsettings.Development.json index 8d3a082..61f44c9 100644 --- a/ZR.Admin.WebApi/appsettings.Development.json +++ b/ZR.Admin.WebApi/appsettings.Development.json @@ -8,7 +8,7 @@ }, "ConnectionStrings": { "Conn_Admin": "server=127.0.0.1;user=zr;pwd=abc;database=admin", - "ConnDynamic": "server=127.0.0.1;user=zr;pwd=abc;database={database}"//˽ + "ConnDynamic": "server=127.0.0.1;user=zr;pwd=abc;database={database}"//ʹ }, "urls": "http://localhost:8888", //url "sysConfig": { diff --git a/ZR.Model/Dto/GendemoDto.cs b/ZR.Model/Dto/GendemoDto.cs deleted file mode 100644 index 2ccaf55..0000000 --- a/ZR.Model/Dto/GendemoDto.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using ZR.Model.Dto; -using ZR.Model.Models; - -namespace ZR.Model.Dto -{ - /// - /// 输入对象模型 - /// - public class GendemoDto - { - public int? Id { get; set; } - public string Name { get; set; } - public string Icon { get; set; } - public int? ShowStatus { get; set; } - public DateTime? AddTime { get; set; } - - } - - public class GendemoQueryDto: PagerInfo - { - public DateTime? BeginTime { get; set; } - public DateTime? EndTime { get; set; } - } -} diff --git a/ZR.Model/Models/Gendemo.cs b/ZR.Model/Models/Gendemo.cs deleted file mode 100644 index 41c4327..0000000 --- a/ZR.Model/Models/Gendemo.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace ZR.Model.Models -{ - /// - /// ,数据实体对象 - /// - [SqlSugar.SugarTable("gen_demo")] - public class Gendemo - { - /// - /// 描述 :自增id - /// 空值 :False - /// 默认 : - /// - [SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)] - public int? Id { get; set; } - /// - /// 描述 :名称 - /// 空值 :False - /// 默认 : - /// - public string Name { get; set; } - /// - /// 描述 :图片 - /// 空值 :True - /// 默认 : - /// - public string Icon { get; set; } - /// - /// 描述 :显示状态 - /// 空值 :False - /// 默认 : - /// - public int? ShowStatus { get; set; } - /// - /// 描述 :添加时间 - /// 空值 :True - /// 默认 : - /// - public DateTime? AddTime { get; set; } - - } -} diff --git a/ZR.Repository/Repositories/GendemoRepository.cs b/ZR.Repository/Repositories/GendemoRepository.cs deleted file mode 100644 index c443c7f..0000000 --- a/ZR.Repository/Repositories/GendemoRepository.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using Infrastructure.Attribute; -using ZR.Repository.System; -using ZR.Model.Models; - -namespace ZR.Repository -{ - /// - /// 仓储接口的实现 - /// - [AppService(ServiceLifetime = LifeTime.Transient)] - public class GendemoRepository : BaseRepository - { - public GendemoRepository() - { - } - - #region 业务逻辑代码 - - - - #endregion - } -} \ No newline at end of file diff --git a/ZR.Repository/System/SysUserRepository.cs b/ZR.Repository/System/SysUserRepository.cs index 03ab81c..754edcd 100644 --- a/ZR.Repository/System/SysUserRepository.cs +++ b/ZR.Repository/System/SysUserRepository.cs @@ -29,7 +29,7 @@ namespace ZR.Repository.System .WhereIF(!string.IsNullOrEmpty(user.UserName), it => it.UserName.Contains(user.UserName)) .WhereIF(!string.IsNullOrEmpty(user.Status), it => it.Status == user.Status) .WhereIF(user.BeginTime != DateTime.MinValue && user.BeginTime != null, it => it.Create_time >= user.BeginTime) - .WhereIF(user.EndTime != DateTime.MinValue && user.BeginTime != null, it => it.EndTime <= user.EndTime) + .WhereIF(user.EndTime != DateTime.MinValue && user.BeginTime != null, it => it.Create_time <= user.EndTime) .WhereIF(user.DeptId != 0, it => it.DeptId == user.DeptId) .OrderBy(it => it.UserId) .ToPageList(pager.PageNum, pager.PageSize, ref totalCount); diff --git a/ZR.Service/Business/GendemoService.cs b/ZR.Service/Business/GendemoService.cs deleted file mode 100644 index a4cc21c..0000000 --- a/ZR.Service/Business/GendemoService.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Infrastructure; -using Infrastructure.Attribute; -using Infrastructure.Extensions; -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using ZR.Common; -using ZR.Model.Models; -using ZR.Repository; -using ZR.Service.IService; - -namespace ZR.Service.Business -{ - /// - /// 服务接口实现 - /// - [AppService(ServiceType = typeof(IGendemoService), ServiceLifetime = LifeTime.Transient)] - public class GendemoService: BaseService, IGendemoService - { - private readonly GendemoRepository _repository; - public GendemoService(GendemoRepository repository) - { - _repository = repository; - } - } -} \ No newline at end of file diff --git a/ZR.Service/Business/IBusService/IGendemoService.cs b/ZR.Service/Business/IBusService/IGendemoService.cs deleted file mode 100644 index 0e4cb5e..0000000 --- a/ZR.Service/Business/IBusService/IGendemoService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using ZR.Model.Models; - -namespace ZR.Service.Business -{ - /// - /// 定义服务接口 - /// - public interface IGendemoService: IBaseService - { - } -} diff --git a/ZR.Vue/src/main.js b/ZR.Vue/src/main.js index 912ad47..94685d3 100644 --- a/ZR.Vue/src/main.js +++ b/ZR.Vue/src/main.js @@ -2,11 +2,9 @@ import Vue from 'vue' import Cookies from 'js-cookie' -import 'normalize.css/normalize.css' // a modern alternative to CSS resets - import Element from 'element-ui' -import './assets/styles/element-variables.scss' - +import 'normalize.css/normalize.css' // a modern alternative to CSS resets +import '@/assets/styles/element-variables.scss' import '@/assets/styles/index.scss' // global css import App from './App' @@ -62,7 +60,7 @@ Vue.use(permission) */ Vue.use(Element, { - size: Cookies.get('size') || 'mini' // set element-ui default size + size: Cookies.get('size') || 'medium' // set element-ui default size }) Vue.config.productionTip = false diff --git a/ZR.Vue/src/router/index.js b/ZR.Vue/src/router/index.js index 3dd9d34..d0fd641 100644 --- a/ZR.Vue/src/router/index.js +++ b/ZR.Vue/src/router/index.js @@ -44,7 +44,7 @@ export const constantRoutes = [ }, { path: '/demo', - component: (resolve) => require(['@/views/gendemo/index'], resolve), + component: (resolve) => require(['@/views/demo'], resolve), hidden: true }, { diff --git a/ZR.Vue/src/views/article/manager.vue b/ZR.Vue/src/views/system/article/manager.vue similarity index 100% rename from ZR.Vue/src/views/article/manager.vue rename to ZR.Vue/src/views/system/article/manager.vue diff --git a/ZR.Vue/src/views/article/publish.vue b/ZR.Vue/src/views/system/article/publish.vue similarity index 100% rename from ZR.Vue/src/views/article/publish.vue rename to ZR.Vue/src/views/system/article/publish.vue diff --git a/ZRAdmin.xml b/ZRAdmin.xml index f8b63ac..fe02fe5 100644 --- a/ZRAdmin.xml +++ b/ZRAdmin.xml @@ -920,46 +920,5 @@ - - - 代码自动生成 - - - - - 接口 - - - - - 查询列表 - - - - - - 查询详情 - - - - - - - 添加 - - - - - - 更新 - - - - - - 删除 - - - diff --git a/document/admin-sqlserver.sql b/document/admin-sqlserver.sql index a23c834..8e8ea90 100644 Binary files a/document/admin-sqlserver.sql and b/document/admin-sqlserver.sql differ diff --git a/document/mysql_admin.sql b/document/mysql_admin.sql index 3a8a97e..7fb68a8 100644 --- a/document/mysql_admin.sql +++ b/document/mysql_admin.sql @@ -315,8 +315,8 @@ INSERT INTO sys_menu VALUES (2052, '删除', 105, 3, '#', NULL, 0, 0, 'F', '0', INSERT INTO sys_menu VALUES (2054, '用户修改', 100, 3, '#', NULL, 0, 0, 'F', '0', '0', 'system:user:edit', '', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (2056, '创建文章', 5, 999, 'publish', 'article/publish', 0, 0, 'C', '1', '0', 'system:article:publish', 'log', '', SYSDATE(), '', NULL, NULL); -INSERT INTO sys_menu VALUES (2057, '文章列表', 5, 999, 'manager', 'article/manager', 0, 0, 'C', '0', '0', 'system:article:list', 'documentation', '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (2056, '创建文章', 5, 999, 'publish', 'system/article/publish', 0, 0, 'C', '1', '0', 'system:article:publish', 'log', '', SYSDATE(), '', NULL, NULL); +INSERT INTO sys_menu VALUES (2057, '文章列表', 5, 999, 'manager', 'system/article/manager', 0, 0, 'C', '0', '0', 'system:article:list', 'documentation', '', SYSDATE(), '', NULL, NULL); INSERT INTO sys_menu VALUES (2060, '任务日志', 2, 2, '/job/log', 'monitor/job/log', 0, 0, 'C', '0', '0', NULL, 'log', '', SYSDATE(), '', NULL, NULL); INSERT INTO sys_menu VALUES (2062, '新增', 2057, 1, '#', NULL, 0, 0, 'F', '0', '0', 'system:article:add', '', '', SYSDATE(), '', NULL, NULL); INSERT INTO sys_menu VALUES (2063, '修改', 2057, 2, '#', NULL, 0, 0, 'F', '0', '0', 'system:article:update', '', '', SYSDATE(), '', NULL, NULL);