PersonController.java
1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.bsth.controller.basic;
import com.bsth.entity.Person;
import com.bsth.service.basic.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* Created by panzhao on 2017/8/1.
*/
@RestController
@RequestMapping("person")
public class PersonController {
@Autowired
PersonService personService;
@RequestMapping("list")
public Map<String, Object> list(@RequestParam Map<String, Object> map,
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "10") int size){
return personService.list(map, page, size);
}
@RequestMapping("{jobCode}")
public Map<String, Object> findOne(@PathVariable("jobCode") String jobCode){
return personService.findOne(jobCode);
}
@RequestMapping("parseFile")
public Map<String, Object> parseFile(@RequestParam String base64,@RequestParam String fileName){
return personService.parseFile(base64, fileName);
}
/**
* 人卡数据批量save
* @param jsonStr
* @return
*/
@RequestMapping(value = "multiSave" ,method = RequestMethod.POST)
public Map<String, Object> multiSave(@RequestParam String jsonStr){
return personService.multiSave(jsonStr);
}
@RequestMapping(value = "save" ,method = RequestMethod.POST)
public Map<String, Object> save(Person p){
return personService.save(p);
}
/**
* 刷新人员数据
*/
@RequestMapping(value = "refresh", method = RequestMethod.POST)
public void refresh(){
personService.refresh();
}
}