| | |
| | | package com.yami.trading.admin.controller.miner; |
| | | |
| | | import com.yami.trading.admin.controller.service.MinerService; |
| | | import com.yami.trading.bean.model.Miner; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: trading-order-master |
| | |
| | | @Slf4j |
| | | public class MinerController { |
| | | |
| | | @Autowired |
| | | private MinerService minerService; |
| | | |
| | | // 添加矿机 |
| | | @PostMapping("/add") |
| | | public boolean addMiner(@RequestBody Miner miner) { |
| | | return minerService.addMiner(miner); |
| | | } |
| | | |
| | | // 删除矿机 |
| | | @DeleteMapping("/delete/{id}") |
| | | public boolean deleteMiner(@PathVariable int id) { |
| | | return minerService.deleteMiner(id); |
| | | } |
| | | |
| | | // 更新矿机 |
| | | @PutMapping("/update") |
| | | public boolean updateMiner(@RequestBody Miner miner) { |
| | | return minerService.updateMiner(miner); |
| | | } |
| | | |
| | | // 获取矿机详情 |
| | | @GetMapping("/get/{id}") |
| | | public Miner getMiner(@PathVariable int id) { |
| | | return minerService.getMiner(id); |
| | | } |
| | | |
| | | // 获取所有矿机 |
| | | @GetMapping("/getAll") |
| | | public List<Miner> getAllMiners() { |
| | | return minerService.getAllMiners(); |
| | | } |
| | | |
| | | |
| | | } |