QiFeng.ZWY.Api/Controllers/ScenicSpotController.cs

(开头部分) 14KB

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

using log4net;
using QiFeng.LMSD.Api.Models;
using QiFeng.LMSD.Bll;
using QiFeng.LMSD.Model;
using QiFeng.LMSD.Model.EnumModel;
using QiFeng.LMSD.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace QiFeng.LMSD.Api.Controllers
{
    public class ScenicSpotController : BaseApiController
    {
        private readonly ILog logger = LogManager.GetLogger(typeof(ConsumerController));

        /// <summary>
        /// 获取景点列表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public Result<string> GetScenicSpotList([FromBody]GetScenicSpotListModel model)
        {
            Result<string> result = new Result<string>() { Status = false, StatusCode = (int)SysStatusCode.SystemError, Message = "系统错误" };
            try
            {
                var strSign = model.random + model.searchKey;
                if (!model.sign.Equals(EncryptionLibCbc.Encrypt(strSign)))
                    throw new FormatException("请求参数错误");

                var list = ScenicSpotsBll.Instance.GetScenicSpotList(model.searchKey);
                if (list == null || list.Count <= 0)
                {
                    result.Status = true;
                    result.StatusCode = (int)SysStatusCode.NullList;
                    result.Message = "景点列表为空";
                }
                else
                {
                    result.Status = true;
                    result.StatusCode = (int)SysStatusCode.Success;
                    result.Message = "获取景点列表成功";
                    result.Data = EncryptionLibCbc.Encrypt(JsonTool.ObjToJsonAllInfo(list));
                }
            }
            catch (Exception ex)
            {
                result.Status = false;
                result.StatusCode = (int)SysStatusCode.SystemError;
#if DEBUG
                result.Message = ex.Message + ex.StackTrace;
#else
                result.Message = "系统错误";
#endif
                if (ex.GetType() == typeof(FormatException)) result.Message = ex.Message;
                logger.Error(" ScenicSpotController | GetScenicSpotList | Faild:" + ex.Message);
后面还有 280 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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