using GxPress.Common.Exceptions;
using GxPress.Result;
using Microsoft.AspNetCore.Mvc;
namespace GxPress.Api.AppControllers
{
public class AppController : ControllerBase
{
public AppResult AppResult { get; set; }
///
///
///
///
///
///
///
public JsonResult JsonResult(bool success, string msg, string msg1)
{
var appJsonData = new AppResult();
if (success)
{
appJsonData.Code = 1;
appJsonData.Msg = msg;
}
else
{
throw new BusinessException(msg1);
}
var json = new JsonResult(appJsonData);
return json;
}
}
}