Authored by ping

add 判断是否会员日的接口

@@ -36,7 +36,7 @@ public class UserdayPrizeLogController { @@ -36,7 +36,7 @@ public class UserdayPrizeLogController {
36 @RequestMapping("/addPrizeLog") 36 @RequestMapping("/addPrizeLog")
37 @ResponseBody 37 @ResponseBody
38 public ApiResponse addPrizeLog(int uid, int prize_type) throws Exception { 38 public ApiResponse addPrizeLog(int uid, int prize_type) throws Exception {
39 - log.debug("enter addPrizeLog. param uid={}, prize_type={}", uid, prize_type); 39 + log.info("enter addPrizeLog. param uid={}, prize_type={}", uid, prize_type);
40 int result = userdayPrizeLogService.addPrizeLog(uid, prize_type); 40 int result = userdayPrizeLogService.addPrizeLog(uid, prize_type);
41 return new ApiResponse(result); 41 return new ApiResponse(result);
42 } 42 }
@@ -51,7 +51,7 @@ public class UserdayPrizeLogController { @@ -51,7 +51,7 @@ public class UserdayPrizeLogController {
51 @RequestMapping("/existsPrizeLog") 51 @RequestMapping("/existsPrizeLog")
52 @ResponseBody 52 @ResponseBody
53 public ApiResponse existsPrizeLog(int uid, int prize_type) throws Exception { 53 public ApiResponse existsPrizeLog(int uid, int prize_type) throws Exception {
54 - log.debug("enter existsPrizeLog. param uid={}, prize_type={}", uid, prize_type); 54 + log.info("enter existsPrizeLog. param uid={}, prize_type={}", uid, prize_type);
55 boolean result = userdayPrizeLogService.existsPrizeLog(uid, prize_type); 55 boolean result = userdayPrizeLogService.existsPrizeLog(uid, prize_type);
56 return new ApiResponse(result); 56 return new ApiResponse(result);
57 } 57 }
@@ -66,7 +66,7 @@ public class UserdayPrizeLogController { @@ -66,7 +66,7 @@ public class UserdayPrizeLogController {
66 @RequestMapping("/queryPrizeLog") 66 @RequestMapping("/queryPrizeLog")
67 @ResponseBody 67 @ResponseBody
68 public ApiResponse queryPrizeLog(int uid, int prize_type) throws Exception { 68 public ApiResponse queryPrizeLog(int uid, int prize_type) throws Exception {
69 - log.debug("enter queryPrizeLog. param uid={}, prize_type={}", uid, prize_type); 69 + log.info("enter queryPrizeLog. param uid={}, prize_type={}", uid, prize_type);
70 List<UserdayPrizeLogResponseBO> list = userdayPrizeLogService.queryPrizeLog(uid, prize_type); 70 List<UserdayPrizeLogResponseBO> list = userdayPrizeLogService.queryPrizeLog(uid, prize_type);
71 if (CollectionUtils.isEmpty(list)) { 71 if (CollectionUtils.isEmpty(list)) {
72 log.warn("queryPrizeLog error. result is empty"); 72 log.warn("queryPrizeLog error. result is empty");
@@ -83,7 +83,7 @@ public class UserdayPrizeLogController { @@ -83,7 +83,7 @@ public class UserdayPrizeLogController {
83 @RequestMapping("/queryPrizeLogNum") 83 @RequestMapping("/queryPrizeLogNum")
84 @ResponseBody 84 @ResponseBody
85 public ApiResponse queryPrizeLogNum(int prize_type) throws Exception { 85 public ApiResponse queryPrizeLogNum(int prize_type) throws Exception {
86 - log.debug("enter queryPrizeLogNum. param prize_type={}", prize_type); 86 + log.info("enter queryPrizeLogNum. param prize_type={}", prize_type);
87 int num = userdayPrizeLogService.queryPrizeLogNum(prize_type); 87 int num = userdayPrizeLogService.queryPrizeLogNum(prize_type);
88 return new ApiResponse(num); 88 return new ApiResponse(num);
89 } 89 }
1 package com.yoho.activity.controller; 1 package com.yoho.activity.controller;
2 2
3 import com.yoho.activity.common.ApiResponse; 3 import com.yoho.activity.common.ApiResponse;
  4 +import com.yoho.activity.common.utils.DateUtils;
4 import com.yoho.activity.service.IUserdaySigninService; 5 import com.yoho.activity.service.IUserdaySigninService;
5 import org.slf4j.Logger; 6 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory; 7 import org.slf4j.LoggerFactory;
7 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.beans.factory.annotation.Value;
8 import org.springframework.stereotype.Controller; 10 import org.springframework.stereotype.Controller;
9 import org.springframework.web.bind.annotation.RequestMapping; 11 import org.springframework.web.bind.annotation.RequestMapping;
10 import org.springframework.web.bind.annotation.ResponseBody; 12 import org.springframework.web.bind.annotation.ResponseBody;
@@ -20,13 +22,24 @@ public class UserdaySigninController { @@ -20,13 +22,24 @@ public class UserdaySigninController {
20 22
21 @Autowired 23 @Autowired
22 IUserdaySigninService userdaySigninService; 24 IUserdaySigninService userdaySigninService;
  25 +
  26 + @Value("${userday.open.day}")
  27 + String userdayDay;
23 28
24 @RequestMapping("/signin") 29 @RequestMapping("/signin")
25 @ResponseBody 30 @ResponseBody
26 public ApiResponse signin(int uid) throws Exception { 31 public ApiResponse signin(int uid) throws Exception {
27 - log.debug("enter signin. param uid={}", uid); 32 + log.info("enter signin. param uid={}", uid);
28 userdaySigninService.signin(uid); 33 userdaySigninService.signin(uid);
29 return new ApiResponse(""); 34 return new ApiResponse("");
30 } 35 }
  36 +
  37 + @RequestMapping("/isUserday")
  38 + @ResponseBody
  39 + public ApiResponse isUserday() throws Exception {
  40 + log.info("enter isUserday.");
  41 + String day = DateUtils.getToday("dd");
  42 + return new ApiResponse(day.equals(userdayDay));
  43 + }
31 44
32 } 45 }