示例#1
0
        public async Task <IActionResult> Insert([FromBody] AgencyInfoMeta agencyInfoMeta)
        {
            var result = await _agencyInfoService.Insert(CurrentUser.TenantId, CurrentUser.Id, CurrentUser.FullName, CurrentUser.Avatar, agencyInfoMeta);

            if (result.Code <= 0)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
示例#2
0
        public async Task <JsonResult> AgencyRegister(AgencyMeta agencyMeta)
        {
            if (!ModelState.IsValid)
            {
                return(Json(GetErrorsInModelState()));
            }

            var apiService = _configuration.GetApiServiceInfo();

            var agencyMetaData = JsonConvertHelper.GetObjectFromObject <GHM.WebsiteClient.Api.Domain.ModelMetas.AgencyInfoMeta>(agencyMeta);

            agencyMetaData.TenantId = apiService.TenantId;
            var result = await _agencyInfoService.Insert(CultureInfo.CurrentCulture.Name, agencyMetaData);

            return(Json(result));
        }