feat 添加公告接口
This commit is contained in:
parent
60c86292bb
commit
d030dc0e72
20
ARW.Model/Dto/Api/Advertisement/Notices/NoticeApiDto.cs
Normal file
20
ARW.Model/Dto/Api/Advertisement/Notices/NoticeApiDto.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using ARW.Model.Models.Business.Advertisement.Notices;
|
||||
|
||||
namespace ARW.Model.Dto.Api.Advertisement.Notices
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 公告查询对象Api
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
public class NoticeQueryDtoApi : PagerInfo
|
||||
{
|
||||
public string NoticeTitle { get; set; }
|
||||
}
|
||||
|
||||
}
|
54
ARW.Model/Dto/Business/Advertisement/Notices/NoticeDto.cs
Normal file
54
ARW.Model/Dto/Business/Advertisement/Notices/NoticeDto.cs
Normal file
@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using ARW.Model.Models.Business.Advertisement.Notices;
|
||||
|
||||
namespace ARW.Model.Dto.Business.Advertisement.Notices
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告输入对象
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
public class NoticeDto
|
||||
{
|
||||
|
||||
public int NoticeId { get; set; }
|
||||
|
||||
public long NoticeGuid { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "标题不能为空")]
|
||||
public string NoticeTitle { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "内容不能为空")]
|
||||
public string NoticeContent { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "排序不能为空")]
|
||||
public int NoticeSort { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 公告查询对象
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
public class NoticeQueryDto : PagerInfo
|
||||
{
|
||||
|
||||
public string NoticeTitle { get; set; }
|
||||
|
||||
public string ids { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
65
ARW.Model/Models/Business/Advertisement/Notices/Notice.cs
Normal file
65
ARW.Model/Models/Business/Advertisement/Notices/Notice.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ARW.Model.Models.Business.Advertisement.Notices
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告,数据实体对象
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
[SugarTable("tb_notice")]
|
||||
public class Notice : BusinessBase
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "notice_id")]
|
||||
public int NoticeId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "notice_guid")]
|
||||
public long NoticeGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :标题
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "notice_title")]
|
||||
public string NoticeTitle { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :内容
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "notice_content")]
|
||||
public string NoticeContent { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :排序
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "notice_sort")]
|
||||
public int NoticeSort { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
65
ARW.Model/Vo/Api/Advertisement/Notices/NoticeApiVo.cs
Normal file
65
ARW.Model/Vo/Api/Advertisement/Notices/NoticeApiVo.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using Newtonsoft.Json;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ARW.Model.Vo.Api.Advertisement.Notices
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告展示对象Api
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
public class NoticeVoApi
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// </summary>
|
||||
public int NoticeId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long NoticeGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :标题
|
||||
/// </summary>
|
||||
public string NoticeTitle { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :内容
|
||||
/// </summary>
|
||||
public string NoticeContent { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :排序
|
||||
/// </summary>
|
||||
public int NoticeSort { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 公告详情展示对象Api
|
||||
/// </summary>
|
||||
public class NoticeApiDetailsVo
|
||||
{
|
||||
public int NoticeId { get; set; }
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long NoticeGuid { get; set; }
|
||||
public string NoticeTitle { get; set; }
|
||||
public string NoticeContent { get; set; }
|
||||
public int NoticeSort { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
49
ARW.Model/Vo/Business/Advertisement/Notices/NoticeVo.cs
Normal file
49
ARW.Model/Vo/Business/Advertisement/Notices/NoticeVo.cs
Normal file
@ -0,0 +1,49 @@
|
||||
using Newtonsoft.Json;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ARW.Model.Vo.Business.Advertisement.Notices
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告展示对象
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
public class NoticeVo
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// </summary>
|
||||
public int NoticeId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long NoticeGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :标题
|
||||
/// </summary>
|
||||
public string NoticeTitle { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :内容
|
||||
/// </summary>
|
||||
public string NoticeContent { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :排序
|
||||
/// </summary>
|
||||
public int NoticeSort { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Infrastructure.Attribute;
|
||||
using ARW.Repository.System;
|
||||
using ARW.Model.Models.Business.Advertisement.Notices;
|
||||
|
||||
namespace ARW.Repository.Business.Advertisement.Notices
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告仓储
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
[AppService(ServiceLifetime = LifeTime.Transient)]
|
||||
public class NoticeRepository : BaseRepository<Notice>
|
||||
{
|
||||
#region 业务逻辑代码
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ARW.Model;
|
||||
using ARW.Repository;
|
||||
using ARW.Repository.Business.Advertisement.Notices;
|
||||
using ARW.Service.Api.IBusinessService.Advertisement.Notices;
|
||||
using ARW.Model.Dto.Api.Advertisement.Notices;
|
||||
using ARW.Model.Models.Business.Advertisement.Notices;
|
||||
using ARW.Model.Vo.Api.Advertisement.Notices;
|
||||
|
||||
namespace ARW.Service.Api.BusinessService.Advertisement.Notices
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告接口实现类Api
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(INoticeServiceApi), ServiceLifetime = LifeTime.Transient)]
|
||||
public class NoticeServiceImplApi : BaseService<Notice>, INoticeServiceApi
|
||||
{
|
||||
private readonly NoticeRepository _NoticeRepository;
|
||||
|
||||
public NoticeServiceImplApi(NoticeRepository NoticeRepository)
|
||||
{
|
||||
this._NoticeRepository = NoticeRepository;
|
||||
}
|
||||
|
||||
#region Api接口代码
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询公告列表(Api)
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<NoticeVoApi>> GetNoticeListApi(NoticeQueryDtoApi parm)
|
||||
{
|
||||
//开始拼装查询条件d
|
||||
var predicate = Expressionable.Create<Notice>();
|
||||
|
||||
var query = _NoticeRepository
|
||||
.Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.OrderBy(s => s.NoticeSort, OrderByType.Asc)
|
||||
.Select(s => new NoticeVoApi
|
||||
{
|
||||
NoticeId = s.NoticeId,
|
||||
NoticeGuid = s.NoticeGuid,
|
||||
NoticeTitle = s.NoticeTitle,
|
||||
NoticeContent = s.NoticeContent,
|
||||
NoticeSort = s.NoticeSort,
|
||||
});
|
||||
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ARW.Model;
|
||||
using ARW.Model.Dto.Api.Advertisement.Notices;
|
||||
using ARW.Model.Models.Business.Advertisement.Notices;
|
||||
using ARW.Model.Vo.Api.Advertisement.Notices;
|
||||
|
||||
namespace ARW.Service.Api.IBusinessService.Advertisement.Notices
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告接口类Api
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
public interface INoticeServiceApi : IBaseService<Notice>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取公告分页列表(Api)
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<NoticeVoApi>> GetNoticeListApi(NoticeQueryDtoApi parm);
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Infrastructure;
|
||||
using ARW.Model;
|
||||
using ARW.Repository;
|
||||
using ARW.Repository.Business.Advertisement.Notices;
|
||||
using ARW.Service.Business.IBusinessService.Advertisement.Notices;
|
||||
using ARW.Model.Dto.Business.Advertisement.Notices;
|
||||
using ARW.Model.Models.Business.Advertisement.Notices;
|
||||
using ARW.Model.Vo.Business.Advertisement.Notices;
|
||||
|
||||
namespace ARW.Service.Business.BusinessService.Advertisement.Notices
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告接口实现类
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(INoticeService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class NoticeServiceImpl : BaseService<Notice>, INoticeService
|
||||
{
|
||||
private readonly NoticeRepository _NoticeRepository;
|
||||
|
||||
public NoticeServiceImpl(NoticeRepository NoticeRepository)
|
||||
{
|
||||
this._NoticeRepository = NoticeRepository;
|
||||
}
|
||||
|
||||
#region 业务逻辑代码
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询公告分页列表
|
||||
/// </summary>
|
||||
public async Task<PagedInfo<NoticeVo>> GetNoticeList(NoticeQueryDto parm)
|
||||
{
|
||||
//开始拼装查询条件d
|
||||
var predicate = Expressionable.Create<Notice>();
|
||||
|
||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.NoticeTitle), s => s.NoticeTitle.Contains(parm.NoticeTitle));
|
||||
var query = _NoticeRepository
|
||||
.Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.OrderBy(s => s.NoticeSort,OrderByType.Asc)
|
||||
.Select(s => new NoticeVo
|
||||
{
|
||||
NoticeId = s.NoticeId,
|
||||
NoticeGuid = s.NoticeGuid,
|
||||
NoticeTitle = s.NoticeTitle,
|
||||
NoticeContent = s.NoticeContent,
|
||||
NoticeSort = s.NoticeSort,
|
||||
});
|
||||
|
||||
|
||||
return await query.ToPageAsync(parm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加或修改公告
|
||||
/// </summary>
|
||||
public async Task<string> AddOrUpdateNotice(Notice model)
|
||||
{
|
||||
if (model.NoticeId != 0)
|
||||
{
|
||||
var response = await _NoticeRepository.UpdateAsync(model);
|
||||
return "修改成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var response = await _NoticeRepository.InsertReturnSnowflakeIdAsync(model);
|
||||
return "添加成功!";
|
||||
}
|
||||
}
|
||||
|
||||
#region Excel处理
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ARW.Model;
|
||||
using ARW.Model.Dto.Business.Advertisement.Notices;
|
||||
using ARW.Model.Models.Business.Advertisement.Notices;
|
||||
using ARW.Model.Vo.Business.Advertisement.Notices;
|
||||
|
||||
namespace ARW.Service.Business.IBusinessService.Advertisement.Notices
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告接口类
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
public interface INoticeService : IBaseService<Notice>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取公告分页列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
Task<PagedInfo<NoticeVo>> GetNoticeList(NoticeQueryDto parm);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加或修改公告
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
Task<string> AddOrUpdateNotice(Notice parm);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
using Infrastructure;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Enums;
|
||||
using Infrastructure.Model;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ARW.Admin.WebApi.Extensions;
|
||||
using ARW.Admin.WebApi.Filters;
|
||||
using ARW.Common;
|
||||
using ARW.Admin.WebApi.Controllers;
|
||||
using ARW.Model.Dto.Api.Advertisement.Notices;
|
||||
using ARW.Service.Api.IBusinessService.Advertisement.Notices;
|
||||
using ARW.Model.Models.Business.Advertisement.Notices;
|
||||
using ARW.Model.Vo.Api.Advertisement.Notices;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Geocoding;
|
||||
|
||||
namespace ARW.WebApi.Controllers.Api.Advertisement.Notices
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告控制器Api
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
//[Verify]
|
||||
[Route("api/[controller]")]
|
||||
public class NoticeApiController : BaseController
|
||||
{
|
||||
private readonly INoticeServiceApi _NoticeServiceApi;
|
||||
|
||||
/// <summary>
|
||||
/// 依赖注入
|
||||
/// </summary>
|
||||
/// <param name="NoticeServiceApi">公告公告Api服务</param>
|
||||
public NoticeApiController(INoticeServiceApi NoticeServiceApi)
|
||||
{
|
||||
_NoticeServiceApi = NoticeServiceApi;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取公告列表(Api)
|
||||
/// </summary>
|
||||
/// <param name="parm">查询参数</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getNoticeList")]
|
||||
public async Task<IActionResult> GetNoticeListApi([FromQuery] NoticeQueryDtoApi parm)
|
||||
{
|
||||
var res = await _NoticeServiceApi.GetNoticeListApi(parm);
|
||||
return SUCCESS(res);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
using Infrastructure;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Enums;
|
||||
using Infrastructure.Model;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ARW.Admin.WebApi.Extensions;
|
||||
using ARW.Admin.WebApi.Filters;
|
||||
using ARW.Common;
|
||||
using ARW.Model.Dto.Business.Advertisement.Notices;
|
||||
using ARW.Service.Business.IBusinessService.Advertisement.Notices;
|
||||
using ARW.Admin.WebApi.Controllers;
|
||||
using ARW.Model.Models.Business.Advertisement.Notices;
|
||||
using ARW.Model.Vo.Business.Advertisement.Notices;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using ARW.Admin.WebApi.Framework;
|
||||
|
||||
|
||||
namespace ARW.WebApi.Controllers.Business.Advertisement.Notices
|
||||
{
|
||||
/// <summary>
|
||||
/// 公告控制器
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-10-09
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("business/[controller]")]
|
||||
public class NoticeController : BaseController
|
||||
{
|
||||
private readonly INoticeService _NoticeService;
|
||||
|
||||
/// <summary>
|
||||
/// 依赖注入
|
||||
/// </summary>
|
||||
/// <param name="NoticeService">公告服务</param>
|
||||
public NoticeController(INoticeService NoticeService)
|
||||
{
|
||||
_NoticeService = NoticeService;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取公告列表
|
||||
/// </summary>
|
||||
/// <param name="parm">查询参数</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getNoticeList")]
|
||||
[ActionPermissionFilter(Permission = "business:notice:list")]
|
||||
public async Task<IActionResult> GetNoticeList([FromQuery] NoticeQueryDto parm)
|
||||
{
|
||||
var res = await _NoticeService.GetNoticeList(parm);
|
||||
return SUCCESS(res);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加或修改公告
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("addOrUpdateNotice")]
|
||||
[ActionPermissionFilter(Permission = "business:notice:addOrUpdate")]
|
||||
[Log(Title = "添加或修改公告", BusinessType = BusinessType.ADDORUPDATE)]
|
||||
public async Task<IActionResult> AddOrUpdateNotice([FromBody] NoticeDto parm)
|
||||
{
|
||||
if (parm == null) { throw new CustomException("请求参数错误"); }
|
||||
|
||||
var modal = new Notice();
|
||||
if (parm.NoticeId != 0) modal = parm.Adapt<Notice>().ToUpdate(HttpContext);
|
||||
else modal = parm.Adapt<Notice>().ToCreate(HttpContext);
|
||||
|
||||
var res = await _NoticeService.AddOrUpdateNotice(modal);
|
||||
return SUCCESS(res);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除公告
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "business:notice:delete")]
|
||||
[Log(Title = "公告删除", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult Delete(string ids)
|
||||
{
|
||||
long[] idsArr = Tools.SpitLongArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
var response = _NoticeService.Delete(idsArr);
|
||||
return SUCCESS("删除成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user