package com.sqx.modules.errand.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.errand.entity.TrainingCenter;
import com.sqx.modules.errand.service.AdminTrainingCenterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/errand")
@Api(value = "管理端-帮助中心", tags = {"管理端-帮助中心"})
public class AdminTrainingCenterController {

    @Autowired
    private AdminTrainingCenterService adminTrainingCenterService;

    @ApiOperation("帮助中心列表")
    @GetMapping(value = "trainingCenterList")
    public Result trainingCenterList(Integer page, Integer limit, String title, Integer type){

        return adminTrainingCenterService.adminTrainingCenter(page, limit, title, type);
    }

    @ApiOperation("帮助中心详情")
    @GetMapping(value = "TrainingCenter")
    public Result TrainingCenter(Long id){

        return adminTrainingCenterService.TrainingCenter(id);
    }

    @ApiOperation("帮助中心添加")
    @PostMapping(value = "insertAdminTrainingCenter")
    public Result insertAdminTrainingCenter(@RequestBody TrainingCenter trainingCenter){

        return adminTrainingCenterService.insertAdminTrainingCenter(trainingCenter);
    }

    @ApiOperation("帮助中心修改")
    @PostMapping(value = "updateAdminTrainingCenter")
    public Result updateAdminTrainingCenter(@RequestBody TrainingCenter trainingCenter){

        return adminTrainingCenterService.updateAdminTrainingCenter(trainingCenter);
    }

    @ApiOperation("帮助中心删除")
    @PostMapping(value = "deleteAdminTrainingCenter")
    public Result deleteAdminTrainingCenter(Long id){

        return adminTrainingCenterService.deleteAdminTrainingCenter(id);
    }

}
