diff --git a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/HolidayController.java b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/HolidayController.java index 1f07223..2052058 100644 --- a/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/HolidayController.java +++ b/mailbox-outer-admin/src/main/java/com/biutag/outeradmin/controller/HolidayController.java @@ -1,7 +1,6 @@ package com.biutag.outeradmin.controller; import com.biutag.core.AjaxResult; -import com.biutag.outeradmin.model.dto.LoginDto; import com.biutag.outeradmin.model.vo.HolidayVo; import com.biutag.outeradmin.service.HolidayService; import io.swagger.annotations.Api; @@ -9,7 +8,6 @@ import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.List; import java.util.Map; @@ -19,9 +17,7 @@ import java.util.Map; @Api(tags = "节假日接口") @RequestMapping("/outer/holiday") public class HolidayController { - - @Resource - private HolidayService holidayService; + private final HolidayService holidayService; @RequestMapping("/getholiday") @ApiOperation("查询节假日") @@ -30,11 +26,11 @@ public class HolidayController { //判断年份 LocalDateTime currentDate = LocalDateTime.now(); int currentyear = currentDate.getYear(); - if (Integer.parseInt(search) != currentyear){ + if (Integer.parseInt(search) != currentyear) { return AjaxResult.success(); } - Map> map = holidayService.showholiday(); - return AjaxResult.success(map); + Map> map = holidayService.showholiday(); + return AjaxResult.success(map); } @@ -44,7 +40,7 @@ public class HolidayController { public AjaxResult setlist(@RequestBody String search) throws Exception { LocalDateTime currentDate = LocalDateTime.now(); int currentyear = currentDate.getYear(); - if (Integer.parseInt(search) != currentyear){ + if (Integer.parseInt(search) != currentyear) { return AjaxResult.success(); } holidayService.saveholiday(search); @@ -56,10 +52,9 @@ public class HolidayController { @RequestMapping("/showholiday") @ApiOperation("进入页面显示节假日") public AjaxResult getlist() throws Exception { - Map> map = holidayService.showholiday(); - return AjaxResult.success(map); + Map> map = holidayService.showholiday(); + return AjaxResult.success(map); } - }