diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/PHPController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/PHPController.java new file mode 100644 index 00000000..52480c19 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/PHPController.java @@ -0,0 +1,42 @@ +package cn.ysk.cashier.controller; + +import cn.hutool.crypto.SecureUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.client.RestTemplate; + +import java.util.HashMap; +import java.util.Map; + +/** + * 收银系统图片模板库 + * @author lyf + */ +@RestController +@RequestMapping("/channel") +public class PHPController { + /** + * 获取图片分类 + * @return + */ + @GetMapping("/file/getcommon-category") + public JSONObject getcommonCategory(){ + String baseUrl = "https://kysh.sxczgkj.cn/channel/file/getcommon-category"; + RestTemplate restTemplate = new RestTemplate(); + String forObject = restTemplate.getForObject(baseUrl, String.class); + return JSONObject.parseObject(forObject); + } + + @GetMapping("/file/getcommon-picture") + public JSONObject getcommonPicture(@RequestParam String category, @RequestParam String page, @RequestParam String size){ + String baseUrl = "https://kysh.sxczgkj.cn/channel/file/getcommon-picture?"; + RestTemplate restTemplate = new RestTemplate(); + Map map = new HashMap<>(); + map.put("category", category); + map.put("page", page); + map.put("size", size); + String forObject = restTemplate.postForObject(baseUrl,map, String.class); + return JSONObject.parseObject(forObject); + } +}