ZhouliProject/Zhouli.BLL/Implements/BlogFriendshipLinkBLL.cs

(开头部分) 7KB

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

using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using Zhouli.BLL.Interface;
using Zhouli.Common.ResultModel;
using Zhouli.DAL.Interface;
using Zhouli.DbEntity.Models;
using Zhouli.DbEntity.Views;
using Zhouli.Dto.ModelDto;
using Zhouli.Enum;

namespace Zhouli.BLL.Implements
{
    public class BlogFriendshipLinkBLL : BaseBLL<BlogFriendshipLink>, IBlogFriendshipLinkBLL
    {
        private readonly IBlogFriendshipLinkDAL _blogFriendshipLinkDAL;

        public IBlogFriendshipLinkDAL BlogFriendshipLinkDAL => _blogFriendshipLinkDAL;

        /// <summary>
        /// 用于实例化父级,blogFriendshipLinkDAL
        /// </summary>
        /// <param name="blogFriendshipLinkDAL"></param>
        public BlogFriendshipLinkBLL(IBlogFriendshipLinkDAL blogFriendshipLinkDAL) : base(blogFriendshipLinkDAL)
        {
            this._blogFriendshipLinkDAL = blogFriendshipLinkDAL;
        }
        /// <summary>
        /// 获取友情链接分页数据
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <param name="searchstr"></param>
        /// <returns></returns>
        public HandleResult<PageModel> GetFriendshipLinkList(string page, string limit, string searchstr)
        {
            var query = _blogFriendshipLinkDAL.GetModelsByPage(Convert.ToInt32(limit), Convert.ToInt32(page), false, t => t.CreateTime,
                t => t.FriendshipLinkName.Contains(searchstr) || string.IsNullOrEmpty(searchstr)
                && t.DeleteSign.Equals((int)DeleteSign.Sing_Deleted));
            return new HandleResult<PageModel>
            {
                Data = new PageModel
                {
                    RowCount = query.Count(),
                    Data = query.ToList()
                }
            };
        }
        /// <summary>
        /// 添加/编辑友情链接
        /// </summary>
        /// <param name="blog"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public HandleResult<bool> AddorEditFriendshipLink(BlogFriendshipLinkDto friendshipLinkDto, string userId)
        {
            var handleResult = new HandleResult<bool>();
            var friendshipLink = Mapper.Map<BlogFriendshipLink>(friendshipLinkDto);
            //添加
后面还有 142 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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