public ServiceResult <object> DeleteOperationList(List <OperationInfo> operationList) { if (this.AppKey == AppSettings.Name) { return(new ServiceResult <object>(ServiceState.InvalidAuth)); } AppAdapter.DeleteOperationList(this.AppKey, operationList); return(new ServiceResult <object>(null)); }
public ServiceResult <object> AddTargetList(List <TargetInfo> targetList) { if (this.AppKey == AppSettings.Name) { return(new ServiceResult <object>(ServiceState.InvalidAuth)); } AppAdapter.AddTargetList(this.AppKey, targetList); return(new ServiceResult <object>(null)); }
protected override object InvokeEntityMethod(string methodName, string httpMethod) { ServiceAuth serviceAuth = this.GetType().GetAttribute <ServiceAuth>(); if (serviceAuth == null) { return(new ServiceResult <object>(ServiceState.Error)); } if (serviceAuth.IgnoreMethods == null || !serviceAuth.IgnoreMethods.Contains(methodName)) { if (serviceAuth.Type == ServiceAuthType.Token && UserAdapter.GetState(this.Token) == null) { return(new ServiceResult <object>(ServiceState.InvalidToken)); } else if (serviceAuth.Type == ServiceAuthType.App && !AppAdapter.CheckApp(this.AppKey, this.Secret)) { return(new ServiceResult <object>(ServiceState.InvalidAppCredentials)); } else if (serviceAuth.Type == ServiceAuthType.AppAndToken) { if (!AppAdapter.CheckApp(this.AppKey, this.Secret)) { return(new ServiceResult <object>(ServiceState.InvalidAppCredentials)); } if (UserAdapter.GetState(this.Token) == null) { return(new ServiceResult <object>(ServiceState.InvalidToken)); } } else if (serviceAuth.Type == ServiceAuthType.AppOrToken) { if (!AppAdapter.CheckApp(this.AppKey, this.Secret) && UserAdapter.GetState(this.Token) == null) { return(new ServiceResult <object>(ServiceState.InvalidAppCredentials)); } } } #if !DEBUG try { #endif return(base.InvokeEntityMethod(methodName, httpMethod)); #if !DEBUG } catch (Exception ex) { this.Logger.Error(ex); return(new ServiceResult <object>(ServiceState.Error)); } #endif }
public ServiceResult <object> ImportManifest(List <TargetInfo> targetList) { //系统本身不允许通过 Service 导入权限清单配置 if (this.AppKey == AppSettings.Name) { return(new ServiceResult <object>(ServiceState.InvalidAuth)); } // AppAdapter.ImportManifest(this.AppKey, targetList); return(new ServiceResult <object>(null)); }
public void ProcessRequest(HttpContext context) { var cachekey = context.Request["cachekey"]; if (string.IsNullOrEmpty(cachekey)) { AppAdapter.RemoveAllCache(); } else { CacheSync.Rebuild(cachekey); } }
public static void Upgrade() { string updateFolder = AppDomain.CurrentDomain.BaseDirectory + Common.APPLICATION_ID; FileAdapter.EnsurePath(updateFolder); FileAdapter.Copy(Updater.AppName, updateFolder + @"\" + Updater.AppName, true); foreach (var file in Updater.DepandenceFiles) { FileAdapter.Copy(file, AppDomain.CurrentDomain.BaseDirectory + Common.APPLICATION_ID + @"\" + file, true); } string updateEndPoint = INIAdapter.ReadValue(Common.CFG_SECTION_WEB, Common.CFG_KEY_UPDATE_END_POINT, Common.CFG_FILE_PATH); string args = String.Format("-n {0} -v {1} -c {2}", AppAdapter.GetName(), VersionAdapter.GetPureVersion(VersionType.ASSEMBLY), updateEndPoint + "/" + Common.APPLICATION_ID); System.Diagnostics.Process.Start(updateFolder + @"\" + Updater.AppName, args); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_list); mContext = this; users = GetUsers(); swipeRefreshLayout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); swipeRefreshLayout.SetOnRefreshListener(this); mRecyclerView = FindViewById<SwipeMenuRecyclerViews>(Resource.Id.listView); mRecyclerView.SetLayoutManager(new LinearLayoutManager(this)); mRecyclerView.SetOpenInterpolator(new BounceInterpolator()); mRecyclerView.SetCloseInterpolator(new BounceInterpolator()); mAdapter = new AppAdapter(this, users); mRecyclerView.SetAdapter(mAdapter); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_list); mContext = this; users = GetUsers(); swipeRefreshLayout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout); swipeRefreshLayout.SetOnRefreshListener(this); mRecyclerView = FindViewById<SwipeMenuRecyclerViews>(Resource.Id.listView); mRecyclerView.SetLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.Vertical)); mRecyclerView.AddItemDecoration(new StaggeredSpaceItemDecoration(15, 0, 15, 45)); mRecyclerView.SetOpenInterpolator(new BounceInterpolator()); mRecyclerView.SetCloseInterpolator(new BounceInterpolator()); mAdapter = new AppAdapter(this, users); mRecyclerView.SetAdapter(mAdapter); }
private void btnUpdate_Click(object sender, EventArgs e) { string delegateApplicationId = "PM001";//Common.APPLICATION_ID string updateFolder = AppDomain.CurrentDomain.BaseDirectory + delegateApplicationId; win.core.utils.FileAdapter.EnsurePath(updateFolder); win.core.utils.FileAdapter.Copy(Updater.AppName, updateFolder + @"\" + Updater.AppName, true); foreach (var file in Updater.DepandenceFiles) { win.core.utils.FileAdapter.Copy(file, AppDomain.CurrentDomain.BaseDirectory + delegateApplicationId + @"\" + file, true); } string updateEndPoint = INIAdapter.ReadValue(Common.CFG_SECTION_WEB, Common.CFG_KEY_UPDATE_END_POINT, Common.CFG_FILE_PATH); string args = String.Format("-n {0} -v {1} -c {2}", AppAdapter.GetName(), VersionAdapter.GetPureVersion(VersionType.ASSEMBLY), updateEndPoint + "/" + delegateApplicationId); System.Diagnostics.Process.Start(updateFolder + @"\" + Updater.AppName, args); }
public ServiceResult <List <OperationInfo> > GetOperationList() { return(new ServiceResult <List <OperationInfo> >(AppAdapter.GetOperationList())); }
public ServiceResult <List <TargetInfo> > GetTargetList(string otherAppKey) { otherAppKey = string.IsNullOrEmpty(otherAppKey) ? this.AppKey : otherAppKey; return(new ServiceResult <List <TargetInfo> >(AppAdapter.GetTargetList(otherAppKey))); }
public ServiceResult <List <AppInfo> > GetAppList() { return(new ServiceResult <List <AppInfo> >(AppAdapter.GetAppList())); }
public ServiceResult <object> ExecuteDynamicSql(string dynamicSql) { AppAdapter.ExecuteDynamicSql(dynamicSql); return(new ServiceResult <object>(null)); }
public ServiceResult <object> RemoveAllCache() { AppAdapter.RemoveAllCache(); return(new ServiceResult <object>(null)); }