네이밍 변경
This commit is contained in:
parent
1a315bdc97
commit
255339a9ef
|
|
@ -5,11 +5,11 @@ using static System.Runtime.InteropServices.JavaScript.JSType;
|
|||
|
||||
namespace Server.SQL
|
||||
{
|
||||
[Table("leader_info", Schema = "gamedb")]
|
||||
public class LeaderInfo
|
||||
[Table("deck_info", Schema = "gamedb")]
|
||||
public class DeckInfo
|
||||
{
|
||||
public int id { get; set; }
|
||||
public int leader_id { get; set; }
|
||||
public int deck_type { get; set; }
|
||||
public int deck_unit0_id { get; set; }
|
||||
public int deck_unit1_id { get; set; }
|
||||
public int deck_unit2_id { get; set; }
|
||||
|
|
@ -22,11 +22,11 @@ namespace Server.SQL
|
|||
public int user_id { get; set; }
|
||||
}
|
||||
|
||||
public class LeaderInfoSQL : SQL<LeaderInfo>
|
||||
public class DeckInfoSQL : SQL<DeckInfo>
|
||||
{
|
||||
public override DbSet<LeaderInfo> table { get; set; }
|
||||
public override DbSet<DeckInfo> table { get; set; }
|
||||
|
||||
public override List<LeaderInfo> SelectUid(int user_id)
|
||||
public override List<DeckInfo> SelectUid(int user_id)
|
||||
{
|
||||
return table.Where(data => data.user_id == user_id).ToList();
|
||||
}
|
||||
|
|
@ -38,5 +38,10 @@ namespace Server.SQL
|
|||
SaveChanges();
|
||||
}
|
||||
}
|
||||
|
||||
public override List<DynamicData> SelectUid(int user_id)
|
||||
{
|
||||
return null;//table.Where(data => data.id == user_id).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Server.Service
|
|||
return makeResp();
|
||||
}
|
||||
|
||||
public override Protocol ProtocolValue() => Protocol.Test;
|
||||
public override Protocol ProtocolValue() => Protocol.ChangeDeck;
|
||||
|
||||
public override Req Requst(string json)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ namespace Server.Service
|
|||
{
|
||||
UserSQL userSql = new UserSQL();
|
||||
DeckUnitInfoSQL deckUnitInfoSQL = new DeckUnitInfoSQL();
|
||||
LeaderInfoSQL leaderInfoSQL = new LeaderInfoSQL();
|
||||
DeckInfoSQL deckInfoSQL = new DeckInfoSQL();
|
||||
EquipmentrSQL equipmentrSQL = new EquipmentrSQL();
|
||||
User user;
|
||||
List<DeckUnitInfo> deckUnitInfoList = null;
|
||||
List<LeaderInfo> leaderInfoList = null;
|
||||
List<DeckInfo> deckInfoList = null;
|
||||
List<Equipment> equipmentList = null;
|
||||
Console.WriteLine(req.uuid);
|
||||
if (req.uuid == "")
|
||||
|
|
@ -27,7 +27,7 @@ namespace Server.Service
|
|||
if (user != null)
|
||||
{
|
||||
deckUnitInfoList = deckUnitInfoSQL.Select();
|
||||
leaderInfoList = leaderInfoSQL.Select();
|
||||
deckInfoList = deckInfoSQL.Select();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -36,7 +36,8 @@ namespace Server.Service
|
|||
user = userSql.SelectUuid(req.uuid);
|
||||
|
||||
deckUnitInfoList = deckUnitInfoSQL.SelectUid(user.id);
|
||||
leaderInfoList = leaderInfoSQL.SelectUid(user.id);
|
||||
//추후 이것을 1개만 보낼것.
|
||||
deckInfoList = deckInfoSQL.SelectUid(user.id);
|
||||
equipmentList = equipmentrSQL.SelectUid(user.id);
|
||||
}
|
||||
if(user == null)
|
||||
|
|
@ -94,28 +95,28 @@ namespace Server.Service
|
|||
deckUnitInfoSQL.Insert(deckUnitInfoList);
|
||||
#endregion
|
||||
#region 신규 덱 추가
|
||||
leaderInfoList = new List<LeaderInfo>();
|
||||
LeaderInfo leaderInfo;
|
||||
leaderInfo = new LeaderInfo();
|
||||
leaderInfo.user_id= user.id;
|
||||
leaderInfo.leader_id = 1;
|
||||
leaderInfo.deck_unit0_id = deckUnitInfoList[0].id;
|
||||
leaderInfo.deck_unit1_id = deckUnitInfoList[1].id;
|
||||
leaderInfo.deck_unit2_id = deckUnitInfoList[2].id;
|
||||
leaderInfo.deck_unit3_id = deckUnitInfoList[3].id;
|
||||
leaderInfo.deck_unit4_id = deckUnitInfoList[4].id;
|
||||
leaderInfo.deck_unit5_id = deckUnitInfoList[5].id;
|
||||
leaderInfo.deck_unit6_id = deckUnitInfoList[6].id;
|
||||
leaderInfo.deck_unit7_id = deckUnitInfoList[7].id;
|
||||
leaderInfo.deck_unit8_id = deckUnitInfoList[8].id;
|
||||
leaderInfoList.Add(leaderInfo);
|
||||
leaderInfoSQL.Insert(leaderInfoList);
|
||||
deckInfoList = new List<DeckInfo>();
|
||||
DeckInfo deckInfo;
|
||||
deckInfo = new DeckInfo();
|
||||
deckInfo.user_id= user.id;
|
||||
deckInfo.deck_type = 1;
|
||||
deckInfo.deck_unit0_id = deckUnitInfoList[0].id;
|
||||
deckInfo.deck_unit1_id = deckUnitInfoList[1].id;
|
||||
deckInfo.deck_unit2_id = deckUnitInfoList[2].id;
|
||||
deckInfo.deck_unit3_id = deckUnitInfoList[3].id;
|
||||
deckInfo.deck_unit4_id = deckUnitInfoList[4].id;
|
||||
deckInfo.deck_unit5_id = deckUnitInfoList[5].id;
|
||||
deckInfo.deck_unit6_id = deckUnitInfoList[6].id;
|
||||
deckInfo.deck_unit7_id = deckUnitInfoList[7].id;
|
||||
deckInfo.deck_unit8_id = deckUnitInfoList[8].id;
|
||||
deckInfoList.Add(deckInfo);
|
||||
deckInfoSQL.Insert(deckInfoList);
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
return makeResp(user, deckUnitInfoList, leaderInfoList, equipmentList);
|
||||
return makeResp(user, deckUnitInfoList, deckInfoList, equipmentList);
|
||||
}
|
||||
|
||||
public override Protocol ProtocolValue() => Protocol.Login;
|
||||
|
|
@ -126,13 +127,13 @@ namespace Server.Service
|
|||
return req;
|
||||
}
|
||||
|
||||
private string makeResp(User user, List<DeckUnitInfo> deck_unit, List<LeaderInfo> leader, List<Equipment> equipment)
|
||||
private string makeResp(User user, List<DeckUnitInfo> deck_unit, List<DeckInfo> deck_info, List<Equipment> equipment)
|
||||
{
|
||||
LoginResp resp = new LoginResp();
|
||||
resp.nickname = user.nickname;
|
||||
resp.uuid = user.uuid;
|
||||
resp.deck_unit = deck_unit;
|
||||
resp.leader = leader;
|
||||
resp.deck_info = deck_info;
|
||||
resp.equipment = equipment;
|
||||
resp.status = 200;
|
||||
return resp.ToJson();
|
||||
|
|
@ -158,7 +159,7 @@ namespace Server.Service
|
|||
public string uuid;
|
||||
public string nickname;
|
||||
public List<DeckUnitInfo> deck_unit;
|
||||
public List<LeaderInfo> leader;
|
||||
public List<DeckInfo> deck_info;
|
||||
public List<Equipment> equipment;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
Downlode = 100,//기획 데이터 다운로드
|
||||
Login = 101,//기획 데이터 다운로드
|
||||
ChangeDeck = 102,//기획 데이터 다운로드
|
||||
}
|
||||
|
||||
public enum Error
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
public static readonly string EXCEL_SQL_URL = "Host=192.168.0.2;Port=5432;Username=manager;Password=Zn2zs558W5SdD8K;Database=project_thewar;";
|
||||
public static readonly string remoteUrl = "https://manager:BQNl01bJJF0wn9R@gitea.pandoli365.com/Team.thewar/thewar_excel.git";
|
||||
#elif LIVE
|
||||
public static readonly string SQL_URL = "Host=192.168.0.2;Port=5432;Username=manager;Password=Zn2zs558W5SdD8K;Database=project_thewar_live;";
|
||||
public static readonly string EXCEL_SQL_URL = "Host=192.168.0.2;Port=5432;Username=manager;Password=Zn2zs558W5SdD8K;Database=project_thewar_live;";
|
||||
public static readonly string SQL_URL = "Host=192.168.0.2;Port=5432;Username=manager;Password=Zn2zs558W5SdD8K;Database=project_thewar;";
|
||||
public static readonly string EXCEL_SQL_URL = "Host=192.168.0.2;Port=5432;Username=manager;Password=Zn2zs558W5SdD8K;Database=project_thewar;";
|
||||
public static readonly string remoteUrl = "https://manager:BQNl01bJJF0wn9R@gitea.pandoli365.com/Team.thewar/thewar_excel_live.git";
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue