增加
This commit is contained in:
@@ -20,6 +20,6 @@ public class NoticeService:INoticeService,ITransient
|
||||
public async Task<List<game_notice>> GetNoticeData(int page, int limit, RefAsync<int> total)
|
||||
{
|
||||
var db = _dbClient.AsTenant().GetConnectionWithAttr<game_notice>();
|
||||
return await db.Queryable<game_notice>().ToPageListAsync(page, limit, total);
|
||||
return await db.Queryable<game_notice>().OrderByDescending(it=>it.addTime).ToPageListAsync(page, limit, total);
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,11 @@ public class GameAccountService : IGameAccountService, ITransient
|
||||
{
|
||||
var db = _dbClient.AsTenant().GetConnectionWithAttr<game_account>();
|
||||
var data = await db.Queryable<game_account>().Where(it => it.openId == openId).FirstAsync();
|
||||
await _redisClient.AddHashAsync(key, openId, data);
|
||||
if (data != null)
|
||||
{
|
||||
await _redisClient.AddHashAsync(key, openId, data);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -41,11 +45,15 @@ public class GameAccountService : IGameAccountService, ITransient
|
||||
{
|
||||
var db = _dbClient.AsTenant().GetConnectionWithAttr<game_account>();
|
||||
var data = await db.Queryable<game_account>().Where(it => it.accId == accId).FirstAsync();
|
||||
await _redisClient.AddHashAsync(key, accId, data);
|
||||
if (data != null)
|
||||
{
|
||||
await _redisClient.AddHashAsync(key, accId, data);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task<game_account> GetAccInfoByToken(string token)
|
||||
{
|
||||
var db = _dbClient.AsTenant().GetConnectionWithAttr<game_account>();
|
||||
@@ -86,7 +94,7 @@ public class GameAccountService : IGameAccountService, ITransient
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<game_account> Regist(string userName, string nick, string pwd, string remAccId = "",
|
||||
public async Task<game_account> Regist(string userName, string nick, string pwd, string remAccId = "",
|
||||
string openId = "")
|
||||
{
|
||||
game_account result = new game_account();
|
||||
@@ -116,12 +124,13 @@ public class GameAccountService : IGameAccountService, ITransient
|
||||
{
|
||||
result = null;
|
||||
}
|
||||
|
||||
await _dbClient.AsTenant().CommitTranAsync();
|
||||
}
|
||||
catch
|
||||
{
|
||||
result = null;
|
||||
await _dbClient.AsTenant().RollbackTranAsync();
|
||||
await _dbClient.AsTenant().RollbackTranAsync();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user