Ejemplo n.º 1
0
        public ReturnData CounterUpdate(InputData input)
        {
            try
            {
                var text = TextHelper.FixText($"Saved: {input.Counter} plastic coffee cups");
                Writer.Write(text);

                return(new ReturnData {
                    Success = true, Message = "OK"
                });
            }
            catch (Exception)
            {
                return(new ReturnData {
                    Success = false, Message = "Error"
                });
            }
        }
        public AllTextReturnData TextUpdate(AllTextInputData input)
        {
            try
            {
                if (input.Text.Length > 32)
                {
                    return new AllTextReturnData {
                               Success = false, Message = "Text too long"
                    }
                }
                ;
                Writer.Write(input.Text);

                return(new AllTextReturnData {
                    Success = true, Message = "OK"
                });
            }
            catch (Exception)
            {
                return(new AllTextReturnData {
                    Success = false, Message = "Error"
                });
            }
        }