This commit is contained in:
parent
a7cbe359e0
commit
3974bdb7f3
|
|
@ -110,6 +110,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||
.antMatchers("/webjars/**").anonymous()
|
||||
.antMatchers("/*/api-docs").anonymous()
|
||||
.antMatchers("/druid/**").anonymous()
|
||||
.antMatchers("/test/**").anonymous()
|
||||
// 除上面外的所有请求全部需要鉴权认证
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.hchyun.generator.controller;
|
||||
|
||||
import com.hchyun.generator.dao.ApiclassDao;
|
||||
import com.hchyun.generator.dao.InterTableDao;
|
||||
import com.hchyun.generator.entity.Apiclass;
|
||||
import com.hchyun.generator.entity.InterTable;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/test")
|
||||
public class SysTest {
|
||||
@Autowired
|
||||
private InterTableDao interTableDao;
|
||||
|
||||
@GetMapping("/1")
|
||||
public Apiclass test(){
|
||||
return interTableDao.selectInterTableClass(3L);
|
||||
}
|
||||
@GetMapping("/2")
|
||||
public List<InterTable> test2(){
|
||||
return interTableDao.selectInterTableModule(3L);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.hchyun.generator.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hchyun.generator.entity.Apiclass;
|
||||
import com.hchyun.generator.entity.InterTable;
|
||||
|
||||
/**
|
||||
|
|
@ -82,4 +84,8 @@ public interface InterTableDao
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteInterTableByIds(Long[] ids);
|
||||
|
||||
Apiclass selectInterTableClass(Long id);
|
||||
|
||||
List<InterTable> selectInterTableModule(Long id);
|
||||
}
|
||||
|
|
@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModel;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 接口类名对象 sys_apiclass
|
||||
*
|
||||
|
|
@ -67,6 +69,16 @@ public class Apiclass extends BaseEntity {
|
|||
*/
|
||||
private Module module;
|
||||
|
||||
private List<InterTable> interTables;
|
||||
|
||||
public List<InterTable> getInterTables() {
|
||||
return interTables;
|
||||
}
|
||||
|
||||
public void setInterTables(List<InterTable> interTables) {
|
||||
this.interTables = interTables;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
return prefix;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package com.hchyun.generator.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.hchyun.common.annotation.Excel;
|
||||
import com.hchyun.common.core.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 接口信息对象 sys_inter_table
|
||||
*
|
||||
|
|
@ -13,8 +16,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
* @date 2021-01-25
|
||||
*/
|
||||
@ApiModel("接口信息")
|
||||
public class InterTable extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class InterTable {
|
||||
|
||||
/**
|
||||
* id
|
||||
|
|
@ -72,6 +74,51 @@ public class InterTable extends BaseEntity {
|
|||
* 类型
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
private String mName;
|
||||
private Apiclass apiclass;
|
||||
|
||||
public Apiclass getApiclass() {
|
||||
return apiclass;
|
||||
}
|
||||
|
||||
public void setApiclass(Apiclass apiclass) {
|
||||
this.apiclass = apiclass;
|
||||
}
|
||||
|
||||
public String getmName() {
|
||||
return mName;
|
||||
}
|
||||
|
||||
public void setmName(String mName) {
|
||||
this.mName = mName;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Long getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(Long createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
|
|
@ -162,10 +209,6 @@ public class InterTable extends BaseEntity {
|
|||
.append("itDescribe", getItDescribe())
|
||||
.append("requrl", getRequrl())
|
||||
.append("method", getMethod())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,8 @@ import com.hchyun.common.core.entity.BaseEntity;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模块管理对象 sys_module
|
||||
*
|
||||
|
|
@ -31,6 +33,16 @@ public class Module extends BaseEntity {
|
|||
@Excel(name = "模块描述")
|
||||
private String mDescribe;
|
||||
|
||||
private List<Apiclass> apiclassList;
|
||||
|
||||
public List<Apiclass> getApiclassList() {
|
||||
return apiclassList;
|
||||
}
|
||||
|
||||
public void setApiclassList(List<Apiclass> apiclassList) {
|
||||
this.apiclassList = apiclassList;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
package com.hchyun.generator.util;
|
||||
|
||||
public class InterTableUtils {
|
||||
}
|
||||
|
|
@ -14,9 +14,26 @@
|
|||
<result property="requrl" column="requrl" />
|
||||
<result property="method" column="method" />
|
||||
<result property="type" column="type" />
|
||||
<result property="mName" column="m_name" />
|
||||
<result property="isGenerate" column="is_generate" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<collection property="apiclass" javaType="com.hchyun.generator.entity.Apiclass" resultMap="ModuleApiclassResult" notNullColumn="c_id"/>
|
||||
</resultMap>
|
||||
<resultMap type="com.hchyun.generator.entity.Apiclass" id="ModuleApiclassResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="mId" column="m_id" />
|
||||
<result property="cName" column="c_name" />
|
||||
<result property="cDescribe" column="c_describe" />
|
||||
<result property="packageName" column="package_name" />
|
||||
<result property="author" column="author" />
|
||||
<result property="email" column="email" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="prefix" column="prefix" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
</resultMap>
|
||||
<resultMap type="com.hchyun.generator.entity.Module" id="ModuleResult">
|
||||
<result property="id" column="id" />
|
||||
|
|
@ -37,11 +54,27 @@
|
|||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<collection property="interTables" javaType="java.util.List" notNullColumn="id" resultMap="InterTableResult"/>
|
||||
<collection property="module" javaType="com.hchyun.generator.entity.Module" notNullColumn="m_id" resultMap="ModuleResult"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInterTableVo">
|
||||
select id, m_id, c_id, it_name, it_describe, is_permission, requrl, method, is_generate, type, create_time, create_by from sys_inter_table
|
||||
</sql>
|
||||
<select id="selectInterTableClass" resultMap="ApiclassResult" parameterType="Long">
|
||||
select sa.*, sit.*, sm.*
|
||||
from sys_apiclass sa
|
||||
left join sys_inter_table sit on sit.c_id = sa.id
|
||||
left join sys_module sm on sm.id = sa.m_id
|
||||
where sa.id = #{id} and sit.type = 2
|
||||
</select>
|
||||
|
||||
<select id="selectInterTableModule" resultMap="InterTableResult" parameterType="Long">
|
||||
SELECT (select m_name from sys_module sm WHERE sm.id=sit.m_id) AS m_name, sit.*, sa.*
|
||||
from sys_inter_table sit
|
||||
LEFT JOIN sys_apiclass sa ON sa.id = sit.c_id
|
||||
WHERE sit.m_id=#{id} AND sit.type = 1;
|
||||
</select>
|
||||
|
||||
<select id="selectInterTableList" parameterType="InterTable" resultMap="InterTableResult">
|
||||
<include refid="selectInterTableVo"/>
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@ package com.hchyun.test.controller;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
import com.hchyun.common.constant.ReturnConstants;
|
||||
import com.hchyun.common.core.controller.HcyBaseController;
|
||||
|
|
|
|||
Loading…
Reference in New Issue