/// <summary> /// Inserts the authorization. /// </summary> /// <param name="clientsid">The clientsid.</param> /// <param name="apilibraryids">The apilibraryids.</param> /// <returns></returns> /// 创建人:李允智 /// 创建时间:2016/2/2 /// 描述:插入权限 public string InsertAuthorization(string clientsid, string apilibraryids) { try { Authorizations authorization = AuthorizationsCore.GetInstance().GetAuthorization(clientsid); if (string.IsNullOrEmpty(apilibraryids)) { AuthorizationsCore.GetInstance().DeleteAuthorization(authorization.id); } else { if (authorization != null) { AuthorizationsCore.GetInstance().DeleteAuthorization(authorization.id); } authorization = new Authorizations(); authorization.apilibraryids = apilibraryids; authorization.clientsid = clientsid; AuthorizationsCore.GetInstance().InsertAuthorization(authorization); } comm.success = true; comm.message = "保存成功"; } catch (Exception) { comm.success = false; comm.message = "保存失败"; } return JsonHelper.SerializeObject(comm); }
public void InsertAuthorization(Authorizations authorization) { MongodbHelper.InsertOne("Authorizations", authorization); }