Пример #1
0
        public async Task <IActionResult> SetBucketAclPrivate()
        {
            try
            {
                var result = await _ossService.SetBucketAclAsync(_bucketName, AccessMode.Private);

                if (result)
                {
                    var acl = await _ossService.GetBucketAclAsync(_bucketName);

                    return(Json(new ResultObject()
                    {
                        Status = result,
                        Data = acl.ToString(),
                    }));
                }
                else
                {
                    return(Json(new ResultObject()
                    {
                        Status = false,
                    }));
                }
            }
            catch (Exception ex)
            {
                return(Json(new ResultObject()
                {
                    Status = false,
                    Message = ex.Message
                }));
            }
        }
        public async Task <IActionResult> GetBucketAcl()
        {
            try
            {
                var result = await _OSSService.GetBucketAclAsync(_bucketName);

                return(Content(result.ToString()));
            }
            catch (Exception ex)
            {
                return(Content(ex.Message));
            }
        }