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.
97 lines
3.1 KiB
97 lines
3.1 KiB
package com.example.demo.controller.bean;
|
|
|
|
import com.example.demo.domain.vo.bean.BeanAuditInfo;
|
|
import com.example.demo.domain.vo.bean.BeanRechargeInfo;
|
|
import com.example.demo.domain.vo.bean.GoldBean;
|
|
import com.example.demo.domain.vo.coin.Page;
|
|
import com.example.demo.domain.vo.coin.Result;
|
|
import com.example.demo.service.bean.BeanAuditService;
|
|
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;
|
|
|
|
/**
|
|
* @program: gold-java
|
|
* @ClassName BeanAuditController
|
|
* @description:
|
|
* @author: Double
|
|
* @create: 2025−08-01 11:03
|
|
* @Version 1.0
|
|
**/
|
|
|
|
@RestController
|
|
@RequestMapping("/beanAudit")
|
|
@RequiredArgsConstructor
|
|
@Slf4j
|
|
@CrossOrigin
|
|
public class BeanAuditController {
|
|
|
|
@Autowired
|
|
private BeanAuditService beanAuditService;
|
|
|
|
//审核查找
|
|
@PostMapping("/selectBy")
|
|
public Result selectBy(@RequestBody Page page) {
|
|
try {
|
|
if (ObjectUtils.isEmpty(page.getPageNum())) {
|
|
return Result.error("页码数为空!");
|
|
}
|
|
if (ObjectUtils.isEmpty(page.getPageSize())) {
|
|
return Result.error("页大小为空!");
|
|
} else {
|
|
if (page.getBeanAuditInfo().getStatus() == null) {
|
|
return Result.error("状态不能为空");
|
|
}
|
|
return Result.success(beanAuditService.selectBy(page.getPageNum(), page.getPageSize(), page.getBeanAuditInfo()));
|
|
}
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
return Result.error("请检查筛选数据的格式");
|
|
}
|
|
|
|
}
|
|
|
|
@PostMapping("/status1")
|
|
public Result updateStatus1(@RequestBody BeanAuditInfo beanAuditInfo) {
|
|
try {
|
|
if (ObjectUtils.isEmpty(beanAuditInfo.getId())) {
|
|
return Result.error("id不能为空");
|
|
}
|
|
return beanAuditService.updateStatus1(beanAuditInfo);
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
return Result.error("更新失败,查看id");
|
|
}
|
|
}
|
|
|
|
@PostMapping("/status2")
|
|
public Result updateStatus2(@RequestBody BeanAuditInfo beanAuditInfo) {
|
|
try {
|
|
if (ObjectUtils.isEmpty(beanAuditInfo.getId())) {
|
|
return Result.error("id不能为空");
|
|
}
|
|
if (ObjectUtils.isEmpty(beanAuditInfo.getReason())) {
|
|
return Result.error("审核意见不能为空");
|
|
}
|
|
beanAuditService.updateStatus2(beanAuditInfo);
|
|
return Result.success();
|
|
} catch (Exception e) {
|
|
return Result.error("更新失败,查看id");
|
|
}
|
|
}
|
|
|
|
//金豆统计
|
|
@PostMapping("/statsBean")
|
|
public Result statsBean(@RequestBody BeanAuditInfo beanAuditInfo) {
|
|
try {
|
|
GoldBean goldBean = beanAuditService.statsBean(beanAuditInfo);
|
|
return Result.success(goldBean);
|
|
} catch (Exception e) {
|
|
return Result.error("请检查数据的格式");
|
|
}
|
|
}
|
|
}
|