using COSSTS;
using Newtonsoft.Json;
using Znyc.CloudCar.Configuration;
using Znyc.CloudCar.IServices.Document;
using Znyc.CloudCar.Model.Dtos.Document;
using Znyc.CloudCar.Model.ViewModels.ReportsCallBack;
namespace Znyc.CloudCar.Services.Document
{
public class DocumentService : IDocumentService
{
///
/// 上传图片
///
///
public ResponseOutput UploadImageAsync()
{
Dictionary values = new()
{
["bucket"] = AppSettingsConstVars.CosConfigBucket,
["region"] = AppSettingsConstVars.CosConfigRegion,
["allowPrefix"] = AppSettingsConstVars.CosConfigAllowPrefix,
["allowActions"] = AppSettingsConstVars.CosConfigAllowActions,
["durationSeconds"] = AppSettingsConstVars.CosConfigDurationSeconds,
["secretId"] = AppSettingsConstVars.CosConfigSecretId,
["secretKey"] = AppSettingsConstVars.CosConfigSecretKey
};
Dictionary credential = STSClient.genCredential(values);
return new ResponseOutput()
{
Data = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(credential)),
Successed = true,
Code = 1
};
}
}
}