Exemplo n.º 1
0
        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);
        }
Exemplo n.º 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));
            }
        }