sql 쓸모없는 잠조문 제거 및 신규 쿼리 추가
This commit is contained in:
parent
40e7008165
commit
b5a26acc3b
|
|
@ -87,14 +87,14 @@ namespace Server.Git
|
|||
|
||||
bool isIndex = variable[0] == "index";
|
||||
|
||||
for (int n = 3; n <= vertical; n++)
|
||||
for (int n = 4; n <= vertical; n++)
|
||||
{
|
||||
Dictionary<string, object> dataList = new Dictionary<string, object>();
|
||||
for (int m = 0; m <= horizontal; m++)
|
||||
{
|
||||
dataList.Add(variable[m], worksheet.Cells[n, m].Value);
|
||||
}
|
||||
dicViewer.Add((int)(isIndex ? worksheet.Cells[n, 0].Value : n - 3), dataList);
|
||||
dicViewer.Add((int)(isIndex ? worksheet.Cells[n, 0].Value : n - 4), dataList);
|
||||
}
|
||||
sheet sheet = new sheet(worksheet.Name, variable, dataEnum, type, dicViewer);
|
||||
_sheets.Add(sheet);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,5 @@ namespace Server.SQL
|
|||
public class DeckUnitInfoSQL : SQL<DeckUnitInfo>
|
||||
{
|
||||
public override DbSet<DeckUnitInfo> table { get; set; }
|
||||
public override string tablename { get { return "deck_unit_info"; } }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ namespace Server.SQL
|
|||
public class DynamicDataSQL : SQL<DynamicData>
|
||||
{
|
||||
public override DbSet<DynamicData> table { get; set; }
|
||||
public override string tablename { get { return "dynamic_data"; } }
|
||||
|
||||
public DynamicData SelectName(string name)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL;
|
||||
using SkiaSharp;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace Server.SQL
|
||||
{
|
||||
[Table("equipment", Schema = "gamedb")]
|
||||
public class Equipment
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string user_id { get; set; }
|
||||
public string equip_unit { get; set; }
|
||||
public string rand_stats { get; set; }
|
||||
}
|
||||
|
||||
public class EquipmentrSQL : SQL<Equipment>
|
||||
{
|
||||
public override DbSet<Equipment> table { get; set; }
|
||||
|
||||
public void Update(Equipment equipment)
|
||||
{
|
||||
table.Update(equipment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,6 +25,5 @@ namespace Server.SQL
|
|||
public class LeaderInfoSQL : SQL<LeaderInfo>
|
||||
{
|
||||
public override DbSet<LeaderInfo> table { get; set; }
|
||||
public override string tablename { get { return "leader_info"; } }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ namespace Server.SQL
|
|||
|
||||
public abstract DbSet<T> table { get; set; }
|
||||
|
||||
public abstract string tablename { get; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ namespace Server.SQL
|
|||
public class UserSQL : SQL<User>
|
||||
{
|
||||
public override DbSet<User> table { get; set; }
|
||||
public override string tablename { get { return "user"; } }
|
||||
|
||||
public User SelectUuid(string uuid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,9 +12,11 @@ namespace Server.Service
|
|||
UserSQL userSql = new UserSQL();
|
||||
DeckUnitInfoSQL deckUnitInfoSQL = new DeckUnitInfoSQL();
|
||||
LeaderInfoSQL leaderInfoSQL = new LeaderInfoSQL();
|
||||
EquipmentrSQL equipmentrSQL = new EquipmentrSQL();
|
||||
User user;
|
||||
List<DeckUnitInfo> deckUnitInfoList = null;
|
||||
List<LeaderInfo> leaderInfoList = null;
|
||||
List<Equipment> equipmentList = null;
|
||||
Console.WriteLine(req.uuid);
|
||||
if (req.uuid == "")
|
||||
{
|
||||
|
|
@ -40,6 +42,7 @@ namespace Server.Service
|
|||
|
||||
deckUnitInfoList = deckUnitInfoSQL.Select();
|
||||
leaderInfoList = leaderInfoSQL.Select();
|
||||
equipmentList = equipmentrSQL.Select();
|
||||
}
|
||||
if(user == null)
|
||||
{
|
||||
|
|
@ -117,7 +120,7 @@ namespace Server.Service
|
|||
|
||||
|
||||
|
||||
return makeResp(user, deckUnitInfoList, leaderInfoList);
|
||||
return makeResp(user, deckUnitInfoList, leaderInfoList, equipmentList);
|
||||
}
|
||||
|
||||
public override Protocol ProtocolValue() => Protocol.Login;
|
||||
|
|
@ -128,13 +131,14 @@ namespace Server.Service
|
|||
return req;
|
||||
}
|
||||
|
||||
private string makeResp(User user, List<DeckUnitInfo> deck_unit, List<LeaderInfo> leader)
|
||||
private string makeResp(User user, List<DeckUnitInfo> deck_unit, List<LeaderInfo> leader, List<Equipment> equipment)
|
||||
{
|
||||
LoginResp resp = new LoginResp();
|
||||
resp.nickname = user.nickname;
|
||||
resp.uuid = user.uuid;
|
||||
resp.deck_unit = deck_unit;
|
||||
resp.leader = leader;
|
||||
resp.equipment = equipment;
|
||||
resp.status = 200;
|
||||
return resp.ToJson();
|
||||
}
|
||||
|
|
@ -160,5 +164,6 @@ namespace Server.Service
|
|||
public string nickname;
|
||||
public List<DeckUnitInfo> deck_unit;
|
||||
public List<LeaderInfo> leader;
|
||||
public List<Equipment> equipment;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue