添加controller

This commit is contained in:
tiger_zhou 2024-02-18 15:12:16 +08:00
parent d278c01d3b
commit 740dcefb4c
6 changed files with 289 additions and 0 deletions

View File

@ -0,0 +1,40 @@
package club.joylink.rtss.controller.race;
import club.joylink.rtss.services.race.RaceModuleServicce;
import club.joylink.rtss.util.JsonUtils;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.race.RaceModule;
import club.joylink.rtss.vo.race.RaceModule.RaceModuleCreateVO;
import club.joylink.rtss.vo.race.RaceModule.RaceModuleQueryVO;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 竞赛-模块管理
*/
@RestController
@RequestMapping("/api/exercise/race/module")
public class RaceModuleController {
@Autowired
private RaceModuleServicce moduleServicce;
@PostMapping
public void saveOrUpdate(@RequestBody RaceModuleCreateVO dto, @RequestAttribute AccountVO user) {
this.moduleServicce.saveOrUpdate(dto, user);
}
@GetMapping("/page")
public PageVO<?> page(RaceModuleQueryVO vo) {
return null;
}
}

View File

@ -0,0 +1,58 @@
package club.joylink.rtss.controller.race;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.race.RacePaperService;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.race.RacePaper.RacePaperCreateVO;
import club.joylink.rtss.vo.race.RacePaper.RacePaperQueryVO;
import java.util.List;
import org.simpleframework.xml.ElementArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 竞赛-试题管理
*/
@RestController
@RequestMapping("/api/exercise/race/pager")
public class RacePaperController {
@Autowired
private RacePaperService racePaperService;
/**
* 创建试卷
*/
@PostMapping()
public void create(@RequestBody RacePaperCreateVO createVO, @RequestAttribute AccountVO user) {
racePaperService.create(createVO, user);
}
/**
* 分页查询
*/
@GetMapping("/page")
public PageVO<?> pageQuery(RacePaperQueryVO queryVO) {
return racePaperService.pageQuery(queryVO);
}
/**
* 删除
*/
@DeleteMapping("/{id}")
public void delete(@PathVariable("id") Long id) {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(id);
racePaperService.delete(id);
}
}

View File

@ -0,0 +1,50 @@
package club.joylink.rtss.controller.race;
import club.joylink.rtss.services.race.RaceSceneService;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceSceneCreateVO;
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceSceneQueryVO;
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceSceneVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 竞赛-场景管理
*/
@RestController
@RequestMapping("/api/exercise/race/scene")
public class RaceSceneController {
@Autowired
private RaceSceneService sceneService;
@PostMapping
public void saveOrUpdate(@RequestBody RaceSceneCreateVO dto, @RequestAttribute AccountVO user) {
this.sceneService.saveOrUpdate(dto, user);
}
@GetMapping("/page")
public PageVO<RaceSceneVO> page(RaceSceneQueryVO query) {
return this.sceneService.page(query);
}
@DeleteMapping("/{id}")
public void delete(@PathVariable("id") Long id) {
}
@PutMapping("/{id}")
public void publish(@PathVariable("id") Long id) {
}
}

View File

@ -0,0 +1,44 @@
package club.joylink.rtss.controller.race;
import club.joylink.rtss.services.race.RaceScoreRuleService;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.race.RaceScoringRule.RaceScoringRuleCreateVO;
import club.joylink.rtss.vo.race.RaceScoringRule.RaceScoringRuleQueryVO;
import club.joylink.rtss.vo.race.RaceScoringRule.RaceScoringRuleVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 竞赛-评分
*/
@RestController
@RequestMapping("/api/exercise/race/score")
public class RaceScoreRuleController {
@Autowired
private RaceScoreRuleService scoreRuleService;
@PostMapping
public void saveOrUpdate(@RequestBody RaceScoringRuleCreateVO vo, @RequestAttribute AccountVO user) {
this.scoreRuleService.saveOrUpdate(vo, user);
}
@GetMapping("/page")
public PageVO<RaceScoringRuleVO> page(RaceScoringRuleQueryVO query) {
return this.scoreRuleService.page(query);
}
@DeleteMapping("{id}")
public void delete(@PathVariable("id") Long id) {
this.scoreRuleService.delete(id);
}
}

View File

@ -0,0 +1,50 @@
package club.joylink.rtss.controller.race;
import club.joylink.rtss.services.race.RaceSeasonService;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.race.RaceSeasonOuterClass.RaceSeasonCreateVO;
import club.joylink.rtss.vo.race.RaceSeasonOuterClass.RaceSeasonQueryVO;
import club.joylink.rtss.vo.race.RaceSeasonOuterClass.RaceSeasonVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 竞赛-赛季管理
*/
@RestController
@RequestMapping("/api/exercise/race/season")
public class RaceSeasonController {
@Autowired
private RaceSeasonService raceSeasonService;
/**
* 添加编辑
*
* @param dto
* @param user
*/
@PostMapping
public void saveOrUpdate(@RequestBody RaceSeasonCreateVO dto, @RequestAttribute AccountVO user) {
this.raceSeasonService.saveOrUpdate(dto, user);
}
/**
* 查找
*
* @param query
* @return
*/
@GetMapping("/page")
public PageVO<RaceSeasonVO> page(RaceSeasonQueryVO query) {
return raceSeasonService.page(query);
}
}

View File

@ -0,0 +1,47 @@
package club.joylink.rtss.controller.race;
import club.joylink.rtss.services.race.RaceTaskService;
import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.race.RaceTask.RaceTaskBind;
import club.joylink.rtss.vo.race.RaceTask.RaceTaskCreateVO;
import club.joylink.rtss.vo.race.RaceTask.RaceTaskQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/exercise/race/task")
public class RaceTaskController {
@Autowired
private RaceTaskService taskService;
@PostMapping
public void saveOrUpdate(@RequestBody RaceTaskCreateVO vo, @RequestAttribute AccountVO user) {
this.taskService.saveOrUpdate(vo, user);
}
@GetMapping("/page")
public PageVO<?> page(RaceTaskQuery query) {
return this.taskService.page(query);
}
@PutMapping("/bind")
public void bindRule(@RequestBody RaceTaskBind bind) {
this.taskService.bindRule(bind);
}
@DeleteMapping("/{id}")
public void delete(@PathVariable("id") Long id) {
this.taskService.delete(id);
}
}