package com.yb.controller;
|
|
import java.lang.reflect.Field;
|
import java.util.ArrayList;
|
import java.util.Arrays;
|
import java.util.HashMap;
|
import java.util.Map;
|
|
import com.yb.config.PageUtils;
|
import com.yb.config.R;
|
import com.yb.entity.GisOsmPoisFree1Entity;
|
|
import com.yb.service.GisOsmPoisFree1Service;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
/**
|
* ${comments}
|
*
|
* @author yw
|
* @email leutu@qq.com
|
* @date 2024-09-03 17:26:02
|
*/
|
@RestController
|
@RequestMapping("malan/gisosmpoisfree1")
|
public class GisOsmPoisFree1Controller {
|
@Autowired
|
private GisOsmPoisFree1Service gisOsmPoisFree1Service;
|
|
/**
|
* 列表
|
*/
|
@GetMapping("/list")
|
@ApiOperation(value = "list", notes = "参数 : page,limit")
|
public R list(@RequestParam Map<String, Object> params){
|
PageUtils page = gisOsmPoisFree1Service.queryPage(params);
|
|
return R.ok().put("page", page);
|
}
|
|
|
/**
|
* 列表
|
*/
|
@GetMapping("/query")
|
@ApiOperation(value = "query", notes = "")
|
public R query(@RequestParam Map<String, Object> params){
|
PageUtils page = gisOsmPoisFree1Service.query(params);
|
|
return R.ok().put("page", page);
|
}
|
/**
|
* 列表
|
*/
|
@PostMapping("/listAll")
|
@ApiOperation(value = "listAll", notes = "")
|
public R listAll(){
|
PageUtils page = gisOsmPoisFree1Service.queryPage(new HashMap<String,Object>());
|
|
return R.ok().put("page", page);
|
}
|
/**
|
* 信息
|
*/
|
@PostMapping("/info/{gid}")
|
@ApiOperation(value = "info", notes = "")
|
public R info(@PathVariable("gid") Integer gid){
|
GisOsmPoisFree1Entity gisOsmPoisFree1 = gisOsmPoisFree1Service.getById(gid);
|
|
return R.ok().put("gisOsmPoisFree1", gisOsmPoisFree1);
|
}
|
|
/**
|
* 保存
|
*/
|
@PostMapping("/save")
|
@ApiOperation(value = "save", notes = "")
|
public R save(@RequestBody GisOsmPoisFree1Entity gisOsmPoisFree1){
|
gisOsmPoisFree1Service.save(gisOsmPoisFree1);
|
|
return R.ok();
|
}
|
|
/**
|
* 修改
|
*/
|
@PostMapping("/update")
|
@ApiOperation(value = "update", notes = "")
|
public R update(@RequestBody GisOsmPoisFree1Entity gisOsmPoisFree1){
|
gisOsmPoisFree1Service.updateById(gisOsmPoisFree1);
|
|
return R.ok();
|
}
|
|
/**
|
* 删除
|
*/
|
@PostMapping("/delete")
|
@ApiOperation(value = "delete", notes = "")
|
public R delete(@RequestBody Integer[] gids){
|
gisOsmPoisFree1Service.removeByIds(Arrays.asList(gids));
|
|
return R.ok();
|
}
|
|
/**
|
* 修改
|
*/
|
@PostMapping("/getTableMeta")
|
@ApiOperation(value = "getTableMeta", notes = "")
|
public R getTableMeta() {
|
ArrayList<Map<String,String>> list = new ArrayList<Map<String,String>>();
|
|
Field[] fields =GisOsmPoisFree1Entity.class.getDeclaredFields();
|
for (Field field : fields) {
|
Map<String,String> map = new HashMap<>();
|
System.out.println("属性名:" + field.getName());
|
System.out.println("类型:" + field.getType().getName());
|
map.put("name",field.getName());
|
map.put("type",field.getType().getName());
|
map.put("cname",field.getName());
|
list.add(map);
|
}
|
return R.ok(list);
|
}
|
}
|