Exemplo n.º 1
0
 public void write(BmobOutput output, Boolean all)
 {
     foreach (var entry in this)
     {
         output.Put(entry.Key, entry.Value);
     }
 }
Exemplo n.º 2
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put("mobilePhoneNumber", mobilePhoneNumber);
            output.Put("template", template);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 查询条件序列化对象
        ///
        /// 将请求封装为JSON发送到Bmob服务器中
        /// </summary>
        /// <param name="output"></param>
        /// <param name="all">是否输出所有的字段的值!请求的json是all为false。用于toString!</param>
        public override void write(BmobOutput output, Boolean all)
        {
            if (this.include != null)
            {
                output.Put("include", this.include);
            }
            if (this.count)
            {
                output.Put("count", this.count);
            }
            if (this.skip != 0)
            {
                output.Put("skip", this.skip);
            }
            if (this.limit != null)
            {
                output.Put("limit", this.limit);
            }

            if (keys != null && keys.Count > 0)
            {
                output.Put("keys", this.keys.join());
            }
            if (fOrderList.Count > 0)
            {
                output.Put("order", fOrderList.join());
            }
            if (_where != null && _where.Length() > 0)
            {
                output.Put("where", _where);
            }
        }
Exemplo n.º 4
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put(OP_NAME, "AddUnique");
            output.Put("objects", this.objects);
        }
Exemplo n.º 5
0
 public override void write(BmobOutput output, bool all)
 {
     base.write(output, all);
     output.Put(TYPE_NAME, this._type);
     output.Put("filename", this.filename);
     output.Put("group", this.group);
     output.Put("url", this.url);
 }
Exemplo n.º 6
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put(TYPE_NAME, this._type);
            output.Put("className", this.className);
            output.Put("objectId", refObjectId);
        }
Exemplo n.º 7
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put("name", this.name);
            output.Put("users", this.users);
            output.Put("roles", this.roles);
        }
Exemplo n.º 8
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put("where", Target.where);
            output.Put("data", Message);

            output.Put("expiration_time", ExpirationTime);

            output.Put("push_time", PushTime);
            output.Put("expiration_interval", ExpirationInterval);
        }
Exemplo n.º 9
0
        public override void write(BmobOutput output, Boolean all)
        {
            base.write(output, all);

            if (all)
            {
                output.Put("sessionToken", this.sessionToken);
            }

            output.Put("username", this.username);
            output.Put("password", this.password);
            output.Put("email", this.email);
        }
Exemplo n.º 10
0
        /// <summary>
        /// 实现 {column: {key: value}} 的效果
        /// </summary>
        internal static void Composite(IDictionary data, String column, String key, Object value)
        {
            var part = data[column];

            if (part == null || !(part is IDictionary))
            {
                // !!SimpleJson处理Dictionary<string, Object>才正常
                part = new Dictionary <String, Object>();
            }
            ((IDictionary)part).Add(key, value);

            BmobOutput.Save(data, column, part);
        }
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            output.Put("badge", this.badge);
            output.Put("channels", this.channels);
            output.Put("timeZone", this.timeZone);
            output.Put("deviceType", this.deviceType);

            output.Put("installationId", this.installationId);
            output.Put("deviceToken", this.deviceToken);
            output.Put("notificationUri", this.notificationUri);
            output.Put("deviceId", this.deviceId);
        }
Exemplo n.º 12
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            var enumerator = real.GetEnumerator();

            while (enumerator.MoveNext())
            {
                var key   = (string)enumerator.Key;
                var value = enumerator.Value;

                output.Put(key, value);
            }
        }
Exemplo n.º 13
0
        public override void write(BmobOutput output, Boolean all)
        {
            base.write(output, all);

            foreach (var entry in kvs)
            {
                var key = entry.Key;
                if (key == "objectId" || key == "createdAt" || key == "updatedAt")
                {
                    continue;
                }
                output.Put(key, entry.Value);
            }
        }
Exemplo n.º 14
0
        public override void write(BmobOutput output, Boolean all)
        {
            base.write(output, all);
            output.Put("ACL", this.ACL);

            foreach (String key in operates.Keys)
            {
                output.Put(key, (Operate)operates[key]);
            }

            if (all)
            {
                output.Put("objectId", this.objectId);
                output.Put("createdAt", this.createdAt);
                output.Put("updatedAt", this.updatedAt);
            }
        }
Exemplo n.º 15
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            var requests = new List <IDictionary>();

            foreach (BmobInteractObject req in BmobWrapper.Requests)
            {
                String method = req.Method;
                if (method == null)
                {
                    continue;
                }

                // XXX 1.6 根据restful接口优化
                String path = "";
                if (method.Equals("POST"))
                {
                    path = "/1/classes/" + req.Table;
                }
                else if (method.Equals("DELETE") || method.Equals("PUT"))
                {
                    path = "/1/classes/" + req.Table + "/" + req.ObjectId;
                }

                IDictionary one = new Dictionary <String, Object>();

                BmobOutput.Save(one, "method", method);
                if (BmobUser.CurrentUser != null)
                {
                    BmobOutput.Save(one, "token", BmobUser.CurrentUser.sessionToken);
                }
                BmobOutput.Save(one, "path", path);
                BmobOutput.Save(one, "body", req.Data);
                requests.Add(one);
            }

            output.Put("requests", requests);
        }
Exemplo n.º 16
0
        public override void write(BmobOutput output, bool all)
        {
            base.write(output, all);

            if (Mode != null)
            {
                output.Put("mode", Mode);
            }
            if (Width != null)
            {
                output.Put("width", Width);
            }
            if (Height != null)
            {
                output.Put("height", Height);
            }
            if (LongEdge != null)
            {
                output.Put("longEdge", LongEdge);
            }
            if (ShortEdge != null)
            {
                output.Put("shortEdge", ShortEdge);
            }
            if (Quality != null)
            {
                output.Put("quality", Quality);
            }
            if (OutType != null)
            {
                output.Put("outType", OutType);
            }

            if (Image != null)
            {
                output.Put("image", Image);
            }
        }
Exemplo n.º 17
0
 public BmobACL WriteAccess(String objectId)
 {
     BmobOutput.Composite(acls, objectId, "write", true);
     return(this);
 }
Exemplo n.º 18
0
 internal Where Composite(String column, String type, Object value)
 {
     BmobOutput.Composite(real, column, type, value);
     return(this);
 }
Exemplo n.º 19
0
 public Where EqualTo(String column, object value)
 {
     BmobOutput.Save(real, column, value); return(this);
 }
Exemplo n.º 20
0
 public override void write(BmobOutput output, Boolean all)
 {
     output.Put("__op", this.op);
     output.Put("amount", this.amount);
 }
Exemplo n.º 21
0
 /// <summary>
 /// key是objectId(用户表某个用户对应的objectId)或者是 *(表示公共的访问权限),ACL 的值是 "读和写的权限", 这个JSON对象的key总是权限名, 而这些key的值总是 true
 /// </summary>
 public BmobACL ReadAccess(String key)
 {
     BmobOutput.Composite(acls, key, "read", true);
     return(this);
 }
Exemplo n.º 22
0
 public BmobACL WriteAccess(String key)
 {
     BmobOutput.Composite(acls, key, "write", true);
     return(this);
 }
Exemplo n.º 23
0
 internal IBmobOperator handle(String column, Operate op)
 {
     BmobOutput.Save(operates, column, op);
     return(this);
 }
Exemplo n.º 24
0
 public override void write(BmobOutput output, Boolean all)
 {
     output.Put(TYPE_NAME, this._type);
     output.Put("latitude", this.latitude);
     output.Put("longitude", this.longitude);
 }
Exemplo n.º 25
0
 public virtual void write(BmobOutput output, Boolean all)
 {
 }
Exemplo n.º 26
0
 public override void write(BmobOutput output, Boolean all)
 {
     output.Put(TYPE_NAME, this._type);
     output.Put("iso", this.iso);
 }
Exemplo n.º 27
0
 /// <summary>
 /// key是objectId(用户表某个用户对应的objectId)或者是 *(表示公共的访问权限),ACL 的值是 "读和写的权限", 这个JSON对象的key总是权限名, 而这些key的值总是 true
 /// </summary>
 public BmobACL ReadAccess(String objectId)
 {
     BmobOutput.Composite(acls, objectId, "read", true);
     return(this);
 }
Exemplo n.º 28
0
 public BmobACL RoleWriteAccess(String rolename)
 {
     BmobOutput.Composite(acls, "role:" + rolename, "write", true);
     return(this);
 }