/// <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()); } }
//[AdminAuthorize(Permissions = "admin.ad.setisactive")] public IActionResult SetIsShow(SetAdIsShowRequest request) { var resp = _adService.SetAdIsShow(request); return(RespJson(resp)); }