package com.dsk.biz.controller;

import com.dsk.biz.domain.BusinessLabel;
import com.dsk.biz.domain.bo.BusinessIdDto;
import com.dsk.biz.service.IBusinessLabelService;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.R;
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;

/**
 * 项目标签Controller
 *
 * @author lxl
 * @date 2023-05-17
 */
@RestController
@RequestMapping("/business/label")
public class BusinessLabelController extends BaseController
{
    @Autowired
    private IBusinessLabelService businessLabelService;


    /**
     * 新增项目标签
     */
//    @PreAuthorize("@ss.hasPermi('system:label:add')")
//    @Log(title = "项目标签", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public R<Void> add(@RequestBody BusinessLabel businessLabel)
    {
        return toAjax(businessLabelService.insertBusinessLabel(businessLabel));
    }


     /**
     * 删除项目标签
     */
//    @PreAuthorize("@ss.hasPermi('system:label:remove')")
//    @Log(title = "项目标签", businessType = BusinessType.DELETE)
    @PostMapping("/remove")
    public R<Void> remove(@RequestBody BusinessIdDto dto)
    {
        return toAjax(businessLabelService.deleteBusinessLabelById(dto));
    }

}
