| | |
| | | package com.xcong.excoin.modules.contract.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.xcong.excoin.common.controller.BaseController; |
| | | import com.xcong.excoin.common.entity.FebsConstant; |
| | | import com.xcong.excoin.common.entity.FebsResponse; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.contract.service.ICoinService; |
| | | import com.xcong.excoin.modules.contract.vo.CoinVo; |
| | | import com.xcong.excoin.system.entity.User; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2020-06-16 |
| | | **/ |
| | | public class CoinController { |
| | | @Slf4j |
| | | @Validated |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping(value = "/coin") |
| | | public class CoinController extends BaseController { |
| | | |
| | | private final ICoinService coinService; |
| | | |
| | | @GetMapping("buyList") |
| | | public FebsResponse buyList(CoinVo coinVo, QueryRequest request) { |
| | | User user = getCurrentUser(); |
| | | if (user.getType().equals(FebsConstant.USER_TYPE_ADMIN)) { |
| | | coinVo.setRefererId(FebsConstant.DEFAULT_REFERER_ID); |
| | | } else { |
| | | coinVo.setRefererId(user.getInviteId()); |
| | | } |
| | | Map<String, Object> data = getDataTable(coinService.findBuyList(coinVo, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | public FebsResponse saleList() { |
| | | return null; |
| | | } |
| | | } |