public NoticeItemResponse Item([FromBody] NoticeItemRequest request)
        {
            NoticeItemResponse response = new NoticeItemResponse();

            if (request == null)
            {
                response.Status = -1;
                return(response);
            }

            NoticeEntity entity = null;

            if (request.Id > 0)
            {
                entity = noticeRepository.GetEntityById(request.Id);
            }

            if (entity == null)
            {
                response.Status = 404;
                return(response);
            }

            response.Item = noticeConvertor.ToExtendedVo(entity);

            response.Status = 1;
            return(response);
        }
Example #2
0
        /// <summary>
        /// 转换为数据库请求
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public NoticeGetEntityByPrimaryPropertyRequest ToGetEntityByPrimaryProperty(NoticeItemRequest request)
        {
            NoticeGetEntityByPrimaryPropertyRequest returnValue = new NoticeGetEntityByPrimaryPropertyRequest();


            return(returnValue);
        }