| | |
| | | import com.yeshi.buwan.service.manager.GoldCornManager; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | import com.yeshi.buwan.util.TimeUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private GoldCornManager goldCornManager; |
| | | Logger logger = LoggerFactory.getLogger(SignInService.class); |
| | | |
| | | @Override |
| | | public Integer signIn(String uid) throws LoginUserException, SignInException { |
| | |
| | | goldCornManager.addGoldCorn(uid, CodeCornGetSourceType.signIn, goldCorn, "签到", String.format("连续%s天签到", (dayCount + 1))); |
| | | return goldCorn; |
| | | } catch (GoldUserException e) { |
| | | logger.error("签到出错:", e); |
| | | throw new LoginUserException(e.getCode(), e.getMsg()); |
| | | } catch (GoldAppException e) { |
| | | logger.error("签到出错:", e); |
| | | throw new SignInException(1, "服务器内部出错"); |
| | | } catch (GoldTradeException e) { |
| | | logger.error("签到出错:", e); |
| | | throw new SignInException(e.getCode(), e.getMsg()); |
| | | } catch (Exception e) { |
| | | logger.error("签到出错:", e); |
| | | e.printStackTrace(); |
| | | throw new SignInException(1, "服务器内部出错"); |
| | | } |
| | | |