增加修炼功能
This commit is contained in:
@@ -14,5 +14,6 @@ public static class GoodsEnum
|
||||
Card,//附魔卡片
|
||||
Mark,//圣痕
|
||||
Pack,//宝箱
|
||||
Practise,//修炼道具
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Application.Domain
|
||||
{
|
||||
public interface IUnitUserPractiseService
|
||||
{
|
||||
Task<bool> DelPractise(string practiseId);
|
||||
Task<bool> AddPractise(unit_user_practise practise);
|
||||
Task<unit_user_practise> GetUserPractiseInfo(string practiseId);
|
||||
Task<List<unit_user_practise>> GetUserPractiseList(string userId, int page, int limit, RefAsync<int> total);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Application.Domain
|
||||
{
|
||||
public class UnitUserPractiseService(ISqlSugarClient DbClient, IRedisCache redis) : IUnitUserPractiseService, ITransient
|
||||
{
|
||||
public async Task<bool> DelPractise(string practiseId)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_practise>();
|
||||
return await db.Deleteable<unit_user_practise>().Where(i => i.practiseId == practiseId).ExecuteCommandAsync() > 0;
|
||||
}
|
||||
public async Task<bool> AddPractise(unit_user_practise practise)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_practise>();
|
||||
return await db.Insertable(practise).ExecuteCommandAsync() > 0;
|
||||
}
|
||||
public async Task<unit_user_practise> GetUserPractiseInfo(string practiseId)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_practise>();
|
||||
return await db.Queryable<unit_user_practise>().Where(i => i.practiseId == practiseId).SingleAsync();
|
||||
}
|
||||
public async Task<List<unit_user_practise>> GetUserPractiseList(string userId, int page, int limit, RefAsync<int> total)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_practise>();
|
||||
return await db.Queryable<unit_user_practise>().Where(i => i.userId == userId).ToPageListAsync(page, limit, total);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user