From 1984a9c1b8787ba79ed768f64a1108d929cc5a2b Mon Sep 17 00:00:00 2001
From: wtp <1813748440@qq.com>
Date: Mon, 18 Dec 2023 18:01:36 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BB=E5=8A=A8=E7=AE=A1?=
=?UTF-8?q?=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
GDZZ.Application/Entity/MiniBanner.cs | 4 +-
GDZZ.Application/Entity/ServiceConfig.cs | 23 +++
GDZZ.Application/Enum/BannerEnum.cs | 25 +++
GDZZ.Application/GDZZ.Application.xml | 168 ++++++++++++++++--
.../Service/MiniBanner/Dto/MiniBannerInput.cs | 23 +--
.../ServiceConfig/Dto/ServiceConfigDto.cs | 27 +++
.../ServiceConfig/Dto/ServiceConfigInput.cs | 52 ++++++
.../ServiceConfig/Dto/ServiceConfigOutput.cs | 26 +++
.../ServiceConfig/IServiceConfigService.cs | 16 ++
.../ServiceConfig/ServiceConfigService.cs | 98 ++++++++++
10 files changed, 438 insertions(+), 24 deletions(-)
create mode 100644 GDZZ.Application/Entity/ServiceConfig.cs
create mode 100644 GDZZ.Application/Enum/BannerEnum.cs
create mode 100644 GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigDto.cs
create mode 100644 GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigInput.cs
create mode 100644 GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigOutput.cs
create mode 100644 GDZZ.Application/Service/ServiceConfig/IServiceConfigService.cs
create mode 100644 GDZZ.Application/Service/ServiceConfig/ServiceConfigService.cs
diff --git a/GDZZ.Application/Entity/MiniBanner.cs b/GDZZ.Application/Entity/MiniBanner.cs
index d8c7b0a..e1a3586 100644
--- a/GDZZ.Application/Entity/MiniBanner.cs
+++ b/GDZZ.Application/Entity/MiniBanner.cs
@@ -2,6 +2,8 @@
using SqlSugar;
using System.ComponentModel;
using GDZZ.Core.Entity;
+using GDZZ.Application.Enum;
+
namespace GDZZ.Application.Entity
{
///
@@ -26,6 +28,6 @@ namespace GDZZ.Application.Entity
///
/// 活动类型
///
- public int Type { get; set; }
+ public BannerEnum Type { get; set; }
}
}
\ No newline at end of file
diff --git a/GDZZ.Application/Entity/ServiceConfig.cs b/GDZZ.Application/Entity/ServiceConfig.cs
new file mode 100644
index 0000000..12c4ab5
--- /dev/null
+++ b/GDZZ.Application/Entity/ServiceConfig.cs
@@ -0,0 +1,23 @@
+using System;
+using SqlSugar;
+using System.ComponentModel;
+using GDZZ.Core.Entity;
+namespace GDZZ.Application.Entity
+{
+ ///
+ /// 业务配置表
+ ///
+ [SugarTable("mini_service_config")]
+ [Description("业务配置表")]
+ public class ServiceConfig : DEntityBase
+ {
+ ///
+ /// 配置名称
+ ///
+ public string Name { get; set; }
+ ///
+ /// 配置值
+ ///
+ public string Value { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/GDZZ.Application/Enum/BannerEnum.cs b/GDZZ.Application/Enum/BannerEnum.cs
new file mode 100644
index 0000000..de52293
--- /dev/null
+++ b/GDZZ.Application/Enum/BannerEnum.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GDZZ.Application.Enum
+{
+ ///
+ /// 活动类型
+ ///
+ public enum BannerEnum
+ {
+ ///
+ /// 轮播
+ ///
+ [Description("轮播类型")] CAROUSEL = 0,
+ ///
+ /// 待审核
+ ///
+ [Description("待审核")] HEAD = 1,
+
+ }
+}
diff --git a/GDZZ.Application/GDZZ.Application.xml b/GDZZ.Application/GDZZ.Application.xml
index 1892311..c99ed70 100644
--- a/GDZZ.Application/GDZZ.Application.xml
+++ b/GDZZ.Application/GDZZ.Application.xml
@@ -714,6 +714,21 @@
职业名称
+
+
+ 业务配置表
+
+
+
+
+ 配置名称
+
+
+
+
+ 配置值
+
+
地区表
@@ -769,6 +784,31 @@
求职联系费用
+
+
+ 活动类型
+
+
+
+
+ 轮播
+
+
+
+
+ 待审核
+
+
+
+
+ 热招
+
+
+
+
+ 普招0
+
+
待审核
@@ -889,16 +929,6 @@
审核未通过
-
-
- 热招
-
-
-
-
- 普招0
-
-
redis枚举配置
@@ -2975,9 +3005,9 @@
活动广告列表输入参数
-
+
- 广告图片
+ 活动名字
@@ -2990,7 +3020,7 @@
活动类型
-
+
广告图片
@@ -3652,6 +3682,118 @@
+
+
+ 业务配置输出参数
+
+
+
+
+ 主键Id
+
+
+
+
+ 配置名称
+
+
+
+
+ 配置值
+
+
+
+
+ 业务配置输入参数
+
+
+
+
+ 配置名称
+
+
+
+
+ 配置值
+
+
+
+
+ 主键Id
+
+
+
+
+ 主键Id
+
+
+
+
+ 业务配置输出参数
+
+
+
+
+ 主键Id
+
+
+
+
+ 配置名称
+
+
+
+
+ 配置值
+
+
+
+
+ 业务配置服务
+
+
+
+
+ 分页查询业务配置
+
+
+
+
+
+
+ 增加业务配置
+
+
+
+
+
+
+ 删除业务配置
+
+
+
+
+
+
+ 更新业务配置
+
+
+
+
+
+
+ 获取业务配置
+
+
+
+
+
+
+ 获取业务配置列表
+
+
+
+
地区表输出参数
diff --git a/GDZZ.Application/Service/MiniBanner/Dto/MiniBannerInput.cs b/GDZZ.Application/Service/MiniBanner/Dto/MiniBannerInput.cs
index 3b6bec3..544d074 100644
--- a/GDZZ.Application/Service/MiniBanner/Dto/MiniBannerInput.cs
+++ b/GDZZ.Application/Service/MiniBanner/Dto/MiniBannerInput.cs
@@ -1,4 +1,5 @@
-using GDZZ.Core;
+using GDZZ.Application.Enum;
+using GDZZ.Core;
using System;
using System.ComponentModel.DataAnnotations;
@@ -10,9 +11,10 @@ namespace GDZZ.Application
public class MiniBannerInput : PageInputBase
{
///
- /// 广告图片
+ /// 活动名字
///
- public virtual string Url { get; set; }
+ public string Name { get; set; }
+
///
/// 跳转链接
@@ -22,18 +24,19 @@ namespace GDZZ.Application
///
/// 活动类型
///
- public int Type { get; set; }
+ public BannerEnum Type { get; set; }
+
+ ///
+ /// 广告图片
+ ///
+ public virtual string Url { get; set; }
+
-
}
public class AddMiniBannerInput : MiniBannerInput
{
- ///
- /// 广告图片
- ///
- [Required(ErrorMessage = "广告图片不能为空")]
- public override string Url { get; set; }
+
}
diff --git a/GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigDto.cs b/GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigDto.cs
new file mode 100644
index 0000000..1f66671
--- /dev/null
+++ b/GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigDto.cs
@@ -0,0 +1,27 @@
+using System;
+using GDZZ.Core;
+
+namespace GDZZ.Application
+{
+ ///
+ /// 业务配置输出参数
+ ///
+ public class ServiceConfigDto
+ {
+ ///
+ /// 主键Id
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// 配置名称
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 配置值
+ ///
+ public string Value { get; set; }
+
+ }
+}
diff --git a/GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigInput.cs b/GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigInput.cs
new file mode 100644
index 0000000..373322d
--- /dev/null
+++ b/GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigInput.cs
@@ -0,0 +1,52 @@
+using GDZZ.Core;
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace GDZZ.Application
+{
+ ///
+ /// 业务配置输入参数
+ ///
+ public class ServiceConfigInput : PageInputBase
+ {
+ ///
+ /// 配置名称
+ ///
+ public virtual string Name { get; set; }
+
+ ///
+ /// 配置值
+ ///
+ public virtual string Value { get; set; }
+
+ }
+
+ public class AddServiceConfigInput : ServiceConfigInput
+ {
+ }
+
+ public class DeleteServiceConfigInput
+ {
+ ///
+ /// 主键Id
+ ///
+ [Required(ErrorMessage = "主键Id不能为空")]
+ public long Id { get; set; }
+
+ }
+
+ public class UpdateServiceConfigInput : ServiceConfigInput
+ {
+ ///
+ /// 主键Id
+ ///
+ [Required(ErrorMessage = "主键Id不能为空")]
+ public long Id { get; set; }
+
+ }
+
+ public class QueryeServiceConfigInput : DeleteServiceConfigInput
+ {
+
+ }
+}
diff --git a/GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigOutput.cs b/GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigOutput.cs
new file mode 100644
index 0000000..dd0fc65
--- /dev/null
+++ b/GDZZ.Application/Service/ServiceConfig/Dto/ServiceConfigOutput.cs
@@ -0,0 +1,26 @@
+using System;
+
+namespace GDZZ.Application
+{
+ ///
+ /// 业务配置输出参数
+ ///
+ public class ServiceConfigOutput
+ {
+ ///
+ /// 主键Id
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// 配置名称
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 配置值
+ ///
+ public string Value { get; set; }
+
+ }
+}
diff --git a/GDZZ.Application/Service/ServiceConfig/IServiceConfigService.cs b/GDZZ.Application/Service/ServiceConfig/IServiceConfigService.cs
new file mode 100644
index 0000000..b48af17
--- /dev/null
+++ b/GDZZ.Application/Service/ServiceConfig/IServiceConfigService.cs
@@ -0,0 +1,16 @@
+using GDZZ.Core;
+using Microsoft.AspNetCore.Mvc;
+using System.Threading.Tasks;
+using GDZZ.Application.Entity;
+namespace GDZZ.Application
+{
+ public interface IServiceConfigService
+ {
+ Task Add(AddServiceConfigInput input);
+ Task Delete(DeleteServiceConfigInput input);
+ Task Get([FromQuery] QueryeServiceConfigInput input);
+ Task List([FromQuery] ServiceConfigInput input);
+ Task Page([FromQuery] ServiceConfigInput input);
+ Task Update(UpdateServiceConfigInput input);
+ }
+}
\ No newline at end of file
diff --git a/GDZZ.Application/Service/ServiceConfig/ServiceConfigService.cs b/GDZZ.Application/Service/ServiceConfig/ServiceConfigService.cs
new file mode 100644
index 0000000..e517778
--- /dev/null
+++ b/GDZZ.Application/Service/ServiceConfig/ServiceConfigService.cs
@@ -0,0 +1,98 @@
+using GDZZ.Core;
+using Furion.DependencyInjection;
+using Furion.DynamicApiController;
+using Mapster;
+using Microsoft.AspNetCore.Mvc;
+using SqlSugar;
+using System.Linq;
+using System.Threading.Tasks;
+using GDZZ.Application.Entity;
+namespace GDZZ.Application
+{
+ ///
+ /// 业务配置服务
+ ///
+ [ApiDescriptionSettings("Application",Name = "ServiceConfig", Order = 1)]
+ public class ServiceConfigService : IServiceConfigService, IDynamicApiController, ITransient
+ {
+ private readonly SqlSugarRepository _rep;
+
+ public ServiceConfigService(SqlSugarRepository rep)
+ {
+ _rep = rep;
+ }
+
+ ///
+ /// 分页查询业务配置
+ ///
+ ///
+ ///
+ [HttpGet("/ServiceConfig/page")]
+ public async Task Page([FromQuery] ServiceConfigInput input)
+ {
+ var entities = await _rep.AsQueryable()
+ .WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name == input.Name)
+ .WhereIF(!string.IsNullOrWhiteSpace(input.Value), u => u.Value == input.Value)
+ .ToPagedListAsync(input.PageNo, input.PageSize);
+ return entities.XnPagedResult();
+ }
+
+ ///
+ /// 增加业务配置
+ ///
+ ///
+ ///
+ [HttpPost("/ServiceConfig/add")]
+ public async Task Add(AddServiceConfigInput input)
+ {
+ var entity = input.Adapt();
+ await _rep.InsertAsync(entity);
+ }
+
+ ///
+ /// 删除业务配置
+ ///
+ ///
+ ///
+ [HttpPost("/ServiceConfig/delete")]
+ public async Task Delete(DeleteServiceConfigInput input)
+ {
+ var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
+ await _rep.DeleteAsync(entity);
+ }
+
+ ///
+ /// 更新业务配置
+ ///
+ ///
+ ///
+ [HttpPost("/ServiceConfig/edit")]
+ public async Task Update(UpdateServiceConfigInput input)
+ {
+ var entity = input.Adapt();
+ await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns:true).ExecuteCommandAsync();
+ }
+
+ ///
+ /// 获取业务配置
+ ///
+ ///
+ ///
+ [HttpGet("/ServiceConfig/detail")]
+ public async Task Get([FromQuery] QueryeServiceConfigInput input)
+ {
+ return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
+ }
+
+ ///
+ /// 获取业务配置列表
+ ///
+ ///
+ ///
+ [HttpGet("/ServiceConfig/list")]
+ public async Task List([FromQuery] ServiceConfigInput input)
+ {
+ return await _rep.ToListAsync();
+ }
+ }
+}