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.
83 lines
2.8 KiB
83 lines
2.8 KiB
package com.example.demo.controller.bean;
|
|
|
|
import com.example.demo.Util.JWTUtil;
|
|
import com.example.demo.domain.entity.Admin;
|
|
import com.example.demo.domain.vo.bean.BeanConsumeGold;
|
|
import com.example.demo.domain.vo.bean.BeanConsumeLive;
|
|
import com.example.demo.domain.vo.bean.BeanPage;
|
|
import com.example.demo.domain.vo.coin.Gold;
|
|
import com.example.demo.domain.vo.coin.Page;
|
|
import com.example.demo.domain.vo.coin.RechargeAudit;
|
|
import com.example.demo.domain.vo.coin.Result;
|
|
import com.example.demo.service.bean.BeanConsumeService;
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
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 org.springframework.web.context.request.RequestContextHolder;
|
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @program: gold-java
|
|
* @ClassName BeanConsumeController
|
|
* @description:
|
|
* @author: Ethan
|
|
* @create: 2025−07-30 11:30
|
|
* @Version 1.0
|
|
**/
|
|
@RestController
|
|
@RequestMapping("/beanConsume")
|
|
@RequiredArgsConstructor
|
|
@Slf4j
|
|
@CrossOrigin
|
|
public class BeanConsumeController {
|
|
@Autowired
|
|
private BeanConsumeService beanConsumeService;
|
|
|
|
//获取消费用户分部信息
|
|
@PostMapping("/getDept")
|
|
public Result getDept(){
|
|
|
|
List<String> deptList = beanConsumeService.getDept();
|
|
return Result.success(deptList);
|
|
}
|
|
|
|
//筛选查询直播消费记录
|
|
@PostMapping("/selectLiveBy")
|
|
public Result selectBy(@RequestBody BeanPage beanPage){
|
|
try {
|
|
if (ObjectUtils.isEmpty(beanPage.getPageNum())) {
|
|
return Result.error("页码数为空!");
|
|
}
|
|
if (ObjectUtils.isEmpty(beanPage.getPageSize())) {
|
|
return Result.error("页大小为空!");
|
|
} else {
|
|
|
|
return Result.success(beanConsumeService.selectLiveBy(beanPage.getPageNum(), beanPage.getPageSize(), beanPage.getBeanConsumeLive()));
|
|
}
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
return Result.error("请检查筛选数据的格式");
|
|
}}
|
|
//消费合计数
|
|
@PostMapping("sumConsumeGold")
|
|
public BeanConsumeGold sumConsumeGold(@RequestBody BeanPage beanPage) {
|
|
|
|
return beanConsumeService.sumConsumeGold( beanPage);
|
|
}
|
|
//查询所有直播礼物
|
|
@PostMapping("/getLiveGift")
|
|
public Result getLiveGift(){
|
|
return Result.success(beanConsumeService.getLiveGift());
|
|
}
|
|
//查询所有直播频道
|
|
@PostMapping("/getLiveChannel")
|
|
public Result getLiveChannel(){
|
|
return Result.success(beanConsumeService.getLiveChannel());
|
|
}
|
|
}
|