字典类型信息查询

master
冷调 2024-08-26 20:06:50 +08:00
parent 2495bb4792
commit 47bfc55062
3 changed files with 29 additions and 11 deletions

View File

@ -1,9 +1,18 @@
package com.muyu.source.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.source.domain.DataType;
import com.muyu.source.service.DataTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author Lenovo
* @ ToolIntelliJ IDEA
@ -15,4 +24,23 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/type")
public class DataTypeController extends BaseController {
@Autowired
private DataTypeService dataTypeService;
/**
*
* @return
*/
@GetMapping("/getDataType")
public Result getDataType(){
List<DataType> list = dataTypeService.list();
return Result.success(list);
}
@GetMapping("/getDataTypeByType/{type}")
public Result getDataTypeByType(@PathVariable("type") String type){
DataType dataType = dataTypeService.getOne(new LambdaQueryWrapper<>() {{
eq(DataType::getType, type);
}});
return Result.success(dataType);
}
}

View File

@ -32,16 +32,6 @@ public class DictDataController {
@Autowired
private DictDataService dictDataService;
/**
*
* @return
*/
@GetMapping("/selectDictDataList")
public Result<List<DictData>> selectDictDataList() {
List<DictData> list = dictDataService.list();
return Result.success(list);
}
/**
*
*

View File

@ -26,7 +26,7 @@ import java.util.List;
*/
@Log4j2
@RestController
@RequestMapping("/dict_type")
@RequestMapping("/dictType")
public class DictTypeController {
public DictTypeController() {
log.info("forest扫描路径:{}", ForestScannerRegister.getBasePackages());