Ejemplo n.º 1
0
        public async Task OnGetAsync(long id)
        {
            Dto = await _service.GetByIdAsync(id);

            if (Dto == null)
            {
                throw new KuDataNotFoundException();
            }
        }
Ejemplo n.º 2
0
        public async Task <JsonResult> Post(string appkey, string content)
        {
            if (string.IsNullOrEmpty(content))
            {
                throw new KuArgNullException("反馈内容不能为空!");
            }
            //取得应用信息
            var app = await _appService.GetByAppkeyAsync(appkey);

            if (app == null)
            {
                throw new KuDataNotFoundException("无法取得应用信息!");
            }

            AppFeedbackDto dto = new AppFeedbackDto {
                AppId        = app.Id,
                Content      = content,
                ProviderName = "测试"
            };
            await _service.SaveAsync(dto);

            return(Json(true));
        }