/*
 * Author: wangjian
 * 生成controller
 */
package com.tofly.xrtygis.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tofly.common.core.entity.ResultRespone;
import com.tofly.common.log.annotation.ToFlyAppLog;
import com.tofly.xrtygis.entity.Dmapietype;
import com.tofly.xrtygis.service.DmapietypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 分区计量ICF管材类别表
 *
 * @author admin
 * @date Tue May 18 00:00:00 CST 2021
 */
@RestController
@AllArgsConstructor
@RequestMapping("/dmapietype")
@Api(tags="分区计量--ICF管材类别表接口")
public class DmapietypeController {

    private final DmapietypeService dmapietypeService;

//    /**
//    * 分页查询
//    * @param page 分页对象
//    * @param dmapietype 分区计量ICF管材类别表
//    * @return
//    */
//    @GetMapping("/page" )
//    @ApiOperation(value = "分页查询")
//    public ResultRespone getDmapietypePage(Page page, @ModelAttribute Dmapietype dmapietype) {
//      return ResultRespone.success(dmapietypeService.page(page, Wrappers.query(dmapietype)));
//    }


    /**
     * 通过id查询分区计量ICF管材类别表
     * @param mid id
     * @return ResultRespone
     */
    @GetMapping("/{mid}" )
    @ApiOperation(value = "通过ID查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "mid", value = "ID", required = true, dataType = "Long")
    })
    public ResultRespone getById(@PathVariable("mid" ) Long mid) {
      return ResultRespone.success(dmapietypeService.getById(mid));
    }

    /**
     * 新增分区计量ICF管材类别表
     * @param dmapietype 分区计量ICF管材类别表
     * @return ResultRespone
     */
//    //(title="新增分区计量ICF管材类别表" )
//    @ApiOperation(value = "新增分区计量ICF管材类别表")
//    @PostMapping
//    public ResultRespone save(@RequestBody Dmapietype dmapietype) {
//      return ResultRespone.success(dmapietypeService.save(dmapietype));
//    }

    /**
     * 修改分区计量ICF管材类别表
     * @param dmapietype 分区计量ICF管材类别表
     * @return ResultRespone
     */
    //(title="修改分区计量ICF管材类别表" )
    @ApiOperation(value = "修改分区计量ICF管材类别表")
    @PutMapping
    public ResultRespone updateById(@RequestBody Dmapietype dmapietype) {
      return ResultRespone.success(dmapietypeService.updateById(dmapietype));
    }
//
//    /**
//     * 通过id删除分区计量ICF管材类别表
//     * @param mid id
//     * @return ResultRespone
//     */
//    //(title="通过id删除分区计量ICF管材类别表" )
//    @ApiOperation(value = "通过ID删除分区计量ICF管材类别表")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "mid", value = "ID", required = true, dataType = "Long")
//    })
//    @DeleteMapping("/{mid}" )
//    public ResultRespone removeById(@PathVariable Long mid) {
//      return ResultRespone.success(dmapietypeService.removeById(mid));
//    }
//
//    /**
//     * 通过id批量删除分区计量ICF管材类别表
//     * @param ids id
//     * @return ResultRespone
//     */
//    //(title="通过id批量删除分区计量ICF管材类别表" )
//    @ApiOperation(value = "通过ID批量删除分区计量ICF管材类别表")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "ids", value = "批量删除，多个id以逗号隔开", required = true, dataType = "String")
//    })
//    @DeleteMapping("/deleteByIds" )
//    public ResultRespone removeById(String ids) {
//        return ResultRespone.success(dmapietypeService.removeByIds(Arrays.asList(ids.split(","))));
//    }
}
