CacheController.java 1.27 KB
Newer Older
eddie.woo's avatar
eddie.woo committed
1 2 3 4 5 6 7 8 9 10
package pwc.taxtech.atms.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.CacheDto;
11 12 13
import pwc.taxtech.atms.service.impl.CacheServiceImpl;

import java.util.List;
eddie.woo's avatar
eddie.woo committed
14 15 16 17 18 19

@RestController
@RequestMapping("/api/v1/cache/")
public class CacheController {

    @Autowired
20
    private CacheServiceImpl cacheService;
eddie.woo's avatar
eddie.woo committed
21

gary's avatar
gary committed
22
//    @ApiOperation(value = "Get all cache")
eddie.woo's avatar
eddie.woo committed
23
    @RequestMapping(value = "getallcache", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
24 25
    public @ResponseBody
    List<CacheDto> getAllCache() {
eddie.woo's avatar
eddie.woo committed
26 27 28
        return cacheService.getAllCache();
    }

gary's avatar
gary committed
29
//    @ApiOperation(value = "Get cache by key")
eddie.woo's avatar
eddie.woo committed
30 31 32 33 34
    @RequestMapping(value = "getcachebykey", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public CacheDto getCacheByKey(@RequestParam("cacheKey") String cacheKey) {
        return cacheService.getCacheByKey(cacheKey);
    }
}