package com.ym.mec.web.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

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

import com.ym.mec.biz.dal.entity.CourseScheduleRewardsRules;
import com.ym.mec.biz.service.CourseScheduleRewardsRulesService;
import com.ym.mec.common.controller.BaseController;
import com.ym.mec.common.page.QueryInfo;

@RequestMapping("courseSchedule")
@Api(tags = "课程奖励规则")
@RestController
public class CourseScheduleRewardsRulesController extends BaseController {

	@Autowired
	private CourseScheduleRewardsRulesService courseScheduleRewardsRulesService;

	@ApiOperation(value = "查询规则列表")
	@GetMapping("/queryPage")
	public Object queryPage(QueryInfo queryInfo) {
		return succeed(courseScheduleRewardsRulesService.queryPage(queryInfo));
	}

	@ApiOperation(value = "单查询")
	@GetMapping("/query")
	public Object query(Integer id) {
		return succeed(courseScheduleRewardsRulesService.get(id));
	}

	@ApiOperation(value = "新增")
	@PostMapping("/add")
	public Object add(CourseScheduleRewardsRules courseScheduleRewardsRules) {
		return succeed(courseScheduleRewardsRulesService.insert(courseScheduleRewardsRules));
	}
}
