package com.sqx.modules.trainingCenter.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.sys.controller.AbstractController;
import com.sqx.modules.tbCoupon.entity.TbCouponUser;
import com.sqx.modules.tbCoupon.service.TbCouponUserService;
import com.sqx.modules.trainingCenter.service.TrainingCenterService;
import com.sqx.modules.trainingCenter.entity.TrainingCenter;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@Api(value = "管理端-指南管理", tags = {"管理端-指南管理"})
@RequestMapping(value = "/trainingCenter")
public class TrainingCenterController extends AbstractController {

    @Autowired
    private TrainingCenterService trainingCenterService;

    @ApiOperation("培训中心")
    @GetMapping(value = "/adminTrainingCenter")
    public Result adminTrainingCenter(Integer page, Integer limit, String title, Integer type) {

        return Result.success().put("data", trainingCenterService.adminTrainingCenter(page, limit, title, type));
    }

    @ApiOperation("培训中心编辑")
    @PostMapping(value = "/updateAdminTrainingCenter")
    public Result updateAdminTrainingCenter(@RequestBody TrainingCenter trainingCenter) {
        return trainingCenterService.updateAdminTrainingCenter(trainingCenter);
    }

    @ApiOperation("培训中心添加")
    @PostMapping(value = "/addAdminTrainingCenter")
    public Result addAdminTrainingCenter(@RequestBody TrainingCenter trainingCenter) {

        return trainingCenterService.addAdminTrainingCenter(trainingCenter);
    }



}