Xiezn.Core/Business/Services/YonghuService.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xiezn.Core.Common.Helpers;
using Xiezn.Core.Models;
using Xiezn.Core.Models.DbModel;
namespace Xiezn.Core.Business.Services
{
public class YonghuService : BaseService<YonghuDbModel>
{
private readonly long _uid;
private readonly string _role;
public YonghuService()
{
try
{
if (CacheHelper.TokenModel != null)
{
_uid = CacheHelper.TokenModel.Uid;
_role = CacheHelper.TokenModel.Role;
}
}
catch
{
_uid = 0;
_role = "游客";
}
}
public dynamic Login(string username, string password)
{
return CurrentDb.GetSingle(it => it.Yonghuzhanghao == username && it.Mima == password);
}
public bool ResetPass(string username)
{
return CurrentDb.Update(it => new YonghuDbModel() { Mima = "123456" }, it => it.Yonghuzhanghao == username);
}
public PageModel<YonghuDbModel> GetPageList(int page, int limit, string sort, string order, List<IConditionalModel> conModels)
{
PageModel pageModel = new PageModel() { PageIndex = page, PageSize = limit };
int totalNumber = 0;
int totalPage = 0;
string dbColumnName = Db.EntityMaintenance.GetDbColumnName<YonghuDbModel>(sort);
order = order.ToLower() == "asc" ? "ASC" : "DESC";
List<YonghuDbModel> ts = Db.Queryable<YonghuDbModel>().Where(conModels).OrderBy(dbColumnName + " " + order).ToPageList(page, limit, ref totalNumber, ref totalPage);
后面还有 23 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
