Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        /// <exception cref="MozException"></exception>
        public SetAdIsShowResponse SetAdIsShow(SetAdIsShowRequest request)
        {
            using (var client = DbFactory.GetClient())
            {
                var ad = client.Queryable <Ad>().Select(it => new { it.Id }).First(it => it.Id == request.Id);
                if (ad == null)
                {
                    throw new MozException("找不到该条信息");
                }

                client.Updateable <Ad>()
                .UpdateColumns(it => new Ad {
                    IsShow = request.IsShow
                })
                .Where(it => it.Id == request.Id)
                .ExecuteCommand();

                return(new SetAdIsShowResponse());
            }
        }
Ejemplo n.º 2
0
        //[AdminAuthorize(Permissions = "admin.ad.setisactive")]
        public IActionResult SetIsShow(SetAdIsShowRequest request)
        {
            var resp = _adService.SetAdIsShow(request);

            return(RespJson(resp));
        }