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> 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 getMarketInfo(@PathVariable String id){ return Result.OK(swxBizIndex.getMarketInfo(id)); } @GetMapping("/getContractsByMarket/{mId}") public Result getContractsByMarket(@PathVariable String mId){ return Result.OK(swxBizIndex.getContractsByMarket(mId)); } @GetMapping("/getOptionsByMarket/{mId}") public Result getOptionsByMarket(@PathVariable String mId){ return Result.OK(swxBizIndex.getOptionsByMarket(mId)); } @GetMapping("/getSmartByMarket/{mId}") public Result getSmartByMarket(@PathVariable String mId){ return Result.OK(swxBizIndex.getSmartByMarket(mId)); } @GetMapping("/getKValueByCodeAndDate") public Result> getKValueByCodeAndDate(@RequestParam("code")String code, @RequestParam("dateType")String dateType){ return Result.OK(swxBizIndex.getKValueByCodeAndDate(code,dateType)); } @GetMapping("/getParamByKey/{key}") public Result getParamByKey(@PathVariable String key){ return Result.OK(swxBizIndex.getParamByKey(key)); } @GetMapping("/listContents/{language}") public Result> listContents(@PathVariable Integer language){ return Result.OK(swxBizIndex.listContents(language)); } @GetMapping("/getContentsById/{id}") public Result getContentsById(@PathVariable String id){ return Result.OK(swxBizIndex.getContentsById(id)); } @GetMapping("/listNft") public Result> listNft(){ return Result.OK(swxBizIndex.listNft()); } }