Helius
2021-06-03 a3f86d22b6b9d5ab4a335488ddaf8edf3aa5f787
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
package com.xcong.excoin.modules.documentary.controller;
 
import java.util.Map;
 
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
 
import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
import com.xcong.excoin.modules.trademanage.entity.ContractOrderEntity;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
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.documentary.dto.ModifyProfitRatioDto;
import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
import com.xcong.excoin.modules.documentary.entity.FollowTraderLabelEntity;
import com.xcong.excoin.modules.documentary.service.DocumentaryService;
import com.xcong.excoin.modules.systemSetting.entity.PlatformBannerEntity;
 
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
 
@Slf4j
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/documentary")
public class DocumentaryController extends BaseController {
    
    private final DocumentaryService documentaryService;
    
    /**
     * 标签---列表
     * @return
     */
    @GetMapping("traderLabelList")
    public FebsResponse traderLabelList(FollowTraderLabelEntity followTraderLabelEntity, QueryRequest request) {
        Map<String, Object> data = getDataTable(documentaryService.traderLabelList(followTraderLabelEntity, request));
        return new FebsResponse().success().data(data);
    }
    
    /**
     * 标签---删除
     * @return
     */
    @GetMapping("traderLabelDelete/{id}")
    @ControllerEndpoint(operation = "标签---删除", exceptionMessage = "删除失败")
    public FebsResponse traderLabelDelete(@NotNull(message = "{required}") @PathVariable Long id) {
        return documentaryService.traderLabelDelete(id);
    }
    
    /**
     * 标签---新增
     */
    @PostMapping("followLabelSetAdd")
    @ControllerEndpoint(operation = "标签---新增", exceptionMessage = "新增失败")
    public FebsResponse followLabelSetAdd(@Valid FollowTraderLabelEntity followTraderLabelEntity) {
        documentaryService.followLabelSetAdd(followTraderLabelEntity);
        return new FebsResponse().success();
    }
    
    /**
     * 标签---修改
     */
    @PostMapping("followLabelSetUpdate")
    @ControllerEndpoint(operation = "标签---修改", exceptionMessage = "修改失败")
    public FebsResponse followLabelSetUpdate(@Valid FollowTraderLabelEntity followTraderLabelEntity) {
        documentaryService.followLabelSetUpdate(followTraderLabelEntity);
        return new FebsResponse().success();
    }
    
    /**
     * 交易员申请---列表
     * @return
     */
    @GetMapping("traderList")
    public FebsResponse traderList(FollowTraderInfoEntity followTraderInfoEntity, QueryRequest request) {
        Map<String, Object> data = getDataTable(documentaryService.findTraderListInPage(followTraderInfoEntity, request));
        return new FebsResponse().success().data(data);
    }
    
    /**
     * 交易员申请---确认
     * @return
     */
    @PostMapping("traderConfirm")
    @ControllerEndpoint(operation = "交易员申请---确认", exceptionMessage = "认证失败")
    public FebsResponse traderConfirm(@Valid FollowTraderInfoDto followTraderInfoDto) {
        return documentaryService.traderConfirm(followTraderInfoDto);
    }
 
    /**
     * 交易员收益率修改---确认
     * @return
     */
    @PostMapping("modifyProfitRatio")
    @ControllerEndpoint(operation = "交易员收益率修改---确认", exceptionMessage = "修改失败")
    public FebsResponse modifyProfitRatio(@Valid ModifyProfitRatioDto modifyProfitRatioDto) {
        return documentaryService.modifyProfitRatio(modifyProfitRatioDto);
    }
    
    /**
     * 踢出交易员
     * @param id
     * @return
     */
    @GetMapping("traderGetOut/{id}")
    @ControllerEndpoint(operation = "踢出交易员", exceptionMessage = "踢出失败")
    public FebsResponse traderGetOut(@NotNull(message = "{required}") @PathVariable Long id) {
        return documentaryService.traderGetOut(id);
    }
    /**
     * 设置成首页交易员
     * @param id
     * @return
     */
    @GetMapping("traderGetOn/{id}")
    @ControllerEndpoint(operation = "设置成首页交易员", exceptionMessage = "设置失败")
    public FebsResponse traderGetOn(@NotNull(message = "{required}") @PathVariable Long id) {
        return documentaryService.traderGetOn(id);
    }
    /**
     * 设置成首页交易员---取消
     * @param id
     * @return
     */
    @GetMapping("traderGetOutFrist/{id}")
    @ControllerEndpoint(operation = "设置成首页交易员", exceptionMessage = "设置失败")
    public FebsResponse traderGetOutFrist(@NotNull(message = "{required}") @PathVariable Long id) {
        return documentaryService.traderGetOutFrist(id);
    }
    
    /**
     * 设置成【满员】状态
     * @param id
     * @return
     */
    @GetMapping("traderGetFull/{id}")
    @ControllerEndpoint(operation = "设置成【满员】状态", exceptionMessage = "设置失败")
    public FebsResponse traderGetFull(@NotNull(message = "{required}") @PathVariable Long id) {
        return documentaryService.traderGetFull(id);
    }
 
    /**
     * 交易员数据---列表---交易员利润分成
     */
    @GetMapping("traderProfitInfo")
    public FebsResponse traderProfitInfo(FollowTraderProfitInfoEntity followTraderProfitInfoEntity, QueryRequest request) {
        Map<String, Object> data = getDataTable(documentaryService.findTraderProfitInfoInfoInPage(followTraderProfitInfoEntity, request));
        return new FebsResponse().success().data(data);
    }
 
    /**
     * 交易员数据---列表---跟单数据详情
     */
    @GetMapping("/seeFollowerInfo")
    public FebsResponse seeFollowerInfo(QueryRequest request, FollowTraderProfitInfoEntity followTraderProfitInfoEntity,Integer parentId) {
        if(parentId==null){
            ViewController.idFromMember=0;
        }
        followTraderProfitInfoEntity.setId(ViewController.idFromMember);
        Map<String, Object> dataTable = getDataTable(documentaryService.findlistSeeFollowerInfo(request, followTraderProfitInfoEntity));
        return new FebsResponse().success().data(dataTable);
    }
 
}