package cn.iselab.mooctest.user.web.wrapper;

import cn.iselab.mooctest.rpc.user.data.UserIntegralDTO;
import cn.iselab.mooctest.user.model.UserIntegral;
import org.springframework.stereotype.Service;

/**
 * @Author ROKG
 * @Description
 * @Date: Created in 下午1:32 2018/2/14
 * @Modified By:
 */
@Service
public class UserIntegralWrapper extends BaseWrapper<UserIntegralDTO, UserIntegral> {

    @Override
    public UserIntegralDTO wrap(UserIntegral integral){
        UserIntegralDTO dto=new UserIntegralDTO();
        dto.setId(integral.getId());
        dto.setUserId(integral.getUserId());
        dto.setTotal(integral.getTotal());
        dto.setEnabled(integral.isEnabled());
        return dto;
    }

    @Override
    public UserIntegral unwrap(UserIntegralDTO dto){
        UserIntegral integral=new UserIntegral();
        integral.setTotal(dto.getTotal());
        return integral;
    }
}
