package com.goldenwater.slaj.hidd.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.goldenwater.common.core.controller.BaseController;
import com.goldenwater.common.core.domain.AjaxResult;
import com.goldenwater.common.core.page.TableDataInfo;
import com.goldenwater.slaj.hidd.domain.AttMedBase;
import com.goldenwater.slaj.hidd.service.IAttMedBaseService;

/**
 * 多媒体基础信息
 */
@RestController
@RequestMapping("/hidd/medbase")
public class AttMedBaseController extends BaseController {

    @Autowired
    private IAttMedBaseService attMedBaseService;

    /**
     * 查询多媒体基础信息列表
     */
    @GetMapping("/list")
    public TableDataInfo list(AttMedBase attMedBase) {
        startPage();
        List<AttMedBase> list = attMedBaseService.selectAttMedBaseList(attMedBase);
        return getDataTable(list);
    }

    /**
     * 获取多媒体基础信息详细信息
     */
    @GetMapping("/{guid}")
    public AjaxResult getInfo(@PathVariable String guid) {
        return AjaxResult.success(attMedBaseService.selectAttMedBaseByGuid(guid));
    }

    /**
     * 新增多媒体基础信息
     */
    @PostMapping
    public AjaxResult add(@RequestBody AttMedBase attMedBase) {
        return toAjax(attMedBaseService.insertAttMedBase(attMedBase));
    }

    /**
     * 修改多媒体基础信息
     */
    @PutMapping
    public AjaxResult edit(@RequestBody AttMedBase attMedBase) {
        return toAjax(attMedBaseService.updateAttMedBase(attMedBase));
    }

    /**
     * 删除多媒体基础信息
     */
    @DeleteMapping("/{guids}")
    public AjaxResult remove(@PathVariable String[] guids) {
        return toAjax(attMedBaseService.deleteAttMedBaseByGuids(guids));
    }
}
