|
@@ -0,0 +1,55 @@
|
|
|
+package com.rongwei.jxkh.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.rongwei.bscommon.sys.dao.SysPagePartDao;
|
|
|
+import com.rongwei.bscommon.sys.service.SysPagePartService;
|
|
|
+import com.rongwei.bsentity.domain.SysPagePartDo;
|
|
|
+import com.rongwei.rwcommon.base.R;
|
|
|
+import com.rongwei.rwcommon.utils.StringUtils;
|
|
|
+import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("page-part")
|
|
|
+@Slf4j
|
|
|
+public class SysPagePartController {
|
|
|
+
|
|
|
+ private final Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ SysPagePartService sysPagePartService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/getPageInfo/{id}")
|
|
|
+ public R getUserById(@PathVariable String id) {
|
|
|
+ logger.info("/getPageInfo 入参 id: {}",id);
|
|
|
+ SysPagePartDo sysPagePartDo = sysPagePartService.getById(id);
|
|
|
+ return R.ok(sysPagePartDo);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通用主从表insert执行
|
|
|
+ * @param masterSlaveInsert
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @PostMapping("/generalMsInsert")
|
|
|
+ public R generalMsInsert(@RequestBody MasterSlaveInsertVo masterSlaveInsert) {
|
|
|
+ try {
|
|
|
+ sysPagePartService.generalMsInsert(masterSlaveInsert);
|
|
|
+ return R.ok();
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(StringUtils.spliceErrorMsg(e), e.fillInStackTrace());
|
|
|
+
|
|
|
+ return R.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|