package com.upsfj.sfjprojectbackend.controller;

import com.upsfj.sfjprojectbackend.entity.Field;
import com.upsfj.sfjprojectbackend.entity.UseCase;
import com.upsfj.sfjprojectbackend.service.impl.FieldServiceImpl;
import com.upsfj.sfjprojectbackend.service.impl.UsecaseServiceImpl;
import jakarta.annotation.Resource;
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;

@RestController
@RequestMapping("/api/use")
public class UseController {
    @Resource
    UsecaseServiceImpl usecaseService;

    @PostMapping("/addUse")
    public void addField(@RequestBody UseCase useCase){
        usecaseService.addUsecase(useCase.getUsecase_name());
    }



    @PostMapping("/updateUse")
    public void updateField(@RequestBody UseCase useCase){
        usecaseService.updateUsecase(useCase);
    }

    @PostMapping("/deleteUse")
    public void deleteField(@RequestBody UseCase useCase){
        usecaseService.deleteUsecase(useCase);
    }


}
