whycxzp
2021-03-12 4865806a1a39b79b9b4edfa3cd84f618fa237250
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.Application;
import com.whyc.service.ApplicationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
/**
 * 应用管理
 */
@RestController
@RequestMapping("application")
@Api(tags = "应用管理")
public class ApplicationController {
 
    @Autowired
    private ApplicationService service;
 
    @PostMapping
    @ApiOperation(value = "创建")
    public Response create(@RequestBody Application app){
        return service.insert(app);
    }
 
    @GetMapping("all")
    @ApiOperation(value = "查询所有")
    public Response getAll(){
        return service.getAll();
    }
 
    @PutMapping
    @ApiOperation(value = "更新应用名称")
    public Response update(@RequestBody Application app){
        return service.update(app);
    }
 
}