<commit_before>var DB = require('../../system/db/index.js');
var Error = require('./error.js');

module.exports = {
    getWeld : function (ctx) {
        var _current = ctx.current;
        _current.autoNext = false;

        DB.execute(ctx, 'keyvalue.get', { key : ctx.req.param.key}, function (err, rows) {
            ctx.errorTry(err, err);
            ctx.errorTry(rows.length < 1, Error.NotFound);
            ctx.param.set(ctx.current.module.getMid(), "key", rows[0].uuid.toString());
            _current.next();
        });
    },
    get : function (ctx) {
        var _current = ctx.current;
        _current.autoNext = false;

        DB.execute(ctx, 'keyvalue.get', { key : ctx.req.param.key }, function (err, rows) {
            ctx.errorTry(err, err);
            ctx.errorTry(rows.length < 1, Error.NotFound);

            ctx.res.send({uuid:rows[0].uuid.toString(),  value:rows[0].value});
            _current.next();
        });
    },
    set : function (ctx) {
        var _current = ctx.current;
        _current.autoNext = false;

        ctx.req.data.readKey("value", function() {
            var data = {<commit_msg>KeyValue 모듈 Weld 버그 수정 (key > uuid)<commit_after>var DB = require('../../system/db/index.js');
var Error = require('./error.js');

module.exports = {
    getWeld : function (ctx) {
        var _current = ctx.current;
        _current.autoNext = false;

        DB.execute(ctx, 'keyvalue.get', { key : ctx.req.param.key}, function (err, rows) {
            ctx.errorTry(err, err);
            ctx.errorTry(rows.length < 1, Error.NotFound);
            ctx.param.set(ctx.current.module.getMid(), "uuid", rows[0].uuid.toString());
            _current.next();
        });
    },
    get : function (ctx) {
        var _current = ctx.current;
        _current.autoNext = false;

        DB.execute(ctx, 'keyvalue.get', { key : ctx.req.param.key }, function (err, rows) {
            ctx.errorTry(err, err);
            ctx.errorTry(rows.length < 1, Error.NotFound);

            ctx.res.send({uuid:rows[0].uuid.toString(),  value:rows[0].value});
            _current.next();
        });
    },
    set : function (ctx) {
        var _current = ctx.current;
        _current.autoNext = false;

        ctx.req.data.readKey("value", function() {
            var data = {
{'fraction_non_alphanumeric': 0.1668833983528392, 'fraction_numerical': 0.004334633723450368, 'mean_word_length': 2.061007957559682, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4524554', 'n_tokens_mistral': 736, 'n_tokens_neox': 724, 'n_words': 138}