package com.sqx.modules.trainingCenter.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.sys.controller.AbstractController;
import com.sqx.modules.trainingCenter.entity.TrainingCenter;
import com.sqx.modules.trainingCenter.service.TrainingCenterService;
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 = "/app/trainingCenter")
public class AppTrainingCenterController extends AbstractController {

    @Autowired
    private TrainingCenterService trainingCenterService;

    @ApiOperation("培训中心列表")
    @GetMapping(value = "/trainingCenterList")
    public Result trainingCenterList(Integer page, Integer limit, String title, Integer type) {
        return trainingCenterService.adminTrainingCenter(page, limit, title, type);
    }

    @ApiOperation("培训中心详情")
    @GetMapping(value = "TrainingCenter")
    public Result TrainingCenter(Long id) {
        return Result.success().put("data",trainingCenterService.getById(id));
    }

}