Ejemplo n.º 1
0
        public TransactionResult <AppConfig> Add(AppConfig info)
        {
            TransactionResult <AppConfig> result = new TransactionResult <AppConfig>();

            var serviceResult = AppConfigService.Create(info);

            if (serviceResult.ActionResult & serviceResult.HavingData)
            {
                result.Data = serviceResult.Data;
            }
            else
            {
                result.Code    = 103;
                result.Message = "暂无数据";
            }
            return(result);
        }
Ejemplo n.º 2
0
        public ActionResult <ResultModel <AppConfigModel> > Create([FromForm] AppConfigModel model = null)
        {
            var rs = new ResultModel <AppConfigModel>();

            if (model == null)
            {
                model = new AppConfigModel();
            }

            try
            {
                rs.Data = _service.Create(model);
            }
            catch (Exception ex)
            {
                rs.Code    = ex.HResult;
                rs.Message = ex.ToString();
            }

            return(rs);
        }