package com.td.Dawa.game.comloggoldtran.service;

import com.td.Dawa.common.service.*;
import com.td.Dawa.config.enums.GameEnum;
import com.td.Dawa.game.comloggoldtran.pojo.ComLogGoldTran;
import com.td.Dawa.game.comloggoldtran.vo.ComLogGoldTranVo;
import com.td.Dawa.game.comloggoldtran.repository.ComLogGoldTranRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Service
@Transactional
public class ComLogGoldTranServiceImpl extends CommonServiceImpl<ComLogGoldTranVo, ComLogGoldTran, String> implements ComLogGoldTranService{

    @PersistenceContext
    private EntityManager em;
    @Autowired
    private ComLogGoldTranRepository comLogGoldTranRepository;

    /**
     * 召唤人物时候消耗金币记录
     * @return
     */
    @Override
    public ComLogGoldTran summonRoleConsumption() {

        ComLogGoldTranVo logGoldTranVo = new ComLogGoldTranVo();

        logGoldTranVo.setTranAmount(1d);
        logGoldTranVo.setTranType(GameEnum.TRAN_GOLD_SUMMON.getValue());
        logGoldTranVo.setIsAdd(0);
        super.save(logGoldTranVo);
        return null;
    }
}
