コード例 #1
0
        public IHttpActionResult Query()
        {
            try
            {
                var request = Context.GetCurrentRequest();
                var siteId  = request.GetQueryInt("siteId");

                var isOrganization = request.GetPostBool("isOrganization");
                var civicName      = request.GetPostString("civicName");
                var orgName        = request.GetPostString("orgName");
                var queryCode      = request.GetPostString("queryCode");

                var dataInfo = DataDao.Query(siteId, isOrganization, civicName, orgName, queryCode);
                if (dataInfo == null)
                {
                    return(NotFound());
                }

                var fileInfoList = new List <FileInfo>();
                if (dataInfo.IsReplyFiles)
                {
                    fileInfoList = FileDao.GetFileInfoList(siteId, dataInfo.Id);
                }

                return(Ok(new
                {
                    Value = dataInfo,
                    FileInfoList = fileInfoList
                }));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }