public IActionResult GetOne([FromBody] PhotoAlbumIdVModel param) { var result = new TResultModel <PhotoAlbumVModel>(1); return(this.Wrapper(ref result, () => { var photoAlbum = _photoAlbumRepository.GetById(param.id); if (photoAlbum == null) { result.ResultNo = -1; result.Message = "未找到该相册"; return; } var category = _photoCategoryRepository.GetById(photoAlbum.CategoryId); result.TModel = new PhotoAlbumVModel() { categoryId = photoAlbum.CategoryId, categoryName = category?.Name, createDate = photoAlbum.CreateDate, description = photoAlbum.Description, id = photoAlbum.Id, img = photoAlbum.Img, isDel = photoAlbum.IsDel, name = photoAlbum.Name, photoNum = photoAlbum.PhotoNum, userId = photoAlbum.UserId }; }, true)); }
public IActionResult Remove([FromBody] PhotoAlbumIdVModel param) { var result = new ResultModel(); return(this.Wrapper(ref result, () => { _photoAlbumRepository.Remove(param.id); }, true)); }