liuxiaolong
2019-05-06 a7bed6b4cfecd61ec153818945f982c5bb796b98
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
package com.cloud.attendance.controller;
 
import com.cloud.attendance.filter.AuthNoneIgnore;
import com.cloud.attendance.model.AttRule;
import com.cloud.attendance.service.AttRuleService;
import com.cloud.model.common.Result;
import com.cloud.model.sys.SysDict;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
 
import java.util.Map;
 
@Slf4j
@Api(value = "AttRuleController", description = "考勤规则")
@RequestMapping("/api-a/rule")
@RestController
public class AttRuleController {
 
    @Autowired
    private AttRuleService ruleService;
 
    @PostMapping("/save")
    @ApiOperation(value = "添加考勤规则", notes = "添加考勤规则", httpMethod = "POST", produces = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    @ApiImplicitParams({
    })
    public Result save(@RequestBody AttRule rule){
            log.info("rule:"+rule+"");
            return Result.ok("添加成功",ruleService.saveRule(rule));
    }
 
    @ApiOperation(value = "查询考勤规则", notes = "查询考勤规则", httpMethod = "GET", produces = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    @ApiImplicitParams({
    })
//    @PostMapping("/query")
    @GetMapping("/query")
    public Result queryAttRule(){
            log.info("查询考勤规则。。。");
            return Result.ok("查询考勤规则成功", ruleService.findRule());
    }
    @ApiOperation(value = "修改考勤规则", notes = "修改考勤规则", httpMethod = "POST", produces = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    @ApiImplicitParams({
    })
    @PostMapping("/update")
    public Result queryAttRule(@RequestBody AttRule attRule) {
 
            return Result.ok("修改考勤规则成功", ruleService.updateRule(attRule));
 
    }
 
}