Exemple #1
0
        public async Task <ResponseResult <string> > AddImgRelations(
            [FromHeader][Required] string appid,
            //[FromHeader] [Required] string appSecret,
            [FromBody] AddImgRelationsEntity RelationsEntity)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(new ResponseResult <string>()
                    {
                        Code = (int)HttpStatusCode.BadRequest, //400
                    });
                }
                //if (!_serviceAppService.IsValid(appId, appSecret))
                //{
                //    return new ResponseResult<string>()
                //    {
                //        Code = (int)HttpStatusCode.Unauthorized, // 401
                //        Message = "AppId, AppSecret is not authorized, or. "
                //    };
                //}
                var Result = await _imageService.AddImgRelationsAsync(RelationsEntity.ImgId, RelationsEntity.ObjectId);

                return(new ResponseResult <string>()
                {
                    Code = 200,
                    Data = Result
                });
            }
            catch (Exception ex)
            {
                _logger.LogError(new EventId(), ex, "Celia.io.Core.StaticObjects.WebAPI_Core.ImagesController.RevokePublishAsync");
                return(new ResponseResult <string>()
                {
                    Code = 500,
                    Message = ex.Message,
                });
            }
        }