Authored by ping

add 判断是否会员日的接口

... ... @@ -36,7 +36,7 @@ public class UserdayPrizeLogController {
@RequestMapping("/addPrizeLog")
@ResponseBody
public ApiResponse addPrizeLog(int uid, int prize_type) throws Exception {
log.debug("enter addPrizeLog. param uid={}, prize_type={}", uid, prize_type);
log.info("enter addPrizeLog. param uid={}, prize_type={}", uid, prize_type);
int result = userdayPrizeLogService.addPrizeLog(uid, prize_type);
return new ApiResponse(result);
}
... ... @@ -51,7 +51,7 @@ public class UserdayPrizeLogController {
@RequestMapping("/existsPrizeLog")
@ResponseBody
public ApiResponse existsPrizeLog(int uid, int prize_type) throws Exception {
log.debug("enter existsPrizeLog. param uid={}, prize_type={}", uid, prize_type);
log.info("enter existsPrizeLog. param uid={}, prize_type={}", uid, prize_type);
boolean result = userdayPrizeLogService.existsPrizeLog(uid, prize_type);
return new ApiResponse(result);
}
... ... @@ -66,7 +66,7 @@ public class UserdayPrizeLogController {
@RequestMapping("/queryPrizeLog")
@ResponseBody
public ApiResponse queryPrizeLog(int uid, int prize_type) throws Exception {
log.debug("enter queryPrizeLog. param uid={}, prize_type={}", uid, prize_type);
log.info("enter queryPrizeLog. param uid={}, prize_type={}", uid, prize_type);
List<UserdayPrizeLogResponseBO> list = userdayPrizeLogService.queryPrizeLog(uid, prize_type);
if (CollectionUtils.isEmpty(list)) {
log.warn("queryPrizeLog error. result is empty");
... ... @@ -83,7 +83,7 @@ public class UserdayPrizeLogController {
@RequestMapping("/queryPrizeLogNum")
@ResponseBody
public ApiResponse queryPrizeLogNum(int prize_type) throws Exception {
log.debug("enter queryPrizeLogNum. param prize_type={}", prize_type);
log.info("enter queryPrizeLogNum. param prize_type={}", prize_type);
int num = userdayPrizeLogService.queryPrizeLogNum(prize_type);
return new ApiResponse(num);
}
... ...
package com.yoho.activity.controller;
import com.yoho.activity.common.ApiResponse;
import com.yoho.activity.common.utils.DateUtils;
import com.yoho.activity.service.IUserdaySigninService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
... ... @@ -20,13 +22,24 @@ public class UserdaySigninController {
@Autowired
IUserdaySigninService userdaySigninService;
@Value("${userday.open.day}")
String userdayDay;
@RequestMapping("/signin")
@ResponseBody
public ApiResponse signin(int uid) throws Exception {
log.debug("enter signin. param uid={}", uid);
log.info("enter signin. param uid={}", uid);
userdaySigninService.signin(uid);
return new ApiResponse("");
}
@RequestMapping("/isUserday")
@ResponseBody
public ApiResponse isUserday() throws Exception {
log.info("enter isUserday.");
String day = DateUtils.getToday("dd");
return new ApiResponse(day.equals(userdayDay));
}
}
... ...