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.
49 lines
1.7 KiB
49 lines
1.7 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;
|
|
|
|
@RestController
|
|
@RequestMapping("/dou")
|
|
@RequiredArgsConstructor
|
|
@Slf4j
|
|
@CrossOrigin
|
|
public class DouController {
|
|
private final DouService douService;
|
|
@RequestMapping("/search")
|
|
public Result search(@RequestBody Searchinfo jwcode){
|
|
return Result.success(douService.searchinfo(jwcode));
|
|
}
|
|
@RequestMapping("/add")
|
|
public Result add(@RequestBody Records records){
|
|
return Result.success(douService.add(records));
|
|
}
|
|
|
|
@RequestMapping("/getYve")
|
|
public Result getYve(@RequestBody Page page){
|
|
if (ObjectUtils.isEmpty(page.getPageNum())) {
|
|
return Result.success(douService.getYve(page.getYve()));
|
|
} else {
|
|
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());
|
|
}
|
|
}
|