remove put del
This commit is contained in:
@@ -2,13 +2,10 @@ package com.test.test.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -31,7 +28,7 @@ import com.test.common.core.page.TableDataInfo;
|
||||
@RestController
|
||||
@RequestMapping("/test/api")
|
||||
public class TestApiController extends BaseController {
|
||||
@Autowired
|
||||
@Resource
|
||||
private ITestApiService testApiService;
|
||||
|
||||
/**
|
||||
@@ -58,7 +55,7 @@ public class TestApiController extends BaseController {
|
||||
/**
|
||||
* 获取接口详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
@GetMapping(value = "/detail/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(testApiService.selectTestApiById(id));
|
||||
}
|
||||
@@ -67,7 +64,7 @@ public class TestApiController extends BaseController {
|
||||
* 新增接口
|
||||
*/
|
||||
@Log(title = "接口", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@PostMapping(value = "/add")
|
||||
public AjaxResult add(@RequestBody TestApi testApi) {
|
||||
return toAjax(testApiService.insertTestApi(testApi));
|
||||
}
|
||||
@@ -76,7 +73,7 @@ public class TestApiController extends BaseController {
|
||||
* 修改接口
|
||||
*/
|
||||
@Log(title = "接口", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@PostMapping(value = "/edit")
|
||||
public AjaxResult edit(@RequestBody TestApi testApi) {
|
||||
return toAjax(testApiService.updateTestApi(testApi));
|
||||
}
|
||||
@@ -85,7 +82,7 @@ public class TestApiController extends BaseController {
|
||||
* 删除接口
|
||||
*/
|
||||
@Log(title = "接口", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@PostMapping("/del/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(testApiService.deleteTestApiByIds(ids));
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export function listApi(query) {
|
||||
// 查询接口详细
|
||||
export function getApi(id) {
|
||||
return request({
|
||||
url: '/test/api/' + id,
|
||||
url: '/test/api/detail/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -20,7 +20,7 @@ export function getApi(id) {
|
||||
// 新增接口
|
||||
export function addApi(data) {
|
||||
return request({
|
||||
url: '/test/api',
|
||||
url: '/test/api/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -29,8 +29,8 @@ export function addApi(data) {
|
||||
// 修改接口
|
||||
export function updateApi(data) {
|
||||
return request({
|
||||
url: '/test/api',
|
||||
method: 'put',
|
||||
url: '/test/api/edit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -38,7 +38,7 @@ export function updateApi(data) {
|
||||
// 删除接口
|
||||
export function delApi(id) {
|
||||
return request({
|
||||
url: '/test/api/' + id,
|
||||
method: 'delete'
|
||||
url: '/test/api/del/' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user