zj
2025-01-06 0e7b38c2b3af72ea2a7f8a2fcbaad4d78e2c1977
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
package com.gear.customer.swx.controller;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gear.common.constant.SwxConstons;
import com.gear.common.core.redis.RedisCache;
import com.gear.common.vo.Result;
import com.gear.customer.swx.biz.SwxBizIndex;
import com.gear.customer.swx.config.DelayQueueRabbitConfig;
import com.gear.customer.swx.vo.response.SwxContentsVo;
import com.gear.customer.swx.vo.response.SwxIndexMarketInfoVo;
import com.gear.customer.swx.vo.response.SwxIndexQueryMarketVo;
import com.gear.swx.domain.*;
import com.gear.swx.service.ISwxLoanRecordService;
import com.gear.swx.service.ISwxMoneyLogService;
import com.gear.swx.service.ISwxSmartOrderService;
import com.gear.swx.service.ISwxUserService;
import com.gear.swx.vo.SyncKValueFromLdVo;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
 
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
 
@RestController
@RequestMapping("/swx/customer/index")
public class SwxIndexController {
 
    @Autowired
    private SwxBizIndex swxBizIndex;
 
    @Autowired
    RabbitTemplate rabbitTemplate;
 
    @Autowired
    RedisCache redisCache;
 
    @Autowired
    private ISwxLoanRecordService swxLoanRecordService;
 
    @Autowired
    private ISwxUserService swxUserService;
 
    @Autowired
    private ISwxSmartOrderService swxSmartOrderService;
 
    @Autowired
    private ISwxMoneyLogService swxMoneyLogService;
    /**
     * 根据类型查询产品
     * @param type
     * @return
     */
    @GetMapping("/listMarketByType")
    public Result<List<SwxIndexQueryMarketVo>> listMarketByType(@RequestParam(value = "type",required = false)Integer type, @RequestParam(value = "canSmart",required = false)Integer canSamrt){
        return Result.OK(swxBizIndex.listMarketByType(type,canSamrt));
    }
 
 
 
    @GetMapping("/getMessage")
    public String getMessage(@RequestParam(value = "id",required = false)String  id){
        rabbitTemplate.convertAndSend(DelayQueueRabbitConfig.ORDER_EXCHANGE, DelayQueueRabbitConfig.ORDER_ROUTING_KEY, id, message->{
            message.getMessageProperties().setExpiration("3000"+"");
            return message;
        });
        return "ok";
    }
 
 
    @GetMapping("/getMarketInfo/{id}")
    public Result<SwxIndexMarketInfoVo> getMarketInfo(@PathVariable String id){
        return Result.OK(swxBizIndex.getMarketInfo(id));
    }
 
 
    @GetMapping("/getContractsByMarket/{mId}")
    public Result<SwxMarketContracts> getContractsByMarket(@PathVariable String mId){
        return Result.OK(swxBizIndex.getContractsByMarket(mId));
    }
 
    @GetMapping("/getOptionsByMarket/{mId}")
    public Result<SwxMarketOptions> getOptionsByMarket(@PathVariable String mId){
        return Result.OK(swxBizIndex.getOptionsByMarket(mId));
    }
 
    @GetMapping("/getSmartByMarket/{mId}")
    public Result<SwxMarketSmart> getSmartByMarket(@PathVariable String mId){
       return Result.OK(swxBizIndex.getSmartByMarket(mId));
    }
    @GetMapping("/getKValueByCodeAndDate")
    public Result<List<SyncKValueFromLdVo>> getKValueByCodeAndDate(@RequestParam("code")String code, @RequestParam("dateType")String dateType){
        return Result.OK(swxBizIndex.getKValueByCodeAndDate(code,dateType));
    }
 
    @GetMapping("/getParamByKey/{key}")
    public Result<SwxSettings> getParamByKey(@PathVariable String key){
        return Result.OK(swxBizIndex.getParamByKey(key));
    }
 
    @GetMapping("/listContents/{language}")
    public Result<List<SwxContentsVo>> listContents(@PathVariable Integer language){
        return Result.OK(swxBizIndex.listContents(language));
    }
 
    @GetMapping("/getContentsById/{id}")
    public Result<SwxContents> getContentsById(@PathVariable String id){
        return Result.OK(swxBizIndex.getContentsById(id));
    }
 
    @GetMapping("/listNft")
    public Result<List<SwxNft>> listNft(){
        return Result.OK(swxBizIndex.listNft());
    }
 
 
 
}