Exemplo n.º 1
0
        public IActionResult publickey()
        {
            var rsa = bs.rsaGenerate();

            bs.S <bs.RSAKeyPair>("rsa", rsa);
            return(Json(rsa.getPublicInfo()));
        }
Exemplo n.º 2
0
        public Dictionary <string, object> _list(ActionExecutingContext c)
        {
            var j = bs.reqJson(c.HttpContext.Request); //{"r":3}
            var k = bs.reqPath(c.HttpContext.Request); //professor/contents/contents/list

            if (!bs.S <bool>(k))
            {
                bs.S(k, true);
                bs.msg(k + "/r", (value, rule, arg, safe) => "정수값을 입력하세요.");
                bs.vali(k, "r", "int:" + k + "/r"); //contree_rowid
            }
            var result = bs.valiResult();

            if (!bs.vali(k).check(out result, bs.json2kv(j, "r")))
            {
                bs.s("valiError", result);
                return(null);
            }
            else
            {
                return(new Dictionary <string, object>()
                {
                    { "contree_rowid", result["r"].value }
                });
            }
        }
Exemplo n.º 3
0
        public Dictionary <string, object> _add(ActionExecutingContext c)
        {
            var j = bs.reqJson(c.HttpContext.Request); //{"cmps_r":3, "username":"******"}
            var k = bs.reqPath(c.HttpContext.Request); //professor/add

            if (!bs.S <bool>(k))
            {
                bs.S(k, true);
                bs.msg(k + "/cmps_r", (value, rule, arg, safe) => "정수값을 입력하세요.");
                bs.msg(k + "/username", (value, rule, arg, safe) => "잘못된 형식의 이름입니다.");
                bs.vali(k, "cmps_r", "int:" + k + "/cmps_r", "username", "min[1]|max[10]");
            }
            var result = bs.valiResult();

            if (!bs.vali(k).check(out result, bs.json2kv(j, "cmps_r", "username")))
            {
                bs.s("valiError", result);
                return(null);
            }
            else
            {
                return(new Dictionary <string, object>()
                {
                    { "cmps_rowid", result["cmps_r"].value },
                    { "username", result["username"].value }
                });
            }
        }
Exemplo n.º 4
0
        public ContentsController(bs b)
        {
            bs = b;
            //문서 파일
            string con10CheckKey = "ContentsController/upfileFilter/con10Check";

            if (bs.S(con10CheckKey) == null)
            {
                bs.S(con10CheckKey, true);
                bs.upfileFilterAdd("con10Check", (Stream data, string ext) => {
                    return(data);
                });
            }

            //동영상 파일
        }