| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package com.punchsettle.server.service.controller;
- import com.punchsettle.server.common.valid.Save;
- import com.punchsettle.server.dto.scratch.ScratchDto;
- import com.punchsettle.server.dto.scratch.ScratchQuery;
- import com.punchsettle.server.service.manager.IScratchManager;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.List;
- /**
- * @author tyuio
- * @version 1.0.0
- * @description 刮刮乐 controller
- * @date 2024/12/13 21:57
- */
- @RestController
- @RequestMapping("/scratch")
- public class ScratchController {
- @Autowired
- private IScratchManager scratchManager;
- /**
- * 增加投入金额/中奖金额记录
- * @param dto
- */
- @PostMapping("/addScratchRecord")
- public void addScratchRecord(@RequestBody @Validated({Save.class}) ScratchDto dto) {
- scratchManager.addScratchRecord(dto);
- }
- /**
- * 撤销投入金额记录/中奖记录
- */
- @PostMapping("/revokeScratchRecord")
- public void revokeScratchRecord(@RequestBody @Validated({ScratchDto.Revoke.class})ScratchDto dto) {
- scratchManager.revokeScratchRecord(dto);
- }
- /**
- * 按时间范围查询刮刮乐记录
- */
- @PostMapping("/queryScratchRecord")
- public List<ScratchDto> queryScratchRecord(@RequestBody @Validated ScratchQuery query) {
- return scratchManager.queryScratchRecord(query);
- }
- }
|