Example #1
0
 public DataResponse<List<PoolData>> Pools([FromBody]SignRequest request) {
     if (request == null) {
         return ResponseBase.InvalidInput<DataResponse<List<PoolData>>>("参数错误");
     }
     try {
         if (!request.IsValid(User, Sign, Timestamp, base.ClientIp, out DataResponse<List<PoolData>> response)) {
             return response;
         }
         var data = HostRoot.Instance.PoolSet.GetAll();
         return DataResponse<List<PoolData>>.Ok(data);
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
         return ResponseBase.ServerError<DataResponse<List<PoolData>>>(e.Message);
     }
 }
Example #2
0
 public ResponseBase LoginControlCenter([FromBody] SignRequest request)
 {
     if (request == null)
     {
         return(ResponseBase.InvalidInput("参数错误"));
     }
     try {
         Logger.InfoDebugLine($"{LoginName} {Sign} {Timestamp}");
         if (!request.IsValid(User, Sign, Timestamp, base.ClientIp, out ResponseBase response))
         {
             return(response);
         }
         Logger.InfoDebugLine($"{LoginName}登录成功");
         return(ResponseBase.Ok());
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
         return(ResponseBase.ServerError(e.Message));
     }
 }