New file |
| | |
| | | package com.moral.api.controller; |
| | | |
| | | import com.moral.api.service.HistoryDailyService; |
| | | import com.moral.api.service.HistoryFiveMinutelyService; |
| | | import com.moral.constant.ResultMessage; |
| | | import com.moral.util.DateUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName UserController |
| | | * @Description 用户管理 |
| | | * @Author 陈凯裕 |
| | | * @Date 2021/3/22 13:52 |
| | | * @Version TODO |
| | | **/ |
| | | @Slf4j |
| | | @Api(tags = {"公共功能"}) |
| | | @RestController |
| | | @RequestMapping("/pub") |
| | | public class PubController { |
| | | @Autowired |
| | | private HistoryDailyService historyDailyService; |
| | | @Autowired |
| | | private HistoryFiveMinutelyService historyFiveMinutelyService; |
| | | |
| | | @GetMapping("insertHistoryDaily") |
| | | @ApiOperation(value = "天数据补录", notes = "天数据补录") |
| | | public ResultMessage insertHistoryDaily(String time) { |
| | | Date d = DateUtils.getDate(time,"yyyy-MM-dd"); |
| | | historyDailyService.insertHistoryDaily(time); |
| | | int i = 0; |
| | | return new ResultMessage(); |
| | | } |
| | | |
| | | @GetMapping("insertHistoryFiveMinutely") |
| | | @ApiOperation(value = "5分钟数据", notes = "5分钟数据") |
| | | public ResultMessage insertHistoryFiveMinutely() { |
| | | historyFiveMinutelyService.insertHistoryFiveMinutely(); |
| | | return new ResultMessage(); |
| | | } |
| | | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String s = "2023-9-01"; |
| | | Date d = DateUtils.getDate(s,"yyyy-MM-dd"); |
| | | System.out.println(DateUtils.dateToDateFullString(d)); |
| | | //System.out.println( DateUtils.dateToDateFullString(DateUtils.getDateOfDay(d, -1), "yyyy-MM-dd")); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |