Newer
Older
luck / src / main / java / me / bello / luck / LuckController.java
bello on 17 Sep 2020 4 KB m6
package me.bello.luck;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.ServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;

@RestController
public class LuckController {

    @Resource
    LuckService luckService;

    @RequestMapping(value = {"/queryHistoryList"})
    public Map<String, Object> queryHistoryList(ServletRequest req) throws Exception{
        int limit = Integer.parseInt(req.getParameter("limit"));

        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        String day = format.format(Calendar.getInstance().getTime());

        List<Map<String, Object>> listA = luckService.doQueryHistoryList("a", day, limit);
        List<Map<String, Object>> listB = luckService.doQueryHistoryList("b", day, limit);
        List<Map<String, Object>> listC = luckService.doQueryHistoryList("c", day, limit);
        List<Map<String, Object>> listD = luckService.doQueryHistoryList("d", day, limit);

        Map<String, Object> map =new HashMap<>();
        map.put("a", listA);
        map.put("b", listB);
        map.put("c", listC);
        map.put("d", listD);

        return map;
    }


    @RequestMapping(value = {"/queryHistoryListAll"})
    public List<Map<String, Object>> queryHistoryListAll(ServletRequest req) throws Exception{

        List<Map<String, Object>> list = luckService.doQueryHistoryListAll();


        return list;
    }


    /**
     * 查询按公式计算的列表(含负数)
     * @param req
     * @return
     * @throws Exception
     */
    @RequestMapping(value = {"/queryHistoryFormulaListAll"})
    public List<Map<String, Object>> queryHistoryFormulaListAll(ServletRequest req) throws Exception{

        List<Map<String, Object>> list = luckService.queryHistoryFormulaListAll();


        return list;
    }

    /**
     * 查询按公式计算的列表(负数+10)
     * @param req
     * @return
     * @throws Exception
     */
    @RequestMapping(value = {"/queryHistoryFormulaNoMinusListAll"})
    public List<Map<String, Object>> queryHistoryFormulaNoMinusListAll(ServletRequest req) throws Exception{

        List<Map<String, Object>> list = luckService.queryHistoryFormulaNoMinusListAll();


        return list;
    }


    /**
     * 查询按公式2计算的列表
     * @param req
     * @return
     * @throws Exception
     */
    @RequestMapping(value = {"/queryHistoryFormulaM2ListAll"})
    public List<Map<String, Object>> queryHistoryFormulaM2ListAll(ServletRequest req) throws Exception{

        List<Map<String, Object>> list = luckService.queryHistoryFormulaM2ListAll();


        return list;
    }


    /**
     * 查询按公式3计算的列表
     * @param req
     * @return
     * @throws Exception
     */
    @RequestMapping(value = {"/queryHistoryFormulaM3ListAll"})
    public List<Map<String, Object>> queryHistoryFormulaM3ListAll(ServletRequest req) throws Exception{

        List<Map<String, Object>> list = luckService.queryHistoryFormulaM3ListAll();


        return list;
    }

    /**
     * 查询按公式4计算的列表
     * @param req
     * @return
     * @throws Exception
     */
    @RequestMapping(value = {"/queryHistoryFormulaM4ListAll"})
    public List<Map<String, Object>> queryHistoryFormulaM4ListAll(ServletRequest req) throws Exception{

        List<Map<String, Object>> list = luckService.queryHistoryFormulaM4ListAll();


        return list;
    }

    /**
     * 查询按公式3计算的列表
     * @param req
     * @return
     * @throws Exception
     */
    @RequestMapping(value = {"/queryHistoryFormulaM5ListAll"})
    public List<Map<String, Object>> queryHistoryFormulaM5ListAll(ServletRequest req) throws Exception{

        List<Map<String, Object>> list = luckService.queryHistoryFormulaM5ListAll();


        return list;
    }

 /**
     * 查询按公式6计算的列表
     * @param req
     * @return
     * @throws Exception
     */
    @RequestMapping(value = {"/queryHistoryFormulaM6ListAll"})
    public List<Map<String, Object>> queryHistoryFormulaM6ListAll(ServletRequest req) throws Exception{

        List<Map<String, Object>> list = luckService.queryHistoryFormulaM6ListAll();


        return list;
    }





}