nickchange
2023-11-01 bbee9271b06ede8c00f795be690835e28a142d4a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package com.dsh.other.controller;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsh.other.entity.*;
import com.dsh.other.feignclient.model.AdvertisementChangeStateDTO;
import com.dsh.other.feignclient.model.AdvertisementQuery;
import com.dsh.other.model.BannerVo;
import com.dsh.other.service.GameService;
import com.dsh.other.service.IBannerService;
import com.dsh.other.service.IRegionService;
import com.dsh.other.service.TGameConfigService;
import com.dsh.other.util.ResultUtil;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
 
/**
 * @author zhibing.pu
 * @date 2023/7/11 17:48
 */
@RestController
@RequestMapping("")
public class BallController {
    @Autowired
    private GameService gameService;
 
    @ResponseBody
    @PostMapping("/student/webStudentList")
    public List<Game> list(@RequestBody BallQueryDto ballQueryDto){
        List<Game> games =   gameService.queryAll(ballQueryDto);
        return games;
    }
 
    @Autowired
    private IRegionService regionService;
 
    @ResponseBody
    @PostMapping("/save")
    public Integer save(@RequestBody Game game){
 
 
        if (game.getCityCode()!=null) {
            Region city = regionService.getOne(new QueryWrapper<Region>().eq("code", game.getCityCode()));
            game.setCity(city.getName());
 
 
            Region province = regionService.getOne(new QueryWrapper<Region>().eq("code", game.getProvinceCode()));
            game.setProvince(province.getName());
 
        }
 
 
        gameService.saveOrUpdate(game);
         System.out.println("==========="+game);
         return  game.getId();
    }
    @Autowired
    private TGameConfigService config;
 
 
    @ResponseBody
    @PostMapping("/saveConfig")
    public void saveConfig(@RequestBody List<TGameConfig> gameConfigList){
        System.out.println("=======gameConfigList===="+gameConfigList);
        config.saveOrUpdateBatch(gameConfigList);
//        return  game.getId();
    }
 
    @ResponseBody
    @PostMapping("/queryGame")
    public Game queryGame(@RequestParam Integer id){
       return gameService.getById(id);
//        return  game.getId();
    }
 
    @ResponseBody
    @PostMapping("/listorder")
    public List<Map<String, Object>>  listorder(@RequestBody BookingQuery bookingQuery){
        System.out.println("===bookingQuery===="+bookingQuery);
        return gameService.orderlist(bookingQuery);
//        return  game.getId();
    }
 
 
 
 
}