package com.casic.missiles.modular.system.controller;

import com.casic.missiles.core.base.controller.BaseController;
import com.casic.missiles.modular.system.model.MetaModuleParam;
import com.casic.missiles.modular.system.service.ModuleConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import javax.xml.ws.Response;

/**
 * @author cz
 * @Date 2022-12-04
 */
@RestController
@RequestMapping("/metaModule/config")
@Api(tags = "模块配置")
@AllArgsConstructor
public class ModuleConfigController extends BaseController {

    private final ModuleConfigService moduleConfigService;

    /**
     * 显示字段的初始化
     *
     * @return
     */
    @RequestMapping(value = "/init")
    @ApiOperation("字段初始化")
    public void getField() {
         moduleConfigService.getTableNameField();
    }

    @RequestMapping(value = "/save")
    public Object saveMetaModule(@RequestBody MetaModuleParam metaModuleParam) {
        return moduleConfigService.saveMetaModule(metaModuleParam);
    }

    @RequestMapping(value = "/delete")
    public Object deleteMetaModule(@RequestBody MetaModuleParam metaModuleParam) {
        return moduleConfigService.deleteMetaModule(metaModuleParam);
    }

}
