main
parent
f28e09acc1
commit
a277ceb764
@ -1,96 +0,0 @@
|
|||||||
package com.ruoyi.tc.controller;
|
|
||||||
|
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
|
||||||
import com.ruoyi.tc.entity.UnitOtherConcat;
|
|
||||||
import com.ruoyi.tc.service.UnitOtherConcatService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单位其他联系人(unit_other_contact)控制层
|
|
||||||
* @author du
|
|
||||||
* @since 2024/11/13 14:50
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/tc/unit/otherConcat")
|
|
||||||
@Api(tags = "单位其他联系人控制层")
|
|
||||||
public class UnitOtherConcatController extends BaseController {
|
|
||||||
/**
|
|
||||||
* 服务对象
|
|
||||||
*/
|
|
||||||
@Resource
|
|
||||||
private UnitOtherConcatService unitOtherConcatService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据unit_id查询该单位所有数据
|
|
||||||
*
|
|
||||||
* @param unitId 查询unit_id
|
|
||||||
* @return 所有数据
|
|
||||||
*/
|
|
||||||
// @PreAuthorize("@ss.hasAnyRoles('admin')")
|
|
||||||
@ApiOperation(value = "根据unit_id查询该单位所有数据", response = UnitOtherConcat.class)
|
|
||||||
@GetMapping("/selectAll/{unitId}")
|
|
||||||
public AjaxResult selectAll(@PathVariable Long unitId) {
|
|
||||||
return success(unitOtherConcatService.lambdaQuery().eq(UnitOtherConcat::getUnitId,unitId).list());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 单条数据
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "通过主键查询单条数据", response = UnitOtherConcat.class)
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public AjaxResult selectOne(@PathVariable Serializable id) {
|
|
||||||
return success(unitOtherConcatService.getById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增数据
|
|
||||||
*
|
|
||||||
* @param u 实体对象
|
|
||||||
* @return 新增结果
|
|
||||||
*/
|
|
||||||
// @PreAuthorize("@ss.hasAnyRoles('admin')")
|
|
||||||
@ApiOperation(value = "新增数据")
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult insert(@Valid @RequestBody UnitOtherConcat u) {
|
|
||||||
return success(unitOtherConcatService.save(u));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改数据
|
|
||||||
*
|
|
||||||
* @param u 实体对象
|
|
||||||
* @return 修改结果
|
|
||||||
*/
|
|
||||||
// @PreAuthorize("@ss.hasAnyRoles('admin')")
|
|
||||||
@ApiOperation(value = "修改数据")
|
|
||||||
@PostMapping("/edit")
|
|
||||||
public AjaxResult update(@RequestBody UnitOtherConcat u) {
|
|
||||||
return success(unitOtherConcatService.updateById(u));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除数据
|
|
||||||
*
|
|
||||||
* @param ids 主键结合
|
|
||||||
* @return 删除结果
|
|
||||||
*/
|
|
||||||
// @PreAuthorize("@ss.hasAnyRoles('admin')")
|
|
||||||
@ApiOperation(value = "删除数据")
|
|
||||||
@PostMapping("/ids")
|
|
||||||
public AjaxResult delete(Long[] ids) {
|
|
||||||
return success(unitOtherConcatService.removeBatchByIds(Arrays.asList(ids)));
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in new issue