package com.terra.lfdcexp.controller;
|
|
|
import com.terra.lfdcexp.config.R;
|
import com.terra.lfdcexp.entity.SysOrgEntity;
|
import com.terra.lfdcexp.service.SysOrgService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
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 java.util.Arrays;
|
|
|
/**
|
* ${comments}
|
*
|
* @author chenshun
|
* @email sunlightcs@gmail.com
|
* @date 2023-09-21 19:07:03
|
*/
|
@Api(tags = "SysOrgController")
|
@RestController
|
@RequestMapping("generator/sysorg")
|
public class SysOrgController {
|
@Autowired
|
private SysOrgService sysOrgService;
|
|
/**
|
* 列表
|
*/
|
@RequestMapping("/list")
|
|
@ApiOperation(value = "generator:sysorg:list", notes = "")
|
public R list(@RequestBody SysOrgEntity sysOrgEntity){
|
//PageUtils page = sysOrgService.queryPage(params);
|
|
return R.ok().put("page", sysOrgService.list());
|
}
|
|
|
/**
|
* 信息
|
*/
|
@RequestMapping("/info/{id}")
|
|
@ApiOperation(value = "generator:sysorg:info", notes = "")
|
public R info(@PathVariable("id") Long id){
|
SysOrgEntity sysOrg = sysOrgService.getById(id);
|
|
return R.ok().put("sysOrg", sysOrg);
|
}
|
|
/**
|
* 保存
|
*/
|
@RequestMapping("/save")
|
|
@ApiOperation(value = "generator:sysorg:save", notes = "")
|
public R save(@RequestBody SysOrgEntity sysOrg){
|
sysOrgService.save(sysOrg);
|
|
return R.ok();
|
}
|
|
/**
|
* 修改
|
*/
|
@RequestMapping("/update")
|
|
@ApiOperation(value = "generator:sysorg:update", notes = "")
|
public R update(@RequestBody SysOrgEntity sysOrg){
|
sysOrgService.updateById(sysOrg);
|
|
return R.ok();
|
}
|
|
/**
|
* 删除
|
*/
|
@RequestMapping("/delete")
|
|
@ApiOperation(value = "generator:sysorg:delete", notes = "")
|
public R delete(@RequestBody Long[] ids){
|
sysOrgService.removeByIds(Arrays.asList(ids));
|
|
return R.ok();
|
}
|
|
}
|