package io.renren.modules.app.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.renren.modules.admin.entity.MeetingEntity;
import io.renren.modules.admin.service.MeetingService;
import io.renren.common.utils.R;

/**
 * 会议表
 *
 * @author huwhois
 * @email huwhois@163.com
 * @date 2020-12-09 14:33:56
 */
@RestController
@RequestMapping("app/meeting")
public class AppMeetingController {
    @Autowired
    private MeetingService meetingService;
    /**
     * 列表
     */
    @GetMapping("/list")
    public R list(){
        List<MeetingEntity> list= meetingService.listByPid(0L);
        return R.ok().put("list", list);
    }

    /**
     * 信息
     */
    @GetMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        MeetingEntity meeting = meetingService.getById(id);

        return R.ok().put("meeting", meeting);
    }

    /**
     * 分会列表
     */
    @GetMapping("/listbranch/{mid}")
    public R listBranch(@PathVariable("mid") Long mid){
        List<MeetingEntity> list= meetingService.listByPid(mid);
        return R.ok().put("list", list);
    }

}
