forked from opentiny/tiny-engine-backend-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCanvasController.java
More file actions
76 lines (70 loc) · 2.74 KB
/
CanvasController.java
File metadata and controls
76 lines (70 loc) · 2.74 KB
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
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
package com.tinyengine.it.controller;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.common.log.SystemControllerLog;
import com.tinyengine.it.model.dto.CanvasDto;
import com.tinyengine.it.service.app.CanvasService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* canvas api
*
* @since 2024-10-20
*/
@Validated
@RestController
@RequestMapping("/app-center/api")
@Tag(name = "区块")
public class CanvasController {
/**
* The canvas service.
*/
@Autowired
private CanvasService canvasService;
/**
* 区块及页面锁
*
* @param id the id
* @param state the state
* @param type the type
* @return CanvasDto
*/
@Operation(summary = "区块及页面锁",
description = "区块及页面锁",
parameters = {
@Parameter(name = "id", description = "页面id"),
@Parameter(name = "state", description = "状态"),
@Parameter(name = "type", description = "区分是页面还是区块")
},
responses = {
@ApiResponse(responseCode = "200", description = "返回信息",
content = @Content(mediaType = "application/json",
schema = @Schema())),
@ApiResponse(responseCode = "400", description = "请求失败")}
)
@SystemControllerLog(description = "区块及页面锁")
@GetMapping("apps/canvas/lock")
public Result<CanvasDto> lock(@RequestParam Integer id, @RequestParam String state, @RequestParam String type) {
return canvasService.lockCanvas(id, state, type);
}
}