コード例 #1
0
ファイル: Program.cs プロジェクト: 396000787/csaa
        private static void AddAdvertisement()
        {
            AdvertisementProvider _Provider      = new AdvertisementProvider();
            Advertisement         _Advertisement = new Advertisement();

            _Advertisement.count       = 0;
            _Advertisement.imageBase64 = "121212swewewewe";
            _Advertisement.imageUrl    = "ssdsddddsds";
            _Advertisement.index       = 1;
            _Advertisement.isVail      = true;
            _Advertisement.targetUrl   = "sfsdeeewwdddd";
            _Advertisement.title       = "asdfasdfasfasdfasfasdf";
            _Provider.InsterAdvertisement(_Advertisement);
        }
コード例 #2
0
        public HttpResponseMessage InsterAdvertisement([FromBody] Advertisement data)
        {
            try
            {
                AdvertisementProvider _Provider = new AdvertisementProvider();
                var result = _Provider.InsterAdvertisement(data);
                return(Request.CreateResponse(HttpStatusCode.OK, result));
            }
            catch (Exception ex)
            {
                LogFactory _LogFactory = new LogFactory(this.GetType());
                _LogFactory.CreateLog(LogType.Error, "新建广告信息", "InsterAdvertisement", ex);

                return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        }