xiaoyong931011
2020-07-29 16a21995026ebf2b5853c5dee4b5a30a26e13abd
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
package com.xcong.excoin.modules.documentary.service.impl;
 
import javax.annotation.Resource;
 
import org.springframework.stereotype.Service;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xcong.excoin.common.LoginUserUtils;
import com.xcong.excoin.common.response.Result;
import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitInfoDao;
import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
import com.xcong.excoin.modules.documentary.service.DocumentaryService;
import com.xcong.excoin.modules.documentary.vo.MemberIsTradeVo;
import com.xcong.excoin.modules.member.dao.MemberDao;
import com.xcong.excoin.modules.member.entity.MemberEntity;
 
import lombok.extern.slf4j.Slf4j;
 
@Slf4j
@Service
public class DocumentaryServiceImpl extends ServiceImpl<FollowTraderProfitInfoDao, FollowTraderProfitInfoEntity> implements DocumentaryService {
 
    @Resource
    private MemberDao memberDao;
    
    @Override
    public Result getMemberIsTradeInfo() {
        //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        MemberEntity member = memberDao.selectById(memberId);
        
        Integer isTrader = member.getIsTrader();
        MemberIsTradeVo memberIsTradeVo = new MemberIsTradeVo();
        if(MemberEntity.IS_TRADER_Y.equals(isTrader)) {
            memberIsTradeVo.setIsTrade(MemberEntity.IS_TRADER_Y);
        }else {
            memberIsTradeVo.setIsTrade(MemberEntity.IS_TRADER_N);
        }
        return Result.ok(memberIsTradeVo);
    }
 
}