﻿using System.Collections.Generic;
using System.Xml.Linq;

namespace server.Handlers.giftCode
{
    public class Create : HandlerModule<AuthQuery>
    {
        public Create() : base("/giftCode/create", new List<Method> { Method.Get })
        {
            AddRoute("/giftCode/create", Method.Post, postInvoke);
        }

        private dynamic postInvoke(dynamic arg)
        {
            return Write(new XElement("Success"));
        }

        protected override dynamic Invoke()
        {
            return View["GiftCode/Create", new GiftCodeCreateModel { Method = "GET" }];
        }
    }

    public class GiftCodeCreateModel
    {
        public string Method { get; set; }
    }
}