New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.feignClient.communityWorldCup.Model.Referee; |
| | | import com.dsh.course.feignClient.communityWorldCup.Model.RefereeList; |
| | | import com.dsh.course.feignClient.communityWorldCup.RefereeClient; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.modular.system.model.Region; |
| | | import com.dsh.guns.modular.system.service.IRegionService; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import groovy.transform.AutoImplement; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 裁判管理 |
| | | * @author zhibing.pu |
| | | * @Date 2024/3/1 14:08 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/referee") |
| | | public class RefereeController { |
| | | |
| | | private String PREFIX = "/system/referee/"; |
| | | |
| | | @Resource |
| | | private RefereeClient refereeClient; |
| | | |
| | | @Autowired |
| | | private IRegionService regionService; |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping("") |
| | | public String showList(){ |
| | | return PREFIX + "referee.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取列表数据 |
| | | * @param refereeList |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/listAll") |
| | | public Object listAll(RefereeList refereeList){ |
| | | return refereeClient.getRefereeList(refereeList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * @param referee |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/addReferee") |
| | | public ResultUtil addReferee(Referee referee){ |
| | | Region region = regionService.getOne(new QueryWrapper<Region>().eq("code", referee.getProvinceCode())); |
| | | referee.setProvince(region.getName()); |
| | | region = regionService.getOne(new QueryWrapper<Region>().eq("code", referee.getCityCode())); |
| | | referee.setCity(region.getName()); |
| | | refereeClient.addReferee(referee); |
| | | return ResultUtil.success(); |
| | | } |
| | | } |