接口记录表 wcs对外接口 绑定料架接口

This commit is contained in:
liuhanqing
2025-07-10 09:26:00 +08:00
parent 0baf2119e4
commit 8e3f72e0ae
28 changed files with 1934 additions and 76 deletions

View File

@@ -0,0 +1,104 @@
package com.ruoyi.log.controller;
import java.util.List;
import javax.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;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.log.domain.RequestLog;
import com.ruoyi.log.service.IRequestLogService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 接口记录Controller
*
* @author ruoyi
* @date 2025-07-02
*/
@RestController
@RequestMapping("/requestInterface/log")
public class RequestLogController extends BaseController
{
@Autowired
private IRequestLogService requestLogService;
/**
* 查询接口记录列表
*/
@PreAuthorize("@ss.hasPermi('requestInterface:log:list')")
@GetMapping("/list")
public TableDataInfo list(RequestLog requestLog)
{
startPage();
List<RequestLog> list = requestLogService.selectRequestLogList(requestLog);
return getDataTable(list);
}
/**
* 导出接口记录列表
*/
@PreAuthorize("@ss.hasPermi('requestInterface:log:export')")
@Log(title = "接口记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RequestLog requestLog)
{
List<RequestLog> list = requestLogService.selectRequestLogList(requestLog);
ExcelUtil<RequestLog> util = new ExcelUtil<RequestLog>(RequestLog.class);
util.exportExcel(response, list, "接口记录数据");
}
/**
* 获取接口记录详细信息
*/
@PreAuthorize("@ss.hasPermi('requestInterface:log:query')")
@GetMapping(value = "/{requestId}")
public AjaxResult getInfo(@PathVariable("requestId") Long requestId)
{
return success(requestLogService.selectRequestLogByRequestId(requestId));
}
/**
* 新增接口记录
*/
@PreAuthorize("@ss.hasPermi('requestInterface:log:add')")
@Log(title = "接口记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody RequestLog requestLog)
{
return toAjax(requestLogService.insertRequestLog(requestLog));
}
/**
* 修改接口记录
*/
@PreAuthorize("@ss.hasPermi('requestInterface:log:edit')")
@Log(title = "接口记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RequestLog requestLog)
{
return toAjax(requestLogService.updateRequestLog(requestLog));
}
/**
* 删除接口记录
*/
@PreAuthorize("@ss.hasPermi('requestInterface:log:remove')")
@Log(title = "接口记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{requestIds}")
public AjaxResult remove(@PathVariable Long[] requestIds)
{
return toAjax(requestLogService.deleteRequestLogByRequestIds(requestIds));
}
}