package com.example.spring2.controller;
import com.example.spring2.entity.User;
import com.example.spring2.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@CrossOrigin
@RestController
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
// 根据用户名统计数量
@GetMapping("/countByName")
public Map<String, User> getCountByName(@RequestParam String user) {
return userService.getCountByName(user);
}
// 根据文档统计数量
@GetMapping("/countByDocument")
public Map<String, User> getCountByDocument(@RequestParam String user) {
return userService.getCountByDocument(user);
}
// 根据组织统计数量
@GetMapping("/countByOrgan")
public Map<String, User> getCountByOrgan(@RequestParam String user) {
return userService.getCountByOrgan(user);
}
// 根据文本内容统计数量
@GetMapping("/countByText")
public Map<String, User> getCountByText(@RequestParam String user) {
return userService.getCountByText(user);
}
// 获取总数量
@GetMapping("/totalCount")
public Map<String, User> getTotalCount() {
return userService.getTotalCount();
}
// 显示信息 name type category range dociment form orgn viadata pubdata perdata
@GetMapping("/ALLname")
public List<User> getAllPolicies() {
return userService.getAllPolicies();
}
@GetMapping("/ALLtext")
public List<String> getAllPolicies2(@RequestParam("name") String name) {
return userService.getAllPolicies2(name);
}
@GetMapping("/findname")
public List<User> getAllPolicies3(@RequestParam("name") String name) {
return userService.getAllPolicies3(name);
}
//多条件查询 name type range text 为空的时候不查询 是否模糊
}