package com.ym.mec.web.controller.system;

import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
import com.ym.mec.biz.service.VipGroupService;
import com.ym.mec.common.controller.BaseController;

/**
 * @Author Joburgess
 * @Date 2019/9/21
 */
@Api(tags = "vip课")
@RequestMapping("vipGroupManage")
@RestController
public class VipGroupManageController extends BaseController {

    @Autowired
    private VipGroupService vipGroupService;

    @ApiOperation("vip课申请")
    @PostMapping("/vipGroupApply")
    public Object vipGroupApply(@RequestBody VipGroupApplyDto vipGroupApplyDto){
        vipGroupService.createVipGroup(vipGroupApplyDto);
        return succeed();
    }

    @ApiOperation("vip课详情")
    @GetMapping("/getVipGroupDetail/{vipGroupId}")
    public Object getVipGroupDetail(@PathVariable("vipGroupId") Long vipGroupId){
        return succeed(vipGroupService.getVipGroupDetail(vipGroupId));
    }

    @ApiOperation("获取vip课考勤记录")
    @PostMapping("/getVipGroupAttendances")
    public Object getVipGroupAttendances(@RequestBody VipGroupAttendanceQueryInfo queryInfo){
        return succeed(vipGroupService.findVipGroupAttendances(queryInfo));
    }
}
