| | |
| | | import com.yeshi.makemoney.app.entity.user.UserExtraInfo; |
| | | import com.yeshi.makemoney.app.service.inter.user.UserExtraInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.yeshi.utils.StringUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class UserExtraInfoServiceImpl implements UserExtraInfoService { |
| | |
| | | update.setInviteCode(code); |
| | | userExtraInfoDao.updateSelective(update); |
| | | } |
| | | |
| | | @Override |
| | | public Long selectUidByInviteCode(String inviteCode) { |
| | | if (StringUtil.isNullOrEmpty(inviteCode)) { |
| | | return null; |
| | | } |
| | | UserExtraInfoDao.DaoQuery daoQuery = new UserExtraInfoDao.DaoQuery(); |
| | | daoQuery.inviteCode = inviteCode; |
| | | daoQuery.count = 1; |
| | | List<UserExtraInfo> list = userExtraInfoDao.list(daoQuery); |
| | | if (list == null || list.size() == 0) { |
| | | return null; |
| | | } |
| | | return list.get(0).getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void setSignInNotify(Long uid, boolean notify) { |
| | | init(uid); |
| | | UserExtraInfo update = new UserExtraInfo(); |
| | | update.setId(uid); |
| | | update.setSignInNotify(notify); |
| | | userExtraInfoDao.updateSelective(update); |
| | | } |
| | | |
| | | @Override |
| | | public boolean getSignInNotify(Long uid) { |
| | | UserExtraInfo extraInfo = get(uid); |
| | | //签到默认自动提醒 |
| | | if (extraInfo == null || extraInfo.getSignInNotify() == null) { |
| | | return true; |
| | | } |
| | | return extraInfo.getSignInNotify(); |
| | | } |
| | | } |