You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.3 KiB
78 lines
2.3 KiB
package com.example.demo.controller;
|
|
|
|
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 com.example.demo.service.RefundService;
|
|
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.*;
|
|
|
|
/**
|
|
* @program: gold-java
|
|
* @ClassName RefundMapper.xml
|
|
* @description:
|
|
* @author: Double
|
|
* @create: 2025−06-26 11:28
|
|
* @Version 1.0
|
|
**/
|
|
|
|
@RestController
|
|
@RequestMapping("/refund")
|
|
@RequiredArgsConstructor
|
|
@Slf4j
|
|
@CrossOrigin
|
|
public class RefundController {
|
|
|
|
@Autowired
|
|
private RefundService refundService;
|
|
|
|
//退款明细
|
|
@PostMapping("/selectAll")
|
|
public Result selcetAll(@RequestBody Page page) {
|
|
try {
|
|
if (ObjectUtils.isEmpty(page.getPageNum())) {
|
|
return Result.error("页码数为空!");
|
|
}
|
|
if (ObjectUtils.isEmpty(page.getPageSize())) {
|
|
return Result.error("页大小为空!");
|
|
} else {
|
|
return Result.success(refundService.selectAll(page.getPageNum(), page.getPageSize()));
|
|
}
|
|
} catch (Exception e) {
|
|
return Result.error("接口调用失败");
|
|
}
|
|
|
|
}
|
|
|
|
@PostMapping("/selectBy")
|
|
public Result selcetBy(@RequestBody Page page) {
|
|
try {
|
|
if (ObjectUtils.isEmpty(page.getPageNum())) {
|
|
return Result.error("页码数为空!");
|
|
}
|
|
if (ObjectUtils.isEmpty(page.getPageSize())) {
|
|
return Result.error("页大小为空!");
|
|
} else {
|
|
return Result.success(refundService.selectBy(page.getPageNum(), page.getPageSize(), page.getRefundUser()));
|
|
}
|
|
} catch (Exception e) {
|
|
return Result.error("接口调用失败");
|
|
}
|
|
|
|
}
|
|
|
|
@PostMapping("/statsGold")
|
|
public Result statsGold() {
|
|
try {
|
|
Gold gold = refundService.statsGold();
|
|
return Result.success(gold);
|
|
} catch (Exception e) {
|
|
return Result.error("接口调用失败");
|
|
}
|
|
}
|
|
|
|
}
|