package com.ygj.yuemum.controller.modoo; import com.alibaba.fastjson.JSONObject; import com.ygj.yuemum.domain.modoo.ModooLog; import com.ygj.yuemum.service.modoo.ModooLogService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Map; @RestController public class ModooLogController { @Autowired private ModooLogService modooLogService; @GetMapping("/getModooLogs") public String getModooLogs(@RequestParam("page") Integer page,@RequestParam("limit") Integer limit) { Map modooLogs = modooLogService.getModooLogs(page,limit); String jso = JSONObject.toJSONString(modooLogs); return jso; } @GetMapping("/getAllModooLogs") public List getAllModooLogs() { return modooLogService.getAll(); } @PostMapping("/addModooLog") public int add(@ModelAttribute ModooLog modooLog) { return modooLogService.addModooLog(modooLog); } @GetMapping("/deleteModooLog/{id}") public int delete(@PathVariable("id") Integer id) { return modooLogService.deleteModooLog(id); } @GetMapping("/getModooLog/{id}") public ModooLog getOne(@PathVariable("id") Integer id) { return modooLogService.getModooLog(id); } }