package com.luqj.common.controller; import com.luqj.common.domain.SelectItem; import com.luqj.common.service.ICommonService; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController @RequestMapping("/common") public class SelectCommonController extends BaseController { @Autowired private ICommonService comCategory; @GetMapping("/select/search") public AjaxResult selectSearch(String tableName, String keyword, String fieldId, String fieldName) { if(tableName.contains(" ") || fieldId.contains(" ") || fieldName.contains(" ")){ return AjaxResult.error("注入嫌疑"); } List searchs = comCategory.search(tableName, fieldId, fieldName, keyword); return AjaxResult.success(searchs); } }