package com.mzl.flower.web.customer; import com.mzl.flower.base.BaseController; import com.mzl.flower.base.R; import com.mzl.flower.base.ReturnDataDTO; import com.mzl.flower.dto.response.point.CustomerPointDetailDTO; import com.mzl.flower.service.point.CustomerPointService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.time.LocalDate; import java.util.List; @RestController @RequestMapping("/api/customer/point/sign") @Api(value = "签到-花店", tags = "签到-花店") @Validated @Slf4j public class CustomerSignInController extends BaseController { @Autowired private CustomerPointService customerPointService; @PostMapping("/in") @ApiOperation(value = "签到") public ResponseEntity signIn(){ customerPointService.signIn(); return returnData(R.SUCCESS.getCode(), null); } @GetMapping("/list") @ApiOperation(value = "签到历史") public ResponseEntity>> signList(String startDateStr, String endDateStr) { LocalDate startDate = customerPointService.parseLocalDate(startDateStr); LocalDate endDate = customerPointService.parseLocalDate(endDateStr); return returnData(R.SUCCESS.getCode(), customerPointService.signList(startDate, endDate)); } @GetMapping("/sign/today") @ApiOperation(value = "今日是否签到") public ResponseEntity> signToday() { return returnData(R.SUCCESS.getCode(), customerPointService.signToday()); } }