太湖英才

This commit is contained in:
wuchunlei
2025-05-13 17:55:37 +08:00
parent e4730b8a2a
commit 6ec399baff
7 changed files with 267 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
package com.peanut.modules.master.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.peanut.common.utils.R;
import com.peanut.modules.common.entity.TaihuTalent;
import com.peanut.modules.common.service.TaihuTalentService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@Slf4j
@RestController("masterTaihuTalent")
@RequestMapping("master/taihuTalent")
public class TaihuTalentController {
@Autowired
private TaihuTalentService taihuTalentService;
//太湖英才列表
@RequestMapping("/getTaihuTalents")
public R getTaihuTalents(@RequestBody Map<String,Object> params){
LambdaQueryWrapper<TaihuTalent> wrapper = new LambdaQueryWrapper<>();
wrapper.like(StringUtils.isNotEmpty(params.get("name").toString()),TaihuTalent::getName,params.get("name"));
wrapper.like(StringUtils.isNotEmpty(params.get("region").toString()),TaihuTalent::getRegion,params.get("region"));
return R.ok().put("list",taihuTalentService.list(wrapper));
}
//新增太湖英才
@RequestMapping("/addTaihuTalent")
public R addTaihuTalent(@RequestBody TaihuTalent taihuTalent){
taihuTalentService.save(taihuTalent);
return R.ok();
}
//修改太湖英才
@RequestMapping("/updateTaihuTalent")
public R updateTaihuTalent(@RequestBody TaihuTalent taihuTalent){
taihuTalentService.updateById(taihuTalent);
return R.ok();
}
//删除太湖英才
@RequestMapping("/delTaihuTalent")
public R delTaihuTalent(@RequestBody TaihuTalent taihuTalent){
taihuTalentService.removeById(taihuTalent);
return R.ok();
}
//太湖英才详情
@RequestMapping("/taihuTalentInfo")
public R taihuTalentInfo(@RequestBody Map<String,Object> params){
TaihuTalent taihuTalent = taihuTalentService.getById(params.get("id").toString());
return R.ok().put("taihuTalent",taihuTalent);
}
}