MatchDictController.java 2.64 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.model.MatchDictDO;
import com.subsidy.service.MatchDictService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;

/**
 * <p>
 * 赛事年份管理 前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2025-01-07
 */
@RestController
@Api(tags = "赛事年份管理")
@RequestMapping("/matchDict")
public class MatchDictController {

    @Autowired
    private MatchDictService matchDictService;

    @PostMapping("matches")
    @ApiOperation("查询赛事 matchName ")
    public ResponseVO matches(@RequestBody MatchDictDO matchDictDO){
        return ResponseData.generateCreatedResponse(0,matchDictService.matches(matchDictDO));
    }

    @PostMapping("addMatch")
    @ApiOperation("新增赛事 matchName year startTime endTime status vodStartTime vodEndTime")
    public ResponseVO addMatch(@RequestBody MatchDictDO matchDictDO){
        return ResponseData.generateCreatedResponse(0,matchDictService.addMatch(matchDictDO));
    }

    @PostMapping("deleteMatch")
    @ApiOperation("删除赛事 id ")
    public ResponseVO deleteMatch(@RequestBody MatchDictDO matchDictDO){
        return ResponseData.generateCreatedResponse(0,matchDictService.deleteMatch(matchDictDO));
    }

    @PostMapping("updateMatch")
    @ApiOperation("修改赛事 id match startTime endTime  vodStartTime  vodEndTime  fileStartTime fileEndTime ")
    public ResponseVO updateMatch(@RequestBody MatchDictDO matchDictDO){
        return ResponseData.generateCreatedResponse(0,matchDictService.updateMatch(matchDictDO));
    }

    @PostMapping("openMatch")
    @ApiOperation("开启赛事  id ")
    public ResponseVO openMatch(@RequestBody MatchDictDO matchDictDO){
        return ResponseData.generateCreatedResponse(0,matchDictService.openMatch(matchDictDO));
    }

    @PostMapping("openedMatch")
    @ApiOperation("查看开启的赛事")
    public ResponseVO openedMatch(){
        return ResponseData.generateCreatedResponse(0,matchDictService.openedMatch());
    }

    @PostMapping("openOneMatch")
    @ApiOperation("查询单个赛事  id 赛事id")
    public ResponseVO openOneMatch(@RequestBody MatchDictDO matchDictDO){
        return ResponseData.generateCreatedResponse(0,matchDictService.openOneMatch(matchDictDO));
    }




}