package com.lion.lionwebsite.Controller;

import com.lion.lionwebsite.Service.SubService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/personal/subBind/")
public class SubController {
    SubService subService;

    public SubController(SubService subService) {
        this.subService = subService;
    }

    @PostMapping("")
    public String addSubBind(String user){
        return subService.insertSubBind(user);
    }

    @PutMapping("")
    public String resetKey(String user){
        return subService.resetKey(user);
    }

    @GetMapping("all")
    public String getAllSubBind(){
        return subService.selectAllSubBind();
    }

    @GetMapping("allRecord")
    public String getAllSubUpdateRecord(){
        return subService.SelectAllSubUpdateRecord();
    }

    @DeleteMapping("")
    public String deleteSubBind(String user){
        return subService.deleteSubBind(user);
    }
}
