This commit is contained in:
20932067@zju.edu.cn 2021-01-24 23:57:26 +08:00
parent db6893113d
commit cc22b83e5f
7 changed files with 122 additions and 77 deletions

View File

@ -9,6 +9,14 @@ export function listApiclass(query) {
})
}
// 获取模块管理选项列表
export function queryListApiclass() {
return request({
url: '/system/module/querylist',
method: 'get',
})
}
// 查询接口类名详细
export function getApiclass(id) {
return request({
@ -50,4 +58,4 @@ export function exportApiclass(query) {
method: 'get',
params: query
})
}
}

View File

@ -1,5 +1,7 @@
import request from '@/utils/request'
// 查询模块管理列表
export function listModule(query) {
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) {
return request({
@ -50,4 +60,4 @@ export function exportModule(query) {
method: 'get',
params: query
})
}
}

View File

@ -94,7 +94,7 @@
<el-table v-loading="loading" :data="apiclassList" @selection-change="handleSelectionChange">
<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="类名" align="center" prop="cName" />
<el-table-column label="类描述" align="center" prop="cDescribe" />
@ -127,7 +127,7 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -159,7 +159,7 @@
<script>
import { listApiclass, getApiclass, delApiclass, addApiclass, updateApiclass, exportApiclass } from "@/api/system/apiclass";
import {queryListModule} from "@/api/system/module"
export default {
name: "Apiclass",
components: {
@ -212,6 +212,9 @@ export default {
},
created() {
this.getList();
queryListModule().then(respone =>{
console.log(respone)
})
},
methods: {
/** 查询接口类名列表 */

View File

@ -2,15 +2,10 @@ package com.hchyun.web.controller.system;
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;
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.LoggerFactory;
import org.springframework.security.access.prepost.PreAuthorize;
@ -36,7 +31,6 @@ import com.hchyun.common.utils.poi.ExcelUtil;
* @author hchyun
* @date 2021-01-24
*/
@Api(value = "接口类名管理",tags = "接口类名管理")
@RestController
@RequestMapping("/system/apiclass")
public class ApiclassController extends HcyBaseController {
@ -45,10 +39,30 @@ public class ApiclassController extends HcyBaseController {
@Autowired
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')")
@GetMapping("/list")
public Serializable list(Apiclass apiclass) {
@ -69,7 +83,6 @@ public class ApiclassController extends HcyBaseController {
/**
* 导出接口类名列表
*/
@ApiOperation("导出接口类名列表")
@PreAuthorize("@ss.hasPermi('system:apiclass:export')")
@Log(title = "接口类名", businessType = BusinessType.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')")
@GetMapping(value = "/{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')")
@Log(title = "接口类名", businessType = BusinessType.INSERT)
@PostMapping
@ -143,8 +152,6 @@ public class ApiclassController extends HcyBaseController {
/**
* 修改接口类名
*/
@ApiOperation("修改接口类名")
@ApiImplicitParam(name = "apiclass" , value = "修改接口类名信息" , dataType = "Apiclass")
@PreAuthorize("@ss.hasPermi('system:apiclass:edit')")
@Log(title = "接口类名", businessType = BusinessType.UPDATE)
@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')")
@Log(title = "接口类名", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")

View File

@ -7,6 +7,7 @@ import java.util.List;
import com.hchyun.common.constant.ReturnConstants;
import com.hchyun.common.core.controller.HcyBaseController;
import com.hchyun.common.utils.ServerResult;
import com.hchyun.system.entity.Apiclass;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.prepost.PreAuthorize;
@ -41,6 +42,29 @@ public class ModuleController extends HcyBaseController {
@Autowired
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);
}
}
/**
* 查询模块管理列表
*/

View File

@ -1,158 +1,152 @@
package com.hchyun.common.core.entity;
import java.util.HashMap;
import com.hchyun.common.constant.HttpStatus;
import com.hchyun.common.utils.StringUtils;
/**
* 操作消息提醒
*
*
* @author hchyun
*/
public class AjaxResult extends HashMap<String, Object>
{
public class AjaxResult extends HashMap<String, Object> {
private static final long serialVersionUID = 1L;
/** 状态码 */
/**
* 状态码
*/
public static final String CODE_TAG = "code";
/** 返回内容 */
/**
* 返回内容
*/
public static final String MSG_TAG = "msg";
/** 数据对象 */
/**
* 数据对象
*/
public static final String DATA_TAG = "data";
/**
* 初始化一个新创建的 AjaxResult 对象使其表示一个空消息
*/
public AjaxResult()
{
public AjaxResult() {
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
*
* @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(MSG_TAG, msg);
}
/**
* 初始化一个新创建的 AjaxResult 对象
*
*
* @param code 状态码
* @param msg 返回内容
* @param msg 返回内容
* @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(MSG_TAG, msg);
if (StringUtils.isNotNull(data))
{
if (StringUtils.isNotNull(data)) {
super.put(DATA_TAG, data);
}
}
/**
* 返回成功消息
*
*
* @return 成功消息
*/
public static AjaxResult success()
{
public static AjaxResult success() {
return AjaxResult.success("操作成功");
}
/**
* 返回成功数据
*
*
* @return 成功消息
*/
public static AjaxResult success(Object data)
{
public static AjaxResult success(Object data) {
return AjaxResult.success("操作成功", data);
}
/**
* 返回成功消息
*
*
* @param msg 返回内容
* @return 成功消息
*/
public static AjaxResult success(String msg)
{
public static AjaxResult success(String msg) {
return AjaxResult.success(msg, null);
}
/**
* 返回成功消息
*
* @param msg 返回内容
*
* @param msg 返回内容
* @param data 数据对象
* @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
*/
public static AjaxResult error()
{
public static AjaxResult error() {
return AjaxResult.error("操作失败");
}
/**
* 返回错误消息
*
*
* @param msg 返回内容
* @return 警告消息
*/
public static AjaxResult error(String msg)
{
public static AjaxResult error(String msg) {
return AjaxResult.error(msg, null);
}
/**
* 返回错误消息
*
* @param msg 返回内容
*
* @param msg 返回内容
* @param data 数据对象
* @return 警告消息
*/
public static AjaxResult error(String msg, Object data)
{
public static AjaxResult error(String msg, Object data) {
return new AjaxResult(HttpStatus.ERROR, msg, data);
}
/**
* 返回错误消息
*
*
* @param code 状态码
* @param msg 返回内容
* @param msg 返回内容
* @return 警告消息
*/
public static AjaxResult error(int code, String msg)
{
public static AjaxResult error(int code, String msg) {
return new AjaxResult(code, msg, null);
}
/**
* 返回提示信息
*
* @param msg 返回内容
* @return 提示消息
*/
public static AjaxResult info(String msg)
{
public static AjaxResult info(String msg) {
return new AjaxResult(HttpStatus.NO_DATA, msg, null);
}
}

View File

@ -1,19 +1,20 @@
package com.hchyun.system.dao;
import java.util.List;
import com.hchyun.system.entity.Apiclass;
/**
* 接口类名Mapper接口
*
*
* @author hchyun
* @date 2021-01-24
*/
public interface ApiclassDao
{
public interface ApiclassDao {
/**
* 查询接口类名
*
*
* @param id 接口类名ID
* @return 接口类名
*/
@ -21,7 +22,7 @@ public interface ApiclassDao
/**
* 查询接口类名列表
*
*
* @param apiclass 接口类名
* @return 接口类名集合
*/
@ -29,7 +30,7 @@ public interface ApiclassDao
/**
* 新增接口类名
*
*
* @param apiclass 接口类名
* @return 结果
*/
@ -37,7 +38,7 @@ public interface ApiclassDao
/**
* 修改接口类名
*
*
* @param apiclass 接口类名
* @return 结果
*/
@ -45,7 +46,7 @@ public interface ApiclassDao
/**
* 删除接口类名
*
*
* @param id 接口类名ID
* @return 结果
*/
@ -53,7 +54,7 @@ public interface ApiclassDao
/**
* 批量删除接口类名
*
*
* @param ids 需要删除的数据ID
* @return 结果
*/