package com.ym.mec.web.controller;


import com.ym.mec.biz.service.TenantCloudCourseRecordService;
import com.ym.mec.common.controller.BaseController;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 机构云教室课程扣费记录(TenantCloudCourseRecord)表控制层
 *
 * @author hgw
 * @since 2021-12-26 21:53:20
 */
@RestController
@RequestMapping("/tenantCloudCourseRecord")
public class TenantCloudCourseRecordController extends BaseController {
    /**
     * 服务对象
     */
    @Resource
    private TenantCloudCourseRecordService tenantCloudCourseRecordService;


    @ApiImplicitParams({
            @ApiImplicitParam(name = "search", dataType = "String", value = "关键字"),
            @ApiImplicitParam(name = "type", dataType = "String", value = "课程类型"),
            @ApiImplicitParam(name = "teacherName", dataType = "String", value = "上课教师名称"),
            @ApiImplicitParam(name = "teacherId", dataType = "Integer", value = "上课教师id"),
            @ApiImplicitParam(name = "status", dataType = "String", value = "课程状态"),
            @ApiImplicitParam(name = "deductState", dataType = "Integer", value = "扣费状态 0冻结 1扣费 2取消冻结"),
            @ApiImplicitParam(name = "startDate", dataType = "String", value = "课程开始日期-年月日"),
            @ApiImplicitParam(name = "endDate", dataType = "String", value = "课程结束日期-年月日"),
            @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
            @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
    })
    @ApiOperation("分页查询")
    @PostMapping(value = "/queryPage")
    @PreAuthorize("@pcs.hasPermissions('tenantCloudCourseRecord/queryPage')")
    public Object queryPage(@RequestBody Map<String, Object> param) {
        return succeed(tenantCloudCourseRecordService.queryPage(param));
    }

}

