using molilian.core;
using dodohold.core;
using Microsoft.AspNetCore.Mvc;
using System.Text.Json;
using YunhuiKit;

namespace molilian.api.Controllers
{
    [ApiController]
    [Route("[controller]/[action]")]
    public class CouponController : ControllerBase
    {
        protected IHttpContextAccessor _accessor;
        public CouponController(IHttpContextAccessor accessor)
        {
            _accessor = accessor;
        }

        [HttpPost]
        [HttpGet]
        public ActionResult Activities([FromBody] JsonElement form)
        {
            var channel = form.Read("c", string.Empty);
            var response = CouponCenterCore.GetActivities(channel);
            return new APIResult(response);
        }
    }
}
