using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using XYY.Core.Standard.Mvc;
using XYY.Data.Model.Standard.Tracking;

namespace XYY.API.Tracking.Controllers
{
    [Route("[controller]")]
    [ApiController]
    public class EnumController : ControllerBase
    {
        [HttpGet]
        public ApiJsonModel<List<EnumItem2>> Get(string enumName)
        {
            List<EnumItem2> list = new List<EnumItem2>();
            switch (enumName)
            {
                case "JudgmentNode":
                    list = EnumsHelper.GetEnumItemsDes<JudgmentNode>();
                    break;
                case "TrackSupplementLocation":
                    list = EnumsHelper.GetEnumItemsDes<TrackSupplementLocation>();
                    break;
                case "SupplementType":
                    list = EnumsHelper.GetEnumItemsDes<SupplementType>();
                    break;
                default:
                    return ApiJsonModel<List<EnumItem2>>.Error("未找到相关的枚举内容" + enumName, null);
            }
            return ApiJsonModel<List<EnumItem2>>.OK(list);

        }
    }
}
