whycrzh
2021-01-28 c8332186836b3dfe1fbd32d7bec7cd29a57e1888
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package com.fgkj.controller;
 
import com.fgkj.util.*;
 
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User;
import com.fgkj.services.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
@RequestMapping("user")
@RestController
@Api(tags = "user接口")
public class UserController {
    
    @Resource
    UserService service;
    
    @PostMapping("/")
    @ApiOperation(notes = "",value="新增")
    public ServiceModel add(@RequestBody User user) {
        ServiceModel model=  new ServiceModel();
        model=service.addUser(user);
        
        return model;
    }
    @PutMapping("/")
    @ApiOperation(notes = "",value="修改")
    public ServiceModel update(@RequestBody User user) {
        ServiceModel model=  new ServiceModel();
        model=service.updateUser(user);
                
        return model;
    }
    @PutMapping("pass")
    @ApiOperation(notes = "",value="修改pass")
    public ServiceModel updatePass(@RequestBody User user){
        ServiceModel model=  new ServiceModel();
        //user.setUpass(ActionUtil.Encryption(user.getUpass()).toString());
        model=service.updatePass(user);
        
        return model;
    }
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="删除")
    public ServiceModel del(@RequestBody User user) {
        ServiceModel model=  new ServiceModel();
        model=service.delUser(user);
        
        return model;
    }
    
    @GetMapping("/")
    @ApiOperation(notes = "",value="查找")
    public ServiceModel find(@RequestBody User user) {
        ServiceModel model=  new ServiceModel();
        model=service.findUser(user);
        
        return model;
    }
    @GetMapping("all")
    @ApiOperation(notes = "",value="all")
    public ServiceModel findAll() {
        ServiceModel model=  new ServiceModel();
        model=service.findUserAll();
        
        return model;
    }
    @GetMapping("byInfo")
    @ApiOperation(notes = "",value="byInfo")
    public ServiceModel findByInfo(@RequestBody User user){
        ServiceModel model=  new ServiceModel();
        model=service.findByInfo(user);
        
        return model;
    }
    @GetMapping("byPage")
    @ApiOperation(notes = "",value="byPage")
    public ServiceModel findByPage(@RequestParam int currentPage,@RequestParam int pageSize){
        ServiceModel model=  new ServiceModel();
        model=service.findByAge(currentPage, pageSize);
                
        return model;
    }
 
}