package com.hc.web.controller.browser.front;

import com.hc.business.service.ZccmClassConfigSponsorService;
import com.hc.core.utils.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;


/**
 * (ZccmClassConfigSponsor)表控制层
 *
 * @author java
 * @since 2021-05-28 14:11:29
 */

@RestController
@RequestMapping("/new/api/front/classConfigSponsor")
public class FrontClassConfigSponsorController {

    /**
     * 服务对象
     */
    private final ZccmClassConfigSponsorService classConfigSponsorService;

    public FrontClassConfigSponsorController(ZccmClassConfigSponsorService classConfigSponsorService) {
        this.classConfigSponsorService = classConfigSponsorService;
    }

    @GetMapping("/{id}")
    @ApiOperation(value = "依据主键获取 ZccmClassConfigSponsor", response = Result.class)
    public Result selectZccmClassConfigSponsor(@PathVariable("id") Integer id) {
        return Result.success(this.classConfigSponsorService.queryById(id));
    }

    @GetMapping("/list")
    @ApiOperation(value = "获取 ZccmClassConfigSponsor列表(分页)", response = Result.class)
    public Result listZccmClassConfigSponsor(@RequestParam(defaultValue = "0") Integer page,
                                         @RequestParam(defaultValue = "0") Integer size,
                                         @RequestParam(required = false) Integer classId) {
        return Result.success(classConfigSponsorService.queryAllByLimit(page, size, classId));
    }


}
