示例#1
0
 public ExcutedResult Edit([FromBody] TokenEditModel model)
 {
     try
     {
         var result = _tokensLogic.Edit(model);
         return(result);
     }
     catch (BusinessException businessException)
     {
         return(ExcutedResult.FailedResult(businessException.ErrorCode, businessException.Message));
     }
 }
示例#2
0
        /// <summary>
        /// 更新Token
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ExcutedResult Edit(TokenEditModel model)
        {
            Tokens entity = GetById(model.Id);

            if (entity == null)
            {
                return(ExcutedResult.FailedResult(BusinessResultCode.DataNotExist, "数据不存在,请刷新!"));
            }
            entity.Name      = model.Name;
            entity.Symbol    = model.Symbol;
            entity.Issuer    = model.Issuer;
            entity.Precision = model.Precision;
            entity.Desc      = model.Desc;
            entity.Logo      = model.Logo;
            entity.Order     = model.Order;
            entity.IsSystem  = model.IsSystem;
            entity.Contract  = model.Contract;
            Update(entity, out var result);
            return(result);
        }