|
|
@ -2,11 +2,13 @@ package com.example.demo.controller; |
|
|
|
|
|
|
|
import com.example.demo.domain.vo.Consume; |
|
|
|
import com.example.demo.domain.vo.Gold; |
|
|
|
import com.example.demo.domain.vo.Page; |
|
|
|
import com.example.demo.domain.vo.Result; |
|
|
|
import com.example.demo.service.ConsumeService; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
@ -32,10 +34,18 @@ public class ConsumeController { |
|
|
|
|
|
|
|
//消耗明细 |
|
|
|
@PostMapping("/selectAll") |
|
|
|
public Result selcetAll() |
|
|
|
public Result selcetAll(@RequestBody Page page) |
|
|
|
{ |
|
|
|
List<Consume> consumes = consumeService.selectAll(); |
|
|
|
return Result.success(consumes); |
|
|
|
if(ObjectUtils.isEmpty(page.getPageNum())){ |
|
|
|
return Result.error("页码数为空!"); |
|
|
|
} |
|
|
|
if(ObjectUtils.isEmpty(page.getPageSize())){ |
|
|
|
return Result.error("页大小为空!"); |
|
|
|
} |
|
|
|
else{ |
|
|
|
return Result.success(consumeService.selectAll(page.getPageNum(), page.getPageSize())); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//消耗金币统计 |
|
|
|