Showing
1 changed file
with
5 additions
and
1 deletions
@@ -8,6 +8,7 @@ import com.yoho.error.exception.ServiceException; | @@ -8,6 +8,7 @@ import com.yoho.error.exception.ServiceException; | ||
8 | import org.slf4j.Logger; | 8 | import org.slf4j.Logger; |
9 | import org.slf4j.LoggerFactory; | 9 | import org.slf4j.LoggerFactory; |
10 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
11 | +import org.springframework.beans.factory.annotation.Value; | ||
11 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
12 | 13 | ||
13 | import javax.annotation.Resource; | 14 | import javax.annotation.Resource; |
@@ -26,6 +27,9 @@ public class UserdaySigninServiceImpl implements IUserdaySigninService { | @@ -26,6 +27,9 @@ public class UserdaySigninServiceImpl implements IUserdaySigninService { | ||
26 | 27 | ||
27 | @Resource(name = "yhValueOperations") | 28 | @Resource(name = "yhValueOperations") |
28 | YHValueOperations<String, String> yhValueOperations; | 29 | YHValueOperations<String, String> yhValueOperations; |
30 | + | ||
31 | + @Value("${userday.open.day}") | ||
32 | + String userdayOpenDay; | ||
29 | 33 | ||
30 | @Override | 34 | @Override |
31 | public void signin(int uid) throws Exception { | 35 | public void signin(int uid) throws Exception { |
@@ -38,7 +42,7 @@ public class UserdaySigninServiceImpl implements IUserdaySigninService { | @@ -38,7 +42,7 @@ public class UserdaySigninServiceImpl implements IUserdaySigninService { | ||
38 | 42 | ||
39 | // (2)校验当天是否是会员日 | 43 | // (2)校验当天是否是会员日 |
40 | String dateStr = DateUtil.getcurrentDate(); | 44 | String dateStr = DateUtil.getcurrentDate(); |
41 | - if (!"28".equals(dateStr.substring(8, 10))) { | 45 | + if (!userdayOpenDay.equals(dateStr.substring(8, 10))) { |
42 | throw new ServiceException(403, "非会员日,不允许签到"); | 46 | throw new ServiceException(403, "非会员日,不允许签到"); |
43 | } | 47 | } |
44 | 48 |
-
Please register or login to post a comment