package cn.reghao.tnb.sb.zk.controller;

import cn.reghao.tnb.sb.zk.service.ZkService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author reghao
 * @date 2022-07-26 10:28:30
 */
@RestController
@RequestMapping("/zk/api")
public class ZkController {
    private ZkService zkService;

    public ZkController(ZkService zkService) {
        this.zkService = zkService;
    }

    @PostMapping("/name")
    public void setName(String name) throws Exception {
        zkService.setName(name);
    }

    @GetMapping("/name")
    public String getName() {
        return zkService.getName();
    }
}
