package tryslim3.controller.crud2;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

import tryslim3.meta.Crud2Meta;
import tryslim3.service.Crud2Service;

public class DeleteController extends Controller {

    private Crud2Service service = new Crud2Service();

    private Crud2Meta meta = Crud2Meta.get();

    @Override
    public Navigation run() throws Exception {
        service.delete(asKey(meta.key), asLong(meta.version));
        return redirect(basePath);
    }
}