public RestfulData <Attraction> Get(int id)
        {
            var data = new AttractionDao().Get(id);

            data.imgList = new ImageDao().GetImageList(id, 1);
            data.MyTag   = data.Tag.Split("|");
            return(new RestfulData <Attraction>
            {
                data = data
            });
        }
        public RestfulData PostAttraction([FromBody] Attraction attraction)
        {
            attraction.Tag = string.Join("|", attraction.MyTag);
            int attractionId = new AttractionDao().insertAttraction(attraction) ?? 0;

            if (attractionId != 0)
            {
                new ImageDao().InsertImageList(attraction.imgList, attractionId, 1);
            }

            return(new RestfulData
            {
                message = "新增成功"
            });
        }
        public RestfulArray <Attraction> GetAttractionList(int page, int pageSize, string type, string name)
        {
            string conditions = "where 1=1";

            if (!string.IsNullOrEmpty(type))
            {
                conditions += string.Format(" and tag like N'%{0}%'", type);
            }
            if (!string.IsNullOrEmpty(name))
            {
                conditions += string.Format(" and name like N'%{0}%'", name);
            }
            var attractionList = new AttractionDao().GetListPaged(page, pageSize, conditions, null);

            foreach (var item in attractionList)
            {
                item.imgList = new ImageDao().GetImageList(item.Id, 1);
            }
            return(new RestfulArray <Attraction>
            {
                data = attractionList,
                total = new AttractionDao().RecordCount(conditions)
            });
        }