|
@@ -1,14 +1,18 @@
|
|
package com.xynet.marketing.controller;
|
|
package com.xynet.marketing.controller;
|
|
|
|
|
|
-import com.xynet.marketing.service.factory.plus.PlusFactory;
|
|
|
|
-import com.xynet.marketing.utils.FactoryUtils;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.xynet.marketing.service.ProjectService;
|
|
import com.xynet.marketing.utils.R;
|
|
import com.xynet.marketing.utils.R;
|
|
-import com.xynet.marketing.utils.error.BusinessException;
|
|
|
|
-import com.xynet.marketing.utils.redis.utils.RedisService;
|
|
|
|
|
|
+import com.xynet.marketing.utils.collections.map.JHashMap;
|
|
|
|
+import com.xynet.marketing.utils.collections.map.JMap;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
@@ -16,11 +20,32 @@ import java.util.Map;
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
@Slf4j
|
|
@Slf4j
|
|
public class TestController {
|
|
public class TestController {
|
|
- private RedisService<Object> redisService;
|
|
|
|
|
|
+ private ProjectService projectService;
|
|
|
|
+
|
|
|
|
+ @PostMapping("save")
|
|
|
|
+ public Object save(@RequestBody Map<String,Object> param){
|
|
|
|
+ projectService.saveOrUpdate(new JHashMap<>(param));
|
|
|
|
+ return R.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @PostMapping("test")
|
|
|
|
+ public Object test(@RequestBody Map<String,Object> param){
|
|
|
|
+ JMap<String, Object> param1 = new JHashMap<>(param);
|
|
|
|
+ JMap<String, Object> page = param1.getMap("page");
|
|
|
|
+ return R.ok(page.getInt("current"));
|
|
|
|
+ }
|
|
|
|
|
|
@PostMapping("aa")
|
|
@PostMapping("aa")
|
|
- public R<String> aa(@RequestBody Map<String,Object> param) {
|
|
|
|
- String v = FactoryUtils.getService(PlusFactory.class, param.get("v").toString()).save(param);
|
|
|
|
- return R.ok(v);
|
|
|
|
|
|
+ public R<List<Map<String, Object>>> aa(@RequestBody Map<String,Object> param) {
|
|
|
|
+ JMap<String, Object> param1 = new JHashMap<>(param);
|
|
|
|
+ List<Map<String, Object>> list = projectService.list(param1);
|
|
|
|
+ return R.ok(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @PostMapping("page")
|
|
|
|
+ public R<Page<Map<String, Object>>> page(@RequestBody Map<String,Object> param) {
|
|
|
|
+ JMap<String, Object> param1 = new JHashMap<>(param);
|
|
|
|
+ Page<Map<String, Object>> list = projectService.page(param1);
|
|
|
|
+ return R.ok(list);
|
|
}
|
|
}
|
|
}
|
|
}
|