Example #1
0
        public APIResult GetAppSettings([FromBody] GetAppSettingsArgsModel args)
        {
            try
            {
                var username      = GetUsername();
                var communityFlag = args.CurrentCommunityFlag;
                var appFlag       = args.CurrentAppFlag;

                var community = _communityService.GetSingle(communityFlag);

                //从群组中获得应用
                var app = community.Apps.Where(m => m.Flag == appFlag).FirstOrDefault();
                if (app == null)
                {
                    throw new Exception("应用不存在");
                }

                return(Success(app.AppSettings));
            }
            catch (Exception ex)
            {
                _logger.LogError(0, ex, "GetAppSettings有错误发生");
                return(Error(ex.Message));
            }
        }
Example #2
0
        public APIResult <CommunityAppSettings> GetAppSettings([FromBody] GetAppSettingsArgsModel args)
        {
            var username      = GetUsername();
            var communityFlag = args.CommunityFlag;
            var appFlag       = args.AppFlag;

            var community = _communityService.GetSingle(communityFlag);

            checkIsManager(community, username);

            //从群组中获得应用
            var app = community.Apps.Where(m => m.Flag == appFlag).FirstOrDefault();

            if (app == null)
            {
                throw new Exception("应用不存在");
            }

            return(Success(app.AppSettings));
        }