xiaoyong931011
2021-11-26 985b96889f292288405f0fc5241b78abbe9c67d1
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
package com.xcong.excoin.modules.fish.controller;
 
import com.xcong.excoin.common.annotation.ControllerEndpoint;
import com.xcong.excoin.common.controller.BaseController;
import com.xcong.excoin.common.entity.FebsResponse;
import com.xcong.excoin.common.entity.QueryRequest;
import com.xcong.excoin.modules.documentary.dto.FollowTraderInfoDto;
import com.xcong.excoin.modules.fish.entity.CannonAccountMoneyChange;
import com.xcong.excoin.modules.fish.entity.CannonExchangeRatio;
import com.xcong.excoin.modules.fish.entity.CannonSetting;
import com.xcong.excoin.modules.fish.service.FishService;
import com.xcong.excoin.modules.systemSetting.entity.PlatformBannerEntity;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.validation.Valid;
import java.util.Map;
 
@Slf4j
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/fish")
public class FishController extends BaseController {
 
    private final FishService fishService;
 
    /**
     * 操作记录---列表
     * @return
     */
    @GetMapping("accountList")
    public FebsResponse accountList(CannonAccountMoneyChange cannonAccountMoneyChange, QueryRequest request) {
        Map<String, Object> data = getDataTable(fishService.accountList(cannonAccountMoneyChange, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 兑换比例设置---列表
     * @return
     */
    @GetMapping("exchangeRatio")
    public FebsResponse exchangeRatio(CannonExchangeRatio cannonExchangeRatio, QueryRequest request) {
        Map<String, Object> data = getDataTable(fishService.exchangeRatio(cannonExchangeRatio, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 兑换比例设置---更新
     * @return
     */
    @PostMapping("exchangeRatioUpdate")
    @ControllerEndpoint(operation = "兑换比例设置---更新", exceptionMessage = "操作失败")
    public FebsResponse exchangeRatioUpdate(@Valid CannonExchangeRatio cannonExchangeRatio) {
        return fishService.exchangeRatioUpdate(cannonExchangeRatio);
    }
 
    /**
     * 炮台设置---列表
     * @return
     */
    @GetMapping("cannonList")
    public FebsResponse cannonList(CannonSetting cannonSetting, QueryRequest request) {
        Map<String, Object> data = getDataTable(fishService.cannonList(cannonSetting, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 炮台设置---新增
     */
    @PostMapping("cannonAdd")
    @ControllerEndpoint(operation = "炮台设置---新增", exceptionMessage = "新增失败")
    public FebsResponse cannonAdd(@Valid CannonSetting cannonSetting) {
        fishService.cannonAdd(cannonSetting);
        return new FebsResponse().success();
    }
 
    /**
     * 炮台设置---更新
     * @return
     */
    @PostMapping("cannonUpdate")
    @ControllerEndpoint(operation = "炮台设置---更新", exceptionMessage = "操作失败")
    public FebsResponse cannonUpdate(@Valid CannonSetting cannonSetting) {
        return fishService.cannonUpdate(cannonSetting);
    }
}