package com.fjhx.iot.controller.tda;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.fjhx.common.constant.SourceConstant;
import com.fjhx.common.constant.SourceConstant;
import com.fjhx.iot.entity.tda.dto.TdaApplicationDto;
import com.fjhx.iot.entity.tda.dto.TdaApplicationSelectDto;
import com.fjhx.iot.entity.tda.vo.TdaApplicationVo;
import com.fjhx.iot.service.tda.TdaApplicationService;
import com.ruoyi.common.core.domain.BaseSelectDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 行业管理 前端控制器
 * </p>
 *
 * @author zlj
 * @since 2023-03-21
 */
@DS(SourceConstant.IOT)
@RestController
@RequestMapping("/tdaApplication")
public class TdaApplicationController {

    @Autowired
    private TdaApplicationService tdaApplicationService;

    /**
     * 行业管理分页
     */
    @PostMapping("/page")
    public Page<TdaApplicationVo> page(@RequestBody TdaApplicationSelectDto dto) {
        return tdaApplicationService.getPage(dto);
    }

    /**
     * 行业管理明细
     */
    @PostMapping("/detail")
    public TdaApplicationVo detail(@RequestBody BaseSelectDto dto) {
        return tdaApplicationService.detail(dto.getId());
    }

    /**
     * 行业管理新增
     */
    @PostMapping("/add")
    public void add(@RequestBody TdaApplicationDto tdaApplicationDto) {
        tdaApplicationService.add(tdaApplicationDto);
    }

    /**
     * 行业管理删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        tdaApplicationService.delete(dto.getId());
    }

}
