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.
122 lines
4.4 KiB
122 lines
4.4 KiB
package com.example.demo.controller;
|
|
|
|
|
|
|
|
import com.example.demo.domain.dou.*;
|
|
import com.example.demo.domain.vo.Page;
|
|
import com.example.demo.domain.vo.Result;
|
|
import com.example.demo.sevice.DouService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import java.util.Arrays;
|
|
|
|
@RestController
|
|
@RequestMapping("/dou")
|
|
@RequiredArgsConstructor
|
|
@Slf4j
|
|
@CrossOrigin
|
|
public class DouController {
|
|
private final DouService douService;
|
|
@RequestMapping("/search")
|
|
public Result search(@RequestBody Searchinfo jwcode) throws Exception{
|
|
try {
|
|
return Result.success(douService.searchinfo(jwcode));
|
|
}catch (Exception e) {
|
|
log.error(Arrays.toString(e.getStackTrace()));
|
|
return Result.error(e.getMessage());
|
|
}
|
|
}
|
|
@RequestMapping("/add")
|
|
public Result add(@RequestBody Records records) throws Exception{
|
|
try {
|
|
return Result.success(douService.add(records));
|
|
}catch (Exception e) {
|
|
log.error(Arrays.toString(e.getStackTrace()));
|
|
return Result.error(e.getMessage());
|
|
}
|
|
}
|
|
|
|
@RequestMapping("/getYve")
|
|
public Result getYve(@RequestBody Page page){
|
|
if (ObjectUtils.isEmpty(page.getPageNum())) {
|
|
System.out.println(page.getYve()+"-----");
|
|
return Result.success(douService.getYve(page.getYve()));
|
|
} else {
|
|
System.out.println(page.getYve()+"++++");
|
|
return Result.success(douService.searchForPage(page.getPageNum(), page.getPageSize(), page.getYve()));
|
|
}
|
|
}
|
|
@RequestMapping("/getYveTotal")
|
|
public Result getYveTotal(@RequestBody YveTotal yveTotal){
|
|
System.out.println(douService.getYveTotal(yveTotal));
|
|
return Result.success(douService.getYveTotal(yveTotal));
|
|
}
|
|
@RequestMapping("/getIp")
|
|
public Result getIp(){
|
|
return Result.success(douService.getIp());
|
|
}
|
|
@RequestMapping("/getStyle")
|
|
public Result getStyle(){
|
|
return Result.success(douService.getStyle());
|
|
}
|
|
@RequestMapping("/getPayIp")
|
|
public Result getPayIp(){
|
|
return Result.success(douService.getPayIp());
|
|
}
|
|
@RequestMapping("/getPay")
|
|
public Result getPay(@RequestBody Page page){
|
|
if (ObjectUtils.isEmpty(page.getPageNum())) {
|
|
|
|
return Result.success(douService.getPay(page.getPay()));
|
|
} else {
|
|
return Result.success(douService.searchPay(page.getPageNum(), page.getPageSize(), page.getPay()));
|
|
}
|
|
}
|
|
@RequestMapping("/getSpend")
|
|
public Result getSpend(@RequestBody Page page){
|
|
if (ObjectUtils.isEmpty(page.getPageNum())) {
|
|
return Result.success(douService.getSpend(page.getSpend()));
|
|
} else {
|
|
return Result.success(douService.searchSpend(page.getPageNum(), page.getPageSize(), page.getSpend()));
|
|
}
|
|
}
|
|
@RequestMapping("/getSpendTotal")
|
|
public Result getSpendTotal(@RequestBody SpendTotal spendTotal){
|
|
return Result.success(douService.getSpendTotal(spendTotal));
|
|
}
|
|
@RequestMapping("/getRechargeTotal")
|
|
public Result getRechargeTotal(@RequestBody RechargeTotal rechargeTotal){
|
|
return Result.success(douService.getRechargeTotal(rechargeTotal));
|
|
}
|
|
@RequestMapping("/SearchPay")
|
|
public Result SearchPay(@RequestBody Page page){
|
|
if (ObjectUtils.isEmpty(page.getPageNum())) {
|
|
return Result.success(douService.SearchPay(page.getPay()));
|
|
} else {
|
|
return Result.success(douService.SearchPay(page.getPageNum(), page.getPageSize(), page.getPay()));
|
|
}
|
|
}
|
|
@RequestMapping("/SearchStyle")
|
|
public Result SearchStyle(){
|
|
return Result.success(douService.SearchStyle());
|
|
}
|
|
@RequestMapping("/SearchPayIp")
|
|
public Result SearchPayIp(){
|
|
return Result.success(douService.SearchPayIp());
|
|
}
|
|
@RequestMapping("/getTotal")
|
|
public Result getTotal(@RequestBody Total total){
|
|
return Result.success(douService.getTotal(total));
|
|
}
|
|
// 获取充值类型填充下拉框(现在还没有下拉框好有下拉框了但是它好长)
|
|
@RequestMapping("/getType")
|
|
public Result getType(){
|
|
return Result.success(douService.getType());
|
|
}
|
|
}
|