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