<commit_before>package act.fsa.todo;

import act.boot.app.RunApp;
import org.bson.types.ObjectId;
import org.osgl.mvc.annotation.DeleteAction;
import org.osgl.mvc.annotation.GetAction;
import org.osgl.mvc.annotation.PostAction;
import org.osgl.mvc.annotation.PutAction;
import org.osgl.mvc.result.Result;
import org.osgl.util.C;

import javax.inject.Inject;
import java.util.List;

import static act.controller.Controller.Util.ok;
import static act.controller.Controller.Util.render;

/**
 * Demonstrate Job annotations
 */
public class TodoApp {

    @Inject
    public TodoItemDao dao;

    public TodoApp() {
        //logger.info(new RuntimeException(), "JobApp initialized");
    }

    @GetAction("/")
    public Result home() {
        return render();
    }

    @GetAction("/list")
    public Result list() {
        List<TodoItem> list = C.list(dao.findAll());
        return render(list);
    }

    @PostAction("/list")
    public Result add(String desc) {
        TodoItem item = new TodoItem(desc);
        dao.save(item);
        return ok();
    }

    @DeleteAction("/list/{id}")<commit_msg>make dao injection be private<commit_after>package act.fsa.todo;

import act.boot.app.RunApp;
import org.bson.types.ObjectId;
import org.osgl.mvc.annotation.DeleteAction;
import org.osgl.mvc.annotation.GetAction;
import org.osgl.mvc.annotation.PostAction;
import org.osgl.mvc.annotation.PutAction;
import org.osgl.mvc.result.Result;
import org.osgl.util.C;

import javax.inject.Inject;
import java.util.List;

import static act.controller.Controller.Util.ok;
import static act.controller.Controller.Util.render;

/**
 * Demonstrate Job annotations
 */
public class TodoApp {

    @Inject
    private TodoItemDao dao;

    @GetAction("/")
    public Result home() {
        return render();
    }

    @GetAction("/list")
    public Result list() {
        List<TodoItem> list = C.list(dao.findAll());
        return render(list);
    }

    @PostAction("/list")
    public Result add(String desc) {
        TodoItem item = new TodoItem(desc);
        dao.save(item);
        return ok();
    }

    @DeleteAction("/list/{id}")
{'fraction_non_alphanumeric': 0.13261480787253982, 'fraction_numerical': 0.0, 'mean_word_length': 3.2110453648915187, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5997779', 'n_tokens_mistral': 704, 'n_tokens_neox': 698, 'n_words': 141}