VchanConfController.java 1.82 KB
package com.viontech.controller;

import com.viontech.service.adapter.IVachanConfService;
import com.viontech.vo.VchanConfVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: event_data_handle
 * @description: 视频通道配置
 * @author: authorName
 * @create: 2020-03-23 13:14
 **/
@RestController
public class VchanConfController extends BaseController {
    @Autowired
    IVachanConfService iVachanConfService;


    @PostMapping(value = "/vchan/conf")
    @ResponseBody
    public Object add(@RequestBody VchanConfVo vchanConfVo){
        iVachanConfService.add(vchanConfVo);
        Map result = new HashMap<>(2);
        result.put("ecode","200");
        result.put("enote","OK");
        return result;
    }

    @PostMapping(value = "/vchan/conf/{unid}")
    @ResponseBody
    public Object update(@RequestBody VchanConfVo vchanConfVo, @PathVariable("unid") Integer unid){
        vchanConfVo.setVchanConfUnid(unid);
        iVachanConfService.update(vchanConfVo);
        Map result = new HashMap<>(2);
        result.put("ecode","200");
        result.put("enote","OK");
        return result;
    }

    @DeleteMapping(value = "/vchan/conf/{unid}")
    @ResponseBody
    public Object delete(VchanConfVo vchanConfVo, @PathVariable("unid") Integer unid){
        vchanConfVo.setVchanConfUnid(unid);
        iVachanConfService.delete(vchanConfVo);
        Map result = new HashMap<>(2);
        result.put("ecode","200");
        result.put("enote","OK");
        return result;
    }

    @GetMapping(value = "/vchan/conf")
    @ResponseBody
    public Object findAll(VchanConfVo vchanConfVo){
        return iVachanConfService.findAll(vchanConfVo);
    }
}