浏览代码

访客申请调取后台接口(不走平台)

huangpeng 4 天之前
父节点
当前提交
556b2427c4

+ 16 - 0
qhse-common/src/main/java/com/rongwei/bscommon/sys/common/fegin/AdminFeginService.java

@@ -0,0 +1,16 @@
+package com.rongwei.bscommon.sys.common.fegin;
+
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import java.util.List;
+
+@FeignClient(value = "rw-admin",fallback = AdminFeginServiceImpl.class)
+public interface AdminFeginService {
+
+
+    @PostMapping(value = "/sys/generalCRUD/generalMsInsert")
+    void generalMsInsert(MasterSlaveInsertVo masterSlaveInsert);
+}

+ 18 - 0
qhse-common/src/main/java/com/rongwei/bscommon/sys/common/fegin/AdminFeginServiceImpl.java

@@ -0,0 +1,18 @@
+package com.rongwei.bscommon.sys.common.fegin;
+
+
+import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
+import org.springframework.stereotype.Component;
+
+
+import java.util.List;
+
+@Component
+public class AdminFeginServiceImpl implements AdminFeginService {
+
+
+    @Override
+    public void generalMsInsert(MasterSlaveInsertVo masterSlaveInsert) {
+
+    }
+}

+ 18 - 0
qhse-common/src/main/java/com/rongwei/bscommon/sys/dao/SysPagePartDao.java

@@ -0,0 +1,18 @@
+package com.rongwei.bscommon.sys.dao;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwei.bsentity.domain.SysPagePartDo;
+
+
+/**
+ * 页面模块配置项(SysPagePart)表数据库访问层
+ *
+ * @author makejava
+ * @since 2025-07-29 14:28:28
+ */
+
+public interface SysPagePartDao extends BaseMapper<SysPagePartDo> {
+
+}
+

+ 18 - 0
qhse-common/src/main/java/com/rongwei/bscommon/sys/service/SysPagePartService.java

@@ -0,0 +1,18 @@
+package com.rongwei.bscommon.sys.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.domain.SysPagePartDo;
+import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
+
+
+/**
+ * 页面模块配置项(SysPagePart)表服务接口
+ *
+ * @author makejava
+ * @since 2025-07-29 14:28:28
+ */
+public interface SysPagePartService extends IService<SysPagePartDo> {
+
+    void generalMsInsert(MasterSlaveInsertVo masterSlaveInsert);
+}
+

+ 29 - 0
qhse-common/src/main/java/com/rongwei/bscommon/sys/service/impl/SysPagePartServiceImpl.java

@@ -0,0 +1,29 @@
+package com.rongwei.bscommon.sys.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bscommon.sys.common.fegin.AdminFeginService;
+import com.rongwei.bscommon.sys.dao.SysPagePartDao;
+import com.rongwei.bscommon.sys.service.SysPagePartService;
+import com.rongwei.bsentity.domain.SysPagePartDo;
+import com.rongwei.rwcommon.vo.generalsql.MasterSlaveInsertVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 页面模块配置项(SysPagePart)表服务实现类
+ *
+ * @author makejava
+ * @since 2025-07-29 14:28:28
+ */
+@Service
+public class SysPagePartServiceImpl extends ServiceImpl<SysPagePartDao, SysPagePartDo> implements SysPagePartService {
+
+    @Autowired
+    private AdminFeginService adminFeginService;
+
+    @Override
+    public void generalMsInsert(MasterSlaveInsertVo masterSlaveInsert) {
+        adminFeginService.generalMsInsert(masterSlaveInsert);
+    }
+}
+

+ 7 - 0
qhse-common/src/main/resources/mybatis/SysPagePartDao.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.rongwei.bscommon.sys.dao.SysPagePartDao">
+    <select id="selectById" resultType="com.rongwei.bsentity.domain.SysPagePartDo">
+        SELECT * FROM sys_page_part WHERE id = #{id}
+    </select>
+</mapper>

+ 114 - 0
qhse-entity/src/main/java/com/rongwei/bsentity/domain/SysPagePartDo.java

@@ -0,0 +1,114 @@
+package com.rongwei.bsentity.domain;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.rongwei.rwcommon.base.BaseDo;
+import lombok.Data;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.io.Serializable;
+import java.util.Date;
+
+
+@Data
+@TableName(value = "sys_page_part")
+public class SysPagePartDo extends BaseDo implements Serializable{
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     **/
+    @TableId(value = "ID")
+    private String id;
+
+
+    /**
+     * 数据源
+     **/
+    private String datasource;
+
+    /**
+     * 数据源类型 sql table
+     **/
+    private String datasourcetype;
+
+    /**
+     * 名称
+     **/
+    private String mainname;
+
+    /**
+     * 别名
+     **/
+    private String ename;
+
+    /**
+     * 类型 table/form/treetable/tree
+     **/
+    private String insttype;
+
+    /**
+     * sql涉及的表
+     **/
+    private String sqltablesname;
+
+    /**
+     * sql语句
+     **/
+    private String mainsql;
+
+    /**
+     * 标签
+     **/
+    private String tags;
+
+    private String tenantid;
+
+    /**
+     * 扩展json格式配置
+     **/
+    private String roption;
+
+    /**
+     * 是否删除
+     **/
+    private String deleted;
+
+    /**
+     * 备注
+     **/
+    private String remark;
+
+    /**
+     * 创建时间
+     **/
+    private Date createdate;
+
+    /**
+     * 创建用户ID
+     **/
+    private String createuserid;
+
+    /**
+     * 修改日期
+     **/
+    private Date modifydate;
+
+    /**
+     * 修改用户ID
+     **/
+    private String modifyuserid;
+
+    /**
+     * 创建人名称
+     **/
+    private String createusername;
+
+    /**
+     * 修改人名称
+     **/
+    private String modifyusername;
+
+
+
+}
+
+

+ 55 - 0
qhse-server/src/main/java/com/rongwei/jxkh/controller/SysPagePartController.java

@@ -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());
+        }
+    }
+
+}