Package wbbs.web

Source Code of wbbs.web.index

package wbbs.web;

import cn.webwheel.Action;
import cn.webwheel.results.TemplateResult;
import com.google.inject.Inject;
import wbbs.domain.Board;
import wbbs.domain.BoardCategory;
import wbbs.service.BoardService;

import java.sql.SQLException;
import java.util.List;

public class index extends BaseAction {

    @Inject
    BoardService boardService;

    List<BoardCategory> categories;

    @Action
    public Object html() throws SQLException {
        categories = boardService.listCategories();
        for (BoardCategory category : categories) {
            for (Board board : category.boards) {
                board.masters.clear();
                for (String uid : board.masterIds) {
                    board.masters.add(userService.findUser(uid));
                }
            }
        }
        return new TemplateResult(this);
    }

    public List<BoardCategory> getCategories() throws SQLException {
        return boardService.listCategories();
    }
}
TOP

Related Classes of wbbs.web.index

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.