whycrzg
2021-02-03 f3e160c4c6690232da3258adb42c1f702cd8bb07
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
package com.fgkj.controller;
 
import com.fgkj.util.*;
 
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_jiejiari;
import com.fgkj.services.User_jiejiariService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.util.Date;
 
@RequestMapping("holiday")
@RestController
@Api(tags = "holiday接口")
public class User_jiejiariController{
    @Resource
    private User_jiejiariService service;
 
    //4.3节假日管理(增加)
    @PostMapping("/")
    @ApiOperation(notes = "",value="节假日管理(增加)")
    public ServiceModel add(@RequestParam Integer jiejiari_type, @ApiParam(value = "时间 格式2021/01/06 09:25:50",required = true)@RequestParam Date jiejiari_date, @RequestParam String note) {
        User_jiejiari ujjr = new User_jiejiari();
        ujjr.setJiejiari_type(jiejiari_type);
        ujjr.setJiejiari_date(jiejiari_date);
        ujjr.setNote(note);
        ServiceModel model = service.add(ujjr);
 
        return model;
    }
    //4.3节假日管理(修改)
    @PutMapping("/")
    @ApiOperation(notes = "",value="节假日管理(修改)")
    public ServiceModel update(@RequestParam Integer num, @RequestParam Integer jiejiari_type, @ApiParam(value = "时间 格式2021/01/06 09:25:50",required = true) @RequestParam Date jiejiari_date, @RequestParam String note) {
        User_jiejiari ujjr = new User_jiejiari();
        ujjr.setNum(num);
        ujjr.setJiejiari_type(jiejiari_type);
        ujjr.setJiejiari_date(jiejiari_date);
        ujjr.setNote(note);
        ServiceModel model=service.update(ujjr);
        
        return model;
    }
 
    //4.3节假日管理(删除)
    @DeleteMapping("/")
    @ApiOperation(notes = "", value = "节假日管理(删除)")
    public ServiceModel delete(@RequestParam Integer num) {
        User_jiejiari ujjr = new User_jiejiari();
        ujjr.setNum(num);
        ServiceModel model = service.delete(ujjr);
 
        return model;
    }
    
    //查询所有节假日
    @GetMapping("all")
    @ApiOperation(notes = "",value="查询所有节假日")
    public ServiceModel serchAll(){
        ServiceModel model=service.serchAll();
                
        return model;
    }
 
    //根据公历和农历以及全部查询节假日
    @PostMapping("byCondition")
    @ApiOperation(notes = "", value = "公历和农历以及全部查询节假日")
    public ServiceModel serchByCondition(@RequestParam Integer jiejiari_type) {
        User_jiejiari ujjr = new User_jiejiari();
        ujjr.setJiejiari_type(jiejiari_type);
        ServiceModel model = service.serchByCondition(ujjr);
 
        return model;
    }
    
}