mirror of
https://github.com/CoreUnion/CoreShop.git
synced 2026-10-24 01:29:01 +08:00
6432b697e7
* 调整接口端提示界面 * 修复弹窗不居中问题 * 调整一些命名方式 * 修复uni-app前端,用户订单列表【确认收货】按钮失效问题 * 1、修复mysql数据库下,报表统计sql的语法错误。2、为方便前端在不部署接口及后端的情况下测试uni-app前端,默认增加了测试接口地址… * Merge branch 'develop' into dahuihui/develop * 调整命名 * 增加docker-compose部署 * Merge branch 'develop' into dahuihui/develop * 修复因linux下存在数据与文件名称大小写不对应,导致找不到数据库表的问题,特重新发布一份表名与实体名称一一对应脚本。 * 新mysql表名存在大小写问题
96 lines
2.7 KiB
C#
96 lines
2.7 KiB
C#
/***********************************************************************
|
|
* Project: CoreCms
|
|
* ProjectName: 核心内容管理系统
|
|
* Web: https://www.corecms.net
|
|
* Author: 大灰灰
|
|
* Email: jianweie@163.com
|
|
* CreateTime: 2021/1/31 21:45:10
|
|
* Description: 暂无
|
|
***********************************************************************/
|
|
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using CoreCms.Net.Auth.HttpContextUser;
|
|
using CoreCms.Net.Configuration;
|
|
using CoreCms.Net.IServices;
|
|
using CoreCms.Net.Model.FromBody;
|
|
using CoreCms.Net.Model.ViewModels.UI;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using SqlSugar;
|
|
|
|
namespace CoreCms.Net.Web.WebApi.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 公告控制器
|
|
/// </summary>
|
|
[Route("api/[controller]/[action]")]
|
|
[ApiController]
|
|
public class NoticeController : Controller
|
|
{
|
|
private IHttpContextUser _user;
|
|
private ICoreCmsNoticeServices _noticeServices;
|
|
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
/// <param name="user"></param>
|
|
/// <param name="noticeServices"></param>
|
|
public NoticeController(IHttpContextUser user, ICoreCmsNoticeServices noticeServices)
|
|
{
|
|
_user = user;
|
|
_noticeServices = noticeServices;
|
|
}
|
|
|
|
|
|
#region 列表
|
|
/// <summary>
|
|
/// 列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<JsonResult> NoticeList([FromBody] FMPageByIntId entity)
|
|
{
|
|
var jm = new WebApiCallBack();
|
|
|
|
var list = await _noticeServices.QueryPageAsync(p => p.isDel == false, p => p.createTime, OrderByType.Desc,
|
|
entity.page, entity.limit);
|
|
jm.status = true;
|
|
jm.data = list;
|
|
|
|
return Json(jm);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 获取单个公告内容
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<WebApiCallBack> NoticeInfo([FromBody] FMIntId entity)
|
|
{
|
|
var jm = new WebApiCallBack();
|
|
|
|
var model = await _noticeServices.QueryByIdAsync(entity.id);
|
|
if (model == null)
|
|
{
|
|
jm.msg = "数据获取失败";
|
|
return jm;
|
|
}
|
|
jm.status = true;
|
|
jm.data = model;
|
|
return jm;
|
|
}
|
|
|
|
}
|
|
}
|