gongzuming
2024-09-20 e425e5d101e1d48e40674a2a801efb8dd060e8a5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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<ReturnDataDTO> signIn(){
        customerPointService.signIn();
        return returnData(R.SUCCESS.getCode(), null);
    }
 
    @GetMapping("/list")
    @ApiOperation(value = "签到历史")
    public ResponseEntity<ReturnDataDTO<List<CustomerPointDetailDTO>>> 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<ReturnDataDTO<Boolean>> signToday()  {
        return returnData(R.SUCCESS.getCode(), customerPointService.signToday());
    }
 
 
 
 
}