프로토콜 수정및 일부 파일 인코딩 변경
This commit is contained in:
parent
22da510844
commit
573f246e7a
|
@ -9,9 +9,9 @@
|
|||
|
||||
public class UserSQL : SQL<User>
|
||||
{
|
||||
public void userInsert(User user)
|
||||
public void userInsert(User user)
|
||||
{
|
||||
string qurry = sqlInsert(user);
|
||||
string qurry = sqlInsert(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
using Server.System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Server.Service
|
||||
{
|
||||
public class Test : AbstractService
|
||||
{
|
||||
private TestReq req;
|
||||
public override string Process()
|
||||
{
|
||||
return makeResp();
|
||||
}
|
||||
|
||||
public override Protocol ProtocolValue() => Protocol.Test;
|
||||
|
||||
public override Req Requst(string json)
|
||||
{
|
||||
req = JsonConvert.DeserializeObject<TestReq>(json);
|
||||
return req;
|
||||
}
|
||||
|
||||
private string makeResp()
|
||||
{
|
||||
TestResp resp = new TestResp();
|
||||
resp.status = 200;
|
||||
return resp.ToJson();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class TestReq : Req
|
||||
{
|
||||
public override bool IsReceivedAllField()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class TestResp : Resp
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
using Server.System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Server.Service
|
||||
{
|
||||
public class AddUser : AbstractService
|
||||
{
|
||||
private AddUserReq req;
|
||||
public override string Process()
|
||||
{
|
||||
return makeResp();
|
||||
}
|
||||
|
||||
public override Protocol ProtocolValue() => Protocol.AddUser;
|
||||
|
||||
public override Req Requst(string json)
|
||||
{
|
||||
req = JsonConvert.DeserializeObject<AddUserReq>(json);
|
||||
return req;
|
||||
}
|
||||
|
||||
private string makeResp()
|
||||
{
|
||||
AddUserResp resp = new AddUserResp();
|
||||
resp.status = 200;
|
||||
return resp.ToJson();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class AddUserReq : Req
|
||||
{
|
||||
public override bool IsReceivedAllField()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class AddUserResp : Resp
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
public enum Protocol
|
||||
{
|
||||
Test = 0,
|
||||
AddUser = 1,
|
||||
}
|
||||
|
||||
public enum Error
|
||||
|
|
Loading…
Reference in New Issue