leo
2022-10-20 fd56955a0be081fe3a47af0f8f5e76c478dc7079
Merge branch 'master' of http://47.92.245.94:8000/r/JSU_Pissa_MVC
3个文件已修改
2个文件已添加
90 ■■■■■ 已修改文件
GasolineBlend.Entity/GasolineBlend.Entity.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.Entity/SysHotwords.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/SysController.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pissa.Service/DbService/SysHotWordService.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pissa.Service/Pissa.Service.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.Entity/GasolineBlend.Entity.csproj
@@ -57,6 +57,7 @@
    <Compile Include="SysCarouselImg.cs" />
    <Compile Include="SysCountry.cs" />
    <Compile Include="SysDict.cs" />
    <Compile Include="SysHotwords.cs" />
    <Compile Include="SysIpcClass.cs" />
    <Compile Include="SysIpSection.cs" />
    <Compile Include="SysPatentSearchLog.cs" />
GasolineBlend.Entity/SysHotwords.cs
New file
@@ -0,0 +1,45 @@
using System;
using SqlSugar;
namespace GasolineBlend.Entity
{
    /// <summary>
    ///
    ///</summary>
    [SugarTable("sys_hotwords")]
    public class SysHotWord
    {
        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
        /// <summary>
        ///  中文
        ///</summary>
        [SugarColumn(ColumnName = "NameCh")]
        public string NameCh { get; set; }
        /// <summary>
        ///  英文
        ///</summary>
        [SugarColumn(ColumnName = "NameEn")]
        public string NameEn { get; set; }
        /// <summary>
        ///  排序
        ///</summary>
        [SugarColumn(ColumnName = "Sort")]
        public int Sort { get; set; } = 0;
        /// <summary>
        ///  创建时间
        ///</summary>
        [SugarColumn(ColumnName = "CreateTime")]
        public DateTime? CreateTime { get; set; } = DateTime.Now;
        /// <summary>
        ///  创建用户
        ///</summary>
        [SugarColumn(ColumnName = "CreateUserId")]
        public string CreateUserId { get; set; }
    }
}
GasolineBlend/Controllers/SysController.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Web.Mvc;
using CommonHelper;
using CommonHelper.Format;
@@ -14,6 +15,7 @@
    public class SysController : BaseController
    {
        private SysService _countryService = new SysService();
        private SysHotWordService _hotWordService = new SysHotWordService();
        /// <summary>
        /// 获取国家信息
@@ -175,5 +177,37 @@
            System.IO.File.Delete(Server.MapPath(img.Url));
            return res > 0 ? Success() : Error();
        }
        #region SysHotwords
        [HttpPost]
        public async Task<ActionResult> AddHotWord(SysHotWord model)
        {
            model.CreateUserId = OperatorProvider.Instance?.Current?.UserId;
            var res = await _hotWordService.AddAsync(model);
            return Success();
        }
        [HttpPost]
        public async Task<ActionResult> DelHotWord(int id)
        {
            var res = await _hotWordService.DeleteAsync(a=>a.Id == id);
            return Success();
        }
        [HttpPost]
        public async Task<ActionResult> UpdateHotWord(SysHotWord model)
        {
            model.CreateUserId = OperatorProvider.Instance?.Current?.UserId;
            var res = await _hotWordService.UpdateAsync(model);
            return Success();
        }
        [HttpPost]
        public async Task<ActionResult> GetHotWordList()
        {
            var res = await _hotWordService.GetListAsync(null, a => a.Sort, OrderByType.Asc);
            return Success(data:res);
        }
        #endregion
    }
}
Pissa.Service/DbService/SysHotWordService.cs
New file
@@ -0,0 +1,9 @@
using GasolineBlend.Entity;
namespace Pissa.Service.DbService
{
    public class SysHotWordService:Repository<SysHotWord>
    {
    }
}
Pissa.Service/Pissa.Service.csproj
@@ -99,6 +99,7 @@
  </ItemGroup>
  <ItemGroup>
    <Compile Include="DbService\AnalystReportService.cs" />
    <Compile Include="DbService\SysHotWordService.cs" />
    <Compile Include="DbService\SysService.cs" />
    <Compile Include="DbService\UserService.cs" />
    <Compile Include="Extend\Page.cs" />