This commit is contained in:
parent
db6893113d
commit
cc22b83e5f
|
|
@ -9,6 +9,14 @@ export function listApiclass(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取模块管理选项列表
|
||||||
|
export function queryListApiclass() {
|
||||||
|
return request({
|
||||||
|
url: '/system/module/querylist',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询接口类名详细
|
// 查询接口类名详细
|
||||||
export function getApiclass(id) {
|
export function getApiclass(id) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 查询模块管理列表
|
// 查询模块管理列表
|
||||||
export function listModule(query) {
|
export function listModule(query) {
|
||||||
return request({
|
return request({
|
||||||
|
|
@ -9,6 +11,14 @@ export function listModule(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取模块管理选项列表
|
||||||
|
export function queryListModule() {
|
||||||
|
return request({
|
||||||
|
url: '/system/module/querylist',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询模块管理详细
|
// 查询模块管理详细
|
||||||
export function getModule(id) {
|
export function getModule(id) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="apiclassList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="apiclassList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="类id" align="center" prop="id" />
|
<!-- <el-table-column label="类id" align="center" prop="id" />-->
|
||||||
<el-table-column label="模块id" align="center" prop="mId" />
|
<el-table-column label="模块id" align="center" prop="mId" />
|
||||||
<el-table-column label="类名" align="center" prop="cName" />
|
<el-table-column label="类名" align="center" prop="cName" />
|
||||||
<el-table-column label="类描述" align="center" prop="cDescribe" />
|
<el-table-column label="类描述" align="center" prop="cDescribe" />
|
||||||
|
|
@ -159,7 +159,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listApiclass, getApiclass, delApiclass, addApiclass, updateApiclass, exportApiclass } from "@/api/system/apiclass";
|
import { listApiclass, getApiclass, delApiclass, addApiclass, updateApiclass, exportApiclass } from "@/api/system/apiclass";
|
||||||
|
import {queryListModule} from "@/api/system/module"
|
||||||
export default {
|
export default {
|
||||||
name: "Apiclass",
|
name: "Apiclass",
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -212,6 +212,9 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
|
queryListModule().then(respone =>{
|
||||||
|
console.log(respone)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询接口类名列表 */
|
/** 查询接口类名列表 */
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,10 @@ package com.hchyun.web.controller.system;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
|
|
||||||
import com.hchyun.common.constant.ReturnConstants;
|
import com.hchyun.common.constant.ReturnConstants;
|
||||||
import com.hchyun.common.core.controller.HcyBaseController;
|
import com.hchyun.common.core.controller.HcyBaseController;
|
||||||
import com.hchyun.common.utils.ServerResult;
|
import com.hchyun.common.utils.ServerResult;
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
@ -36,7 +31,6 @@ import com.hchyun.common.utils.poi.ExcelUtil;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
* @date 2021-01-24
|
* @date 2021-01-24
|
||||||
*/
|
*/
|
||||||
@Api(value = "接口类名管理",tags = "接口类名管理")
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/apiclass")
|
@RequestMapping("/system/apiclass")
|
||||||
public class ApiclassController extends HcyBaseController {
|
public class ApiclassController extends HcyBaseController {
|
||||||
|
|
@ -45,10 +39,30 @@ public class ApiclassController extends HcyBaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ApiclassService apiclassService;
|
private ApiclassService apiclassService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取到api类的select选项
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasAnyPermi('system:apiclass:querylist')")
|
||||||
|
@GetMapping("querylist")
|
||||||
|
public AjaxResult queryList(){
|
||||||
|
try {
|
||||||
|
ServerResult<List<Apiclass>> serverResult = apiclassService.selectApiclassList(new Apiclass());
|
||||||
|
if (serverResult.isStart()){
|
||||||
|
return AjaxResult.success(serverResult.getData());
|
||||||
|
}else {
|
||||||
|
return AjaxResult.error(serverResult.getMsg());
|
||||||
|
}
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询接口类名列表
|
* 查询接口类名列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询接口类名列表")
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:apiclass:list')")
|
@PreAuthorize("@ss.hasPermi('system:apiclass:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Serializable list(Apiclass apiclass) {
|
public Serializable list(Apiclass apiclass) {
|
||||||
|
|
@ -69,7 +83,6 @@ public class ApiclassController extends HcyBaseController {
|
||||||
/**
|
/**
|
||||||
* 导出接口类名列表
|
* 导出接口类名列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("导出接口类名列表")
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:apiclass:export')")
|
@PreAuthorize("@ss.hasPermi('system:apiclass:export')")
|
||||||
@Log(title = "接口类名", businessType = BusinessType.EXPORT)
|
@Log(title = "接口类名", businessType = BusinessType.EXPORT)
|
||||||
@GetMapping("/export")
|
@GetMapping("/export")
|
||||||
|
|
@ -91,8 +104,6 @@ public class ApiclassController extends HcyBaseController {
|
||||||
/**
|
/**
|
||||||
* 获取接口类名详细信息
|
* 获取接口类名详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取接口类名详细信息")
|
|
||||||
@ApiImplicitParam(name = "id" , value = "接口类名id" , required = true, dataType = "Long" , paramType = "path")
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:apiclass:query')")
|
@PreAuthorize("@ss.hasPermi('system:apiclass:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
|
|
@ -112,8 +123,6 @@ public class ApiclassController extends HcyBaseController {
|
||||||
/**
|
/**
|
||||||
* 新增接口类名
|
* 新增接口类名
|
||||||
*/
|
*/
|
||||||
@ApiOperation("新增接口类名")
|
|
||||||
@ApiImplicitParam(name = "apiclass" , value = "新增接口类名信息" , dataType = "Apiclass")
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:apiclass:add')")
|
@PreAuthorize("@ss.hasPermi('system:apiclass:add')")
|
||||||
@Log(title = "接口类名", businessType = BusinessType.INSERT)
|
@Log(title = "接口类名", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
|
@ -143,8 +152,6 @@ public class ApiclassController extends HcyBaseController {
|
||||||
/**
|
/**
|
||||||
* 修改接口类名
|
* 修改接口类名
|
||||||
*/
|
*/
|
||||||
@ApiOperation("修改接口类名")
|
|
||||||
@ApiImplicitParam(name = "apiclass" , value = "修改接口类名信息" , dataType = "Apiclass")
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:apiclass:edit')")
|
@PreAuthorize("@ss.hasPermi('system:apiclass:edit')")
|
||||||
@Log(title = "接口类名", businessType = BusinessType.UPDATE)
|
@Log(title = "接口类名", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
|
|
@ -175,8 +182,6 @@ public class ApiclassController extends HcyBaseController {
|
||||||
/**
|
/**
|
||||||
* 删除接口类名
|
* 删除接口类名
|
||||||
*/
|
*/
|
||||||
@ApiOperation("删除接口类名")
|
|
||||||
@ApiImplicitParam(name = "ids" , value = "接口类名ids" , required = true, dataType = "Long" , paramType = "path")
|
|
||||||
@PreAuthorize("@ss.hasPermi('system:apiclass:remove')")
|
@PreAuthorize("@ss.hasPermi('system:apiclass:remove')")
|
||||||
@Log(title = "接口类名", businessType = BusinessType.DELETE)
|
@Log(title = "接口类名", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import java.util.List;
|
||||||
import com.hchyun.common.constant.ReturnConstants;
|
import com.hchyun.common.constant.ReturnConstants;
|
||||||
import com.hchyun.common.core.controller.HcyBaseController;
|
import com.hchyun.common.core.controller.HcyBaseController;
|
||||||
import com.hchyun.common.utils.ServerResult;
|
import com.hchyun.common.utils.ServerResult;
|
||||||
|
import com.hchyun.system.entity.Apiclass;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
@ -41,6 +42,29 @@ public class ModuleController extends HcyBaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ModuleService moduleService;
|
private ModuleService moduleService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取到api类的select选项
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasAnyPermi('system:module:querylist')")
|
||||||
|
@GetMapping("querylist")
|
||||||
|
public AjaxResult queryList(){
|
||||||
|
try {
|
||||||
|
ServerResult<List<Module>> serverResult = moduleService.selectModuleList(new Module());
|
||||||
|
if (serverResult.isStart()){
|
||||||
|
return AjaxResult.success(serverResult.getData());
|
||||||
|
}else {
|
||||||
|
return AjaxResult.error(serverResult.getMsg());
|
||||||
|
}
|
||||||
|
}catch (RuntimeException e){
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ReturnConstants.SYS_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询模块管理列表
|
* 查询模块管理列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.hchyun.common.core.entity;
|
package com.hchyun.common.core.entity;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import com.hchyun.common.constant.HttpStatus;
|
import com.hchyun.common.constant.HttpStatus;
|
||||||
import com.hchyun.common.utils.StringUtils;
|
import com.hchyun.common.utils.StringUtils;
|
||||||
|
|
||||||
|
|
@ -9,24 +10,28 @@ import com.hchyun.common.utils.StringUtils;
|
||||||
*
|
*
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
*/
|
*/
|
||||||
public class AjaxResult extends HashMap<String, Object>
|
public class AjaxResult extends HashMap<String, Object> {
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 状态码 */
|
/**
|
||||||
|
* 状态码
|
||||||
|
*/
|
||||||
public static final String CODE_TAG = "code";
|
public static final String CODE_TAG = "code";
|
||||||
|
|
||||||
/** 返回内容 */
|
/**
|
||||||
|
* 返回内容
|
||||||
|
*/
|
||||||
public static final String MSG_TAG = "msg";
|
public static final String MSG_TAG = "msg";
|
||||||
|
|
||||||
/** 数据对象 */
|
/**
|
||||||
|
* 数据对象
|
||||||
|
*/
|
||||||
public static final String DATA_TAG = "data";
|
public static final String DATA_TAG = "data";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
||||||
*/
|
*/
|
||||||
public AjaxResult()
|
public AjaxResult() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -35,8 +40,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
* @param code 状态码
|
* @param code 状态码
|
||||||
* @param msg 返回内容
|
* @param msg 返回内容
|
||||||
*/
|
*/
|
||||||
public AjaxResult(int code, String msg)
|
public AjaxResult(int code, String msg) {
|
||||||
{
|
|
||||||
super.put(CODE_TAG, code);
|
super.put(CODE_TAG, code);
|
||||||
super.put(MSG_TAG, msg);
|
super.put(MSG_TAG, msg);
|
||||||
}
|
}
|
||||||
|
|
@ -48,12 +52,10 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
* @param msg 返回内容
|
* @param msg 返回内容
|
||||||
* @param data 数据对象
|
* @param data 数据对象
|
||||||
*/
|
*/
|
||||||
public AjaxResult(int code, String msg, Object data)
|
public AjaxResult(int code, String msg, Object data) {
|
||||||
{
|
|
||||||
super.put(CODE_TAG, code);
|
super.put(CODE_TAG, code);
|
||||||
super.put(MSG_TAG, msg);
|
super.put(MSG_TAG, msg);
|
||||||
if (StringUtils.isNotNull(data))
|
if (StringUtils.isNotNull(data)) {
|
||||||
{
|
|
||||||
super.put(DATA_TAG, data);
|
super.put(DATA_TAG, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -63,8 +65,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
*
|
*
|
||||||
* @return 成功消息
|
* @return 成功消息
|
||||||
*/
|
*/
|
||||||
public static AjaxResult success()
|
public static AjaxResult success() {
|
||||||
{
|
|
||||||
return AjaxResult.success("操作成功");
|
return AjaxResult.success("操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,8 +74,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
*
|
*
|
||||||
* @return 成功消息
|
* @return 成功消息
|
||||||
*/
|
*/
|
||||||
public static AjaxResult success(Object data)
|
public static AjaxResult success(Object data) {
|
||||||
{
|
|
||||||
return AjaxResult.success("操作成功", data);
|
return AjaxResult.success("操作成功", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -84,8 +84,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
* @param msg 返回内容
|
* @param msg 返回内容
|
||||||
* @return 成功消息
|
* @return 成功消息
|
||||||
*/
|
*/
|
||||||
public static AjaxResult success(String msg)
|
public static AjaxResult success(String msg) {
|
||||||
{
|
|
||||||
return AjaxResult.success(msg, null);
|
return AjaxResult.success(msg, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,8 +95,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
* @param data 数据对象
|
* @param data 数据对象
|
||||||
* @return 成功消息
|
* @return 成功消息
|
||||||
*/
|
*/
|
||||||
public static AjaxResult success(String msg, Object data)
|
public static AjaxResult success(String msg, Object data) {
|
||||||
{
|
|
||||||
return new AjaxResult(HttpStatus.SUCCESS, msg, data);
|
return new AjaxResult(HttpStatus.SUCCESS, msg, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,8 +104,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static AjaxResult error()
|
public static AjaxResult error() {
|
||||||
{
|
|
||||||
return AjaxResult.error("操作失败");
|
return AjaxResult.error("操作失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,8 +114,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
* @param msg 返回内容
|
* @param msg 返回内容
|
||||||
* @return 警告消息
|
* @return 警告消息
|
||||||
*/
|
*/
|
||||||
public static AjaxResult error(String msg)
|
public static AjaxResult error(String msg) {
|
||||||
{
|
|
||||||
return AjaxResult.error(msg, null);
|
return AjaxResult.error(msg, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -129,8 +125,7 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
* @param data 数据对象
|
* @param data 数据对象
|
||||||
* @return 警告消息
|
* @return 警告消息
|
||||||
*/
|
*/
|
||||||
public static AjaxResult error(String msg, Object data)
|
public static AjaxResult error(String msg, Object data) {
|
||||||
{
|
|
||||||
return new AjaxResult(HttpStatus.ERROR, msg, data);
|
return new AjaxResult(HttpStatus.ERROR, msg, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -141,18 +136,17 @@ public class AjaxResult extends HashMap<String, Object>
|
||||||
* @param msg 返回内容
|
* @param msg 返回内容
|
||||||
* @return 警告消息
|
* @return 警告消息
|
||||||
*/
|
*/
|
||||||
public static AjaxResult error(int code, String msg)
|
public static AjaxResult error(int code, String msg) {
|
||||||
{
|
|
||||||
return new AjaxResult(code, msg, null);
|
return new AjaxResult(code, msg, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回提示信息
|
* 返回提示信息
|
||||||
*
|
*
|
||||||
* @param msg 返回内容
|
* @param msg 返回内容
|
||||||
* @return 提示消息
|
* @return 提示消息
|
||||||
*/
|
*/
|
||||||
public static AjaxResult info(String msg)
|
public static AjaxResult info(String msg) {
|
||||||
{
|
|
||||||
return new AjaxResult(HttpStatus.NO_DATA, msg, null);
|
return new AjaxResult(HttpStatus.NO_DATA, msg, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.hchyun.system.dao;
|
package com.hchyun.system.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hchyun.system.entity.Apiclass;
|
import com.hchyun.system.entity.Apiclass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -9,8 +10,8 @@ import com.hchyun.system.entity.Apiclass;
|
||||||
* @author hchyun
|
* @author hchyun
|
||||||
* @date 2021-01-24
|
* @date 2021-01-24
|
||||||
*/
|
*/
|
||||||
public interface ApiclassDao
|
public interface ApiclassDao {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询接口类名
|
* 查询接口类名
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue