General.Web/Controllers/Admin/DictionaryController.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using General.Entities.Models;
using General.Framework;
using General.Mvc.Filters;
using General.Services.DicType;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Threading.Tasks;

namespace General.Mvc.Controllers.Admin
{
    [Route("api/admin/[controller]/[action]")]
    [ApiController]
    [ServiceFilter(typeof(ResponseLogTimeFilter))]
    public class DictionaryController : Controller
    {
        private readonly IDicTypeService dicTypeService;
        private readonly Services.Dictionary.IDictionaryService dictionaryService;

        public DictionaryController(IDicTypeService dicTypeService,
            Services.Dictionary.IDictionaryService dictionaryService)
        {
            this.dicTypeService = dicTypeService;
            this.dictionaryService = dictionaryService;
        }



        #region 字典管理
        /// <summary>
        /// 查询字典类型列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [ServiceFilter(typeof(AdminCheckFilter))]
        public async Task<IActionResult> GetDicTypeList(int page, int limit, string name)
        {
            var list = await dicTypeService.GetList(page, limit, name);
            return Content(JsonHelper.Serialize(list));
        }
        /// <summary>
        /// 增加字典类型
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [ServiceFilter(typeof(AdminCheckFilter))]
        public async Task<IActionResult> AddDicType([FromForm] tc_dictype dictype)
        {
            await dicTypeService.AddInfo(dictype);
            return Content(JsonHelper.Serialize(new AjaxResult() { code = AjaxResultStateEnum.Ok, message = "增加成功!" }));
        }
        /// <summary>
        /// 编辑字典类型
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [ServiceFilter(typeof(AdminCheckFilter))]
后面还有 88 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。