whycrzg
2021-02-20 aa885eba07f4b84390922b4b146d1806676293c0
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
package com.fgkj.controller;
 
import com.fgkj.util.*;
 
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_task_batt_template;
import com.fgkj.services.User_task_batt_templateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
import javax.annotation.Resource;
 
@RequestMapping("UserTaskBattTemplate")
@RestController
@Api(tags = "UserTaskBattTemplate接口")
public class User_task_batt_templateController{
    @Resource
    private User_task_batt_templateService service;
    
    //4.4 作业模板管理(新建模板)
    @PostMapping("/")
    @ApiOperation(notes = "",value="作业模板管理(新建模板)")
    public ServiceModel add(@RequestBody User_task_batt_template utbt){
        ServiceModel model=service.add(utbt);
        
        return model;
    }
    
    //4.4 作业模板管理(修改模板/重命名)
    @PutMapping("/")
    @ApiOperation(notes = "",value="作业模板管理(修改模板/重命名)")
    public ServiceModel update(@RequestBody List<User_task_batt_template> uplist) {
        ServiceModel model=service.update(uplist);
        
        return model;
    }
    
    //4.4 作业模板管理(删除)
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="作业模板管理(删除)")
    public ServiceModel delete(@RequestParam Integer template_id){
        User_task_batt_template utbt = new User_task_batt_template();
        utbt.setTemplate_id(template_id);
        ServiceModel model=service.delete(utbt);
        
        return model;
    }
    
    //4.4根据模板id查询模板的信息
    @PostMapping("byCondition")
    @ApiOperation(notes = "",value="模板id查询模板的信息")
    public ServiceModel serchByCondition(@RequestParam Integer template_id){
        User_task_batt_template utbt = new User_task_batt_template();
        utbt.setTemplate_id(template_id);
        ServiceModel model=service.serchByCondition(utbt);
        
        return model;
    }
    
  //4.4查询所有的模板
    @GetMapping("all")
    @ApiOperation(notes = "",value="查询所有的模板")
    public ServiceModel searchAll(){
        ServiceModel model=service.searchAll();
        
        return model;
    }
    
}