public AdvListController(IBaseServer <AdvList> service, IMapper mapper, IOptionsMonitor <QiNiuOssModel> qiNiuOssModel, QiniuCloud qiniuCloud) : base(service, mapper) { _service = service; this._qiNiuOssModel = qiNiuOssModel.CurrentValue; this._qiniuCloud = qiniuCloud; }
public ArticleController(IBaseServer <Article> service, IMapper mapper, IOptionsMonitor <QiNiuOssModel> qiNiuOssModel, QiniuCloud qiniuCloud) : base(service, mapper) { _service = service; _qiniuCloud = qiniuCloud; _qiNiuOssModel = qiNiuOssModel.CurrentValue; }
public CloudFile DeleteList([FromBody] QiniuDelParmDto obj) { return(QiniuCloud.Delete(obj.filename)); }
public CloudFile UpLoadFile([FromBody] QiniuDelByPathParmDto obj) { return(QiniuCloud.UploadFile(obj.prefix, obj.filepath)); }
public CloudFile GetToken() { return(QiniuCloud.GetToken()); }
public CloudFile FileList([FromBody] QiniuListParmDto obj) { return(QiniuCloud.List(obj.prefix, obj.marker)); }
public CloudFile UpLoadFile(string prefix, string filepath) { return(QiniuCloud.UploadFile(prefix, filepath)); }
public CloudFile DeleteList(string filename) { return(QiniuCloud.Delete(filename)); }
public CloudFile FileList(string prefix, string marker) { return(QiniuCloud.List(prefix, marker)); }
public IActionResult UpLoadFile([FromBody] QiniuDelByPathParmDto obj) { return(Ok(QiniuCloud.UploadFile(obj.prefix, obj.filepath))); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { if (env.IsDevelopment()) { //app.UseBrowserLink(); app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); } app.UseStatusCodePagesWithReExecute("/Error"); #region app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto }); #endregion #region Nlog NLog.LogManager.LoadConfiguration("nlog.config").GetCurrentClassLogger(); NLog.LogManager.Configuration.Variables["connectionString"] = Configuration["DBConnection:MySqlConnectionString"]; Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); #endregion #region QiniuCloud.GetInstance().Setting( new QiniuConfig() { AK = Configuration["QiNiu:AccessKey"], SK = Configuration["QiNiu:SecretKey"], Bucket = Configuration["QiNiu:Bucket"], BasePath = Configuration["QiNiu:BasePath"], domain = Configuration["QiNiu:Domain"] }); #endregion #region Swagger UI app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "FytSoa API V1"); }); #endregion //app.UseMiddleware<ExceptionFilter>(); //TaskScheduling TaskSchedulingService.Instance.InitStart(); app.UseAuthentication(); app.UseResponseCompression(); app.UseStaticFiles(new StaticFileOptions { ServeUnknownFileTypes = true //ContentTypeProvider = new FileExtensionContentTypeProvider(new Dictionary<string, string> //{ // { ".apk","application/vnd.android.package-archive"}, // { ".nupkg","application/zip"} //}) }); app.UseCookiePolicy(); app.UseCors("Any"); app.UseMvc(); }