/*
|
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
|
*
|
* Redistribution and use in source and binary forms, with or without
|
* modification, are permitted provided that the following conditions are met:
|
*
|
* Redistributions of source code must retain the above copyright notice,
|
* this list of conditions and the following disclaimer.
|
* Redistributions in binary form must reproduce the above copyright
|
* notice, this list of conditions and the following disclaimer in the
|
* documentation and/or other materials provided with the distribution.
|
* Neither the name of the dreamlu.net developer nor the names of its
|
* contributors may be used to endorse or promote products derived from
|
* this software without specific prior written permission.
|
* Author: Chill 庄骞 (smallchill@163.com)
|
*/
|
package cn.gistack.sm.skPanoramaState.controller;
|
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiParam;
|
import lombok.AllArgsConstructor;
|
import javax.validation.Valid;
|
|
import lombok.extern.slf4j.Slf4j;
|
import org.springblade.core.mp.support.Condition;
|
import org.springblade.core.mp.support.Query;
|
import org.springblade.core.tool.api.R;
|
import org.springblade.core.tool.utils.Func;
|
import org.springframework.web.bind.annotation.*;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import cn.gistack.sm.skPanoramaState.entity.SkPanoramaStateEntity;
|
import cn.gistack.sm.skPanoramaState.vo.SkPanoramaStateVO;
|
import cn.gistack.sm.skPanoramaState.wrapper.SkPanoramaStateWrapper;
|
import cn.gistack.sm.skPanoramaState.service.ISkPanoramaStateService;
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
/**
|
* 水库全景测站 控制器
|
*
|
* @author BladeX
|
* @since 2024-03-29
|
*/
|
|
@Slf4j
|
@Api(value = "水库全景测站", tags = "水库全景测站接口")
|
@RestController
|
@RequestMapping("/skPanoramaState")
|
@AllArgsConstructor
|
public class SkPanoramaStateController extends BladeController {
|
|
private ISkPanoramaStateService skPanoramaStateService;
|
|
/**
|
* 水库全景测站 详情
|
*/
|
@GetMapping("/detail")
|
@ApiOperation(value = "详情", notes = "传入skPanoramaState")
|
public R<SkPanoramaStateVO> detail(SkPanoramaStateEntity skPanoramaState) {
|
SkPanoramaStateEntity detail = skPanoramaStateService.getOne(Condition.getQueryWrapper(skPanoramaState));
|
return R.data(SkPanoramaStateWrapper.build().entityVO(detail));
|
}
|
/**
|
* 水库全景测站 分页
|
*/
|
@GetMapping("/list")
|
@ApiOperation(value = "分页", notes = "传入skPanoramaState")
|
public R<IPage<SkPanoramaStateVO>> list(SkPanoramaStateEntity skPanoramaState, Query query) {
|
IPage<SkPanoramaStateEntity> pages = skPanoramaStateService.page(Condition.getPage(query), Condition.getQueryWrapper(skPanoramaState));
|
return R.data(SkPanoramaStateWrapper.build().pageVO(pages));
|
}
|
|
/**
|
* 水库全景测站 自定义分页
|
*/
|
@GetMapping("/page")
|
@ApiOperation(value = "分页", notes = "传入skPanoramaState")
|
public R<IPage<SkPanoramaStateVO>> page(SkPanoramaStateVO skPanoramaState, Query query) {
|
IPage<SkPanoramaStateVO> pages = skPanoramaStateService.selectSkPanoramaStatePage(Condition.getPage(query), skPanoramaState);
|
return R.data(pages);
|
}
|
|
/**
|
* 水库全景测站 新增
|
*/
|
@PostMapping("/save")
|
@ApiOperation(value = "新增", notes = "传入skPanoramaState")
|
public R save(@Valid @RequestBody SkPanoramaStateEntity skPanoramaState) {
|
return R.status(skPanoramaStateService.save(skPanoramaState));
|
}
|
|
|
|
/**
|
* 水库全景测站 修改
|
*/
|
@PostMapping("/update")
|
@ApiOperation(value = "修改", notes = "传入skPanoramaState")
|
public R update(@Valid SkPanoramaStateEntity skPanoramaState) {
|
return R.status(skPanoramaStateService.updateById(skPanoramaState));
|
}
|
|
/**
|
* 水库全景测站 新增或修改
|
*/
|
@PostMapping("/submit")
|
@ApiOperation(value = "新增或修改", notes = "传入skPanoramaState")
|
public R submit(@Valid @RequestBody SkPanoramaStateEntity skPanoramaState) {
|
return R.status(skPanoramaStateService.saveOrUpdate(skPanoramaState));
|
}
|
|
/**
|
* 水库全景测站 删除
|
*/
|
@PostMapping("/remove")
|
@ApiOperation(value = "逻辑删除", notes = "传入ids")
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
return R.status(skPanoramaStateService.deleteLogic(Func.toLongList(ids)));
|
}
|
|
|
}
|