parent
2231fdece1
commit
48b0ed87a1
@ -1,24 +0,0 @@ |
|||||||
var Common = (function () { |
|
||||||
|
|
||||||
function initProfiles() { |
|
||||||
var $profileList = $('#profileList'); |
|
||||||
if ($profileList.length > 0) { |
|
||||||
ApiUtil.post('system.profile.list', {}, function (resp) { |
|
||||||
var list = resp.data; |
|
||||||
var html = []; |
|
||||||
for (var i = 0; i < list.length; i++) { |
|
||||||
html.push('<li' + (i == 0 ? ' class="layui-this"' : '') + '>' + list[i] + '</li>'); |
|
||||||
} |
|
||||||
$profileList.html(html.join('')) |
|
||||||
|
|
||||||
$profileList.find('li').on('click', function () { |
|
||||||
window.profile = $(this).text(); |
|
||||||
}); |
|
||||||
}); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
initProfiles(); |
|
||||||
|
|
||||||
return {} |
|
||||||
})(); |
|
@ -0,0 +1,30 @@ |
|||||||
|
;(function () { |
||||||
|
var currentProfile = ApiUtil.getParam('profile') || 'default'; |
||||||
|
|
||||||
|
ApiUtil.post('system.profile.list', {}, function (resp) { |
||||||
|
var profileList = resp.data; |
||||||
|
var html = ['<div class="layui-tab layui-tab-brief" style="margin-top: 0px;">']; |
||||||
|
html.push('<ul id="profileList" class="layui-tab-title">') |
||||||
|
for (var i = 0; i < profileList.length; i++) { |
||||||
|
var profile = profileList[i]; |
||||||
|
var cls = currentProfile == profile ? 'layui-this' : ''; |
||||||
|
html.push('<li><a class="' + cls + '" href="' + getCurrentPage(profile) + '">' + profile + '</a></li>'); |
||||||
|
} |
||||||
|
html.push('</ul>') |
||||||
|
html.push('</div>') |
||||||
|
$('.x-body').prepend(html.join('')); |
||||||
|
}); |
||||||
|
|
||||||
|
function getCurrentPage(profile) { |
||||||
|
var currentUrl = location.href.toString(); |
||||||
|
var indexStart = currentUrl.lastIndexOf('/') + 1; |
||||||
|
var indexEnd = currentUrl.lastIndexOf('?'); |
||||||
|
var page = indexEnd > -1 |
||||||
|
? currentUrl.substring(indexStart, indexEnd) |
||||||
|
: currentUrl.substring(indexStart); |
||||||
|
|
||||||
|
return page + '?q=' + new Date().getTime() + '&profile=' + profile; |
||||||
|
} |
||||||
|
|
||||||
|
window.profile = currentProfile; |
||||||
|
})(); |
@ -0,0 +1,57 @@ |
|||||||
|
package com.gitee.sop.adminserver.api.service.param; |
||||||
|
|
||||||
|
import com.gitee.easyopen.doc.annotation.ApiDocField; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank; |
||||||
|
import javax.validation.constraints.NotNull; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author tanghc |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class UpdateRouteParam { |
||||||
|
|
||||||
|
@NotBlank(message = "profile不能为空") |
||||||
|
@ApiDocField(description = "profile") |
||||||
|
private String profile; |
||||||
|
|
||||||
|
@NotBlank(message = "serviceId不能为空") |
||||||
|
@ApiDocField(description = "serviceId") |
||||||
|
private String serviceId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 路由的Id |
||||||
|
*/ |
||||||
|
@NotBlank(message = "id不能为空") |
||||||
|
@ApiDocField(description = "路由id") |
||||||
|
private String id = ""; |
||||||
|
|
||||||
|
/** |
||||||
|
* 路由规则转发的目标uri |
||||||
|
*/ |
||||||
|
@NotBlank(message = "uri不能为空") |
||||||
|
@ApiDocField(description = "路由uri") |
||||||
|
private String uri; |
||||||
|
|
||||||
|
/** |
||||||
|
* uri后面跟的path |
||||||
|
*/ |
||||||
|
@ApiDocField(description = "路由path") |
||||||
|
private String path; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 是否忽略验证,业务参数验证除外 |
||||||
|
*/ |
||||||
|
@NotNull |
||||||
|
@ApiDocField(description = "是否忽略验证") |
||||||
|
private Boolean ignoreValidate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否禁用 |
||||||
|
*/ |
||||||
|
@NotNull |
||||||
|
@ApiDocField(description = "是否禁用") |
||||||
|
private Boolean disabled; |
||||||
|
} |
Loading…
Reference in new issue