修改活动管理

development
温天培 11 months ago
parent 48dd3de120
commit 1984a9c1b8

@ -2,6 +2,8 @@
using SqlSugar;
using System.ComponentModel;
using GDZZ.Core.Entity;
using GDZZ.Application.Enum;
namespace GDZZ.Application.Entity
{
/// <summary>
@ -26,6 +28,6 @@ namespace GDZZ.Application.Entity
/// <summary>
/// 活动类型
/// </summary>
public int Type { get; set; }
public BannerEnum Type { get; set; }
}
}

@ -0,0 +1,23 @@
using System;
using SqlSugar;
using System.ComponentModel;
using GDZZ.Core.Entity;
namespace GDZZ.Application.Entity
{
/// <summary>
/// 业务配置表
/// </summary>
[SugarTable("mini_service_config")]
[Description("业务配置表")]
public class ServiceConfig : DEntityBase
{
/// <summary>
/// 配置名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 配置值
/// </summary>
public string Value { get; set; }
}
}

@ -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
{
/// <summary>
/// 活动类型
/// </summary>
public enum BannerEnum
{
/// <summary>
/// 轮播
/// </summary>
[Description("轮播类型")] CAROUSEL = 0,
/// <summary>
/// 待审核
/// </summary>
[Description("待审核")] HEAD = 1,
}
}

@ -714,6 +714,21 @@
职业名称
</summary>
</member>
<member name="T:GDZZ.Application.Entity.ServiceConfig">
<summary>
业务配置表
</summary>
</member>
<member name="P:GDZZ.Application.Entity.ServiceConfig.Name">
<summary>
配置名称
</summary>
</member>
<member name="P:GDZZ.Application.Entity.ServiceConfig.Value">
<summary>
配置值
</summary>
</member>
<member name="T:GDZZ.Application.Entity.SysRegion">
<summary>
地区表
@ -769,6 +784,31 @@
求职联系费用
</summary>
</member>
<member name="T:GDZZ.Application.Enum.BannerEnum">
<summary>
活动类型
</summary>
</member>
<member name="F:GDZZ.Application.Enum.BannerEnum.CAROUSEL">
<summary>
轮播
</summary>
</member>
<member name="F:GDZZ.Application.Enum.BannerEnum.HEAD">
<summary>
待审核
</summary>
</member>
<member name="F:GDZZ.Application.Enum.ResumeTypeEnum.Hot">
<summary>
热招
</summary>
</member>
<member name="F:GDZZ.Application.Enum.ResumeTypeEnum.Common">
<summary>
普招0
</summary>
</member>
<member name="F:GDZZ.Application.CompanyEnum.Pending">
<summary>
待审核
@ -889,16 +929,6 @@
审核未通过
</summary>
</member>
<member name="F:GDZZ.Application.Enum.ResumeTypeEnum.Hot">
<summary>
热招
</summary>
</member>
<member name="F:GDZZ.Application.Enum.ResumeTypeEnum.Common">
<summary>
普招0
</summary>
</member>
<member name="T:GDZZ.Application.SystemConst">
<summary>
redis枚举配置
@ -2975,9 +3005,9 @@
活动广告列表输入参数
</summary>
</member>
<member name="P:GDZZ.Application.MiniBannerInput.Url">
<member name="P:GDZZ.Application.MiniBannerInput.Name">
<summary>
广告图片
活动名字
</summary>
</member>
<member name="P:GDZZ.Application.MiniBannerInput.Skip">
@ -2990,7 +3020,7 @@
活动类型
</summary>
</member>
<member name="P:GDZZ.Application.AddMiniBannerInput.Url">
<member name="P:GDZZ.Application.MiniBannerInput.Url">
<summary>
广告图片
</summary>
@ -3652,6 +3682,118 @@
<param name="sysOrg"></param>
<returns></returns>
</member>
<member name="T:GDZZ.Application.ServiceConfigDto">
<summary>
业务配置输出参数
</summary>
</member>
<member name="P:GDZZ.Application.ServiceConfigDto.Id">
<summary>
主键Id
</summary>
</member>
<member name="P:GDZZ.Application.ServiceConfigDto.Name">
<summary>
配置名称
</summary>
</member>
<member name="P:GDZZ.Application.ServiceConfigDto.Value">
<summary>
配置值
</summary>
</member>
<member name="T:GDZZ.Application.ServiceConfigInput">
<summary>
业务配置输入参数
</summary>
</member>
<member name="P:GDZZ.Application.ServiceConfigInput.Name">
<summary>
配置名称
</summary>
</member>
<member name="P:GDZZ.Application.ServiceConfigInput.Value">
<summary>
配置值
</summary>
</member>
<member name="P:GDZZ.Application.DeleteServiceConfigInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="P:GDZZ.Application.UpdateServiceConfigInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="T:GDZZ.Application.ServiceConfigOutput">
<summary>
业务配置输出参数
</summary>
</member>
<member name="P:GDZZ.Application.ServiceConfigOutput.Id">
<summary>
主键Id
</summary>
</member>
<member name="P:GDZZ.Application.ServiceConfigOutput.Name">
<summary>
配置名称
</summary>
</member>
<member name="P:GDZZ.Application.ServiceConfigOutput.Value">
<summary>
配置值
</summary>
</member>
<member name="T:GDZZ.Application.ServiceConfigService">
<summary>
业务配置服务
</summary>
</member>
<member name="M:GDZZ.Application.ServiceConfigService.Page(GDZZ.Application.ServiceConfigInput)">
<summary>
分页查询业务配置
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:GDZZ.Application.ServiceConfigService.Add(GDZZ.Application.AddServiceConfigInput)">
<summary>
增加业务配置
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:GDZZ.Application.ServiceConfigService.Delete(GDZZ.Application.DeleteServiceConfigInput)">
<summary>
删除业务配置
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:GDZZ.Application.ServiceConfigService.Update(GDZZ.Application.UpdateServiceConfigInput)">
<summary>
更新业务配置
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:GDZZ.Application.ServiceConfigService.Get(GDZZ.Application.QueryeServiceConfigInput)">
<summary>
获取业务配置
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:GDZZ.Application.ServiceConfigService.List(GDZZ.Application.ServiceConfigInput)">
<summary>
获取业务配置列表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:GDZZ.Application.SysRegionDto">
<summary>
地区表输出参数

@ -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
{
/// <summary>
/// 广告图片
/// 活动名字
/// </summary>
public virtual string Url { get; set; }
public string Name { get; set; }
/// <summary>
/// 跳转链接
@ -22,18 +24,19 @@ namespace GDZZ.Application
/// <summary>
/// 活动类型
/// </summary>
public int Type { get; set; }
public BannerEnum Type { get; set; }
/// <summary>
/// 广告图片
/// </summary>
public virtual string Url { get; set; }
}
public class AddMiniBannerInput : MiniBannerInput
{
/// <summary>
/// 广告图片
/// </summary>
[Required(ErrorMessage = "广告图片不能为空")]
public override string Url { get; set; }
}

@ -0,0 +1,27 @@
using System;
using GDZZ.Core;
namespace GDZZ.Application
{
/// <summary>
/// 业务配置输出参数
/// </summary>
public class ServiceConfigDto
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 配置名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 配置值
/// </summary>
public string Value { get; set; }
}
}

@ -0,0 +1,52 @@
using GDZZ.Core;
using System;
using System.ComponentModel.DataAnnotations;
namespace GDZZ.Application
{
/// <summary>
/// 业务配置输入参数
/// </summary>
public class ServiceConfigInput : PageInputBase
{
/// <summary>
/// 配置名称
/// </summary>
public virtual string Name { get; set; }
/// <summary>
/// 配置值
/// </summary>
public virtual string Value { get; set; }
}
public class AddServiceConfigInput : ServiceConfigInput
{
}
public class DeleteServiceConfigInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
public class UpdateServiceConfigInput : ServiceConfigInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
public class QueryeServiceConfigInput : DeleteServiceConfigInput
{
}
}

@ -0,0 +1,26 @@
using System;
namespace GDZZ.Application
{
/// <summary>
/// 业务配置输出参数
/// </summary>
public class ServiceConfigOutput
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 配置名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 配置值
/// </summary>
public string Value { get; set; }
}
}

@ -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<ServiceConfig> Get([FromQuery] QueryeServiceConfigInput input);
Task<dynamic> List([FromQuery] ServiceConfigInput input);
Task<dynamic> Page([FromQuery] ServiceConfigInput input);
Task Update(UpdateServiceConfigInput input);
}
}

@ -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
{
/// <summary>
/// 业务配置服务
/// </summary>
[ApiDescriptionSettings("Application",Name = "ServiceConfig", Order = 1)]
public class ServiceConfigService : IServiceConfigService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<ServiceConfig> _rep;
public ServiceConfigService(SqlSugarRepository<ServiceConfig> rep)
{
_rep = rep;
}
/// <summary>
/// 分页查询业务配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/ServiceConfig/page")]
public async Task<dynamic> 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();
}
/// <summary>
/// 增加业务配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/ServiceConfig/add")]
public async Task Add(AddServiceConfigInput input)
{
var entity = input.Adapt<ServiceConfig>();
await _rep.InsertAsync(entity);
}
/// <summary>
/// 删除业务配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/ServiceConfig/delete")]
public async Task Delete(DeleteServiceConfigInput input)
{
var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
await _rep.DeleteAsync(entity);
}
/// <summary>
/// 更新业务配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/ServiceConfig/edit")]
public async Task Update(UpdateServiceConfigInput input)
{
var entity = input.Adapt<ServiceConfig>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns:true).ExecuteCommandAsync();
}
/// <summary>
/// 获取业务配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/ServiceConfig/detail")]
public async Task<ServiceConfig> Get([FromQuery] QueryeServiceConfigInput input)
{
return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
}
/// <summary>
/// 获取业务配置列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/ServiceConfig/list")]
public async Task<dynamic> List([FromQuery] ServiceConfigInput input)
{
return await _rep.ToListAsync();
}
}
}
Loading…
Cancel
Save