fead&fix: 1.0.0
1. 新增组最大分区,用于在创建组限制其所能选的最大的分区 2. 修复了迁移代码包影响全局返回的扫描路径
This commit is contained in:
parent
a731ad70e2
commit
aab93f7b44
@ -152,7 +152,7 @@ CREATE TABLE `system_user`
|
||||
UNIQUE KEY `uk_username` (`username`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统用户表';
|
||||
|
||||
INSERT INTO x_retry.system_user (username, password, role)
|
||||
INSERT INTO system_user (username, password, role)
|
||||
VALUES ('admin', 'cdf4a007e2b02a0c49fc9b7ccfbb8a10c644f635e1765dcf2a7ab794ddc7edac', 2);
|
||||
|
||||
CREATE TABLE `system_user_permission`
|
@ -14,7 +14,7 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
@Slf4j
|
||||
@ControllerAdvice(basePackages = {"com.x.retry.client.core", "com.x.retry.server"})
|
||||
@ControllerAdvice(basePackages = {"com.aizuda.easy.retry.client.core", "com.aizuda.easy.retry.server"})
|
||||
public class GlobalRestfulResponseBodyAdvice implements ResponseBodyAdvice<Object> {
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.aizuda.easy.retry.server.web.controller;
|
||||
|
||||
import com.aizuda.easy.retry.server.config.SystemProperties;
|
||||
import com.aizuda.easy.retry.server.service.GroupConfigService;
|
||||
import com.aizuda.easy.retry.server.web.model.base.PageResult;
|
||||
import com.aizuda.easy.retry.server.web.model.request.GroupConfigQueryVO;
|
||||
@ -23,6 +24,8 @@ public class GroupConfigController {
|
||||
|
||||
@Autowired
|
||||
private GroupConfigService groupConfigService;
|
||||
@Autowired
|
||||
private SystemProperties systemProperties;
|
||||
|
||||
@LoginRequired(role = RoleEnum.ADMIN)
|
||||
@PostMapping("")
|
||||
@ -54,4 +57,12 @@ public class GroupConfigController {
|
||||
return groupConfigService.getAllGroupNameList();
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
@GetMapping("/partition")
|
||||
public Integer getTotalPartition() {
|
||||
// 组分区从0开始,所以是最大值减一
|
||||
return systemProperties.getTotalPartition() - 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ import java.util.Objects;
|
||||
@Configuration
|
||||
public class AuthenticationInterceptor implements HandlerInterceptor {
|
||||
|
||||
public static final String AUTHENTICATION = "easy-retry-AUTH";
|
||||
public static final String AUTHENTICATION = "EASY-RETRY-AUTH";
|
||||
|
||||
@Autowired
|
||||
private SystemUserMapper systemUserMapper;
|
||||
|
@ -30,12 +30,19 @@ const api = {
|
||||
countDispatch: '/dashboard/dispatch/count',
|
||||
countActivePod: '/dashboard/active-pod/count',
|
||||
rankSceneQuantity: '/dashboard/scene/rank',
|
||||
lineDispatchQuantity: '/dashboard/dispatch/line'
|
||||
|
||||
lineDispatchQuantity: '/dashboard/dispatch/line',
|
||||
totalPartition: '/group/partition'
|
||||
}
|
||||
|
||||
export default api
|
||||
|
||||
export function getTotalPartition () {
|
||||
return request({
|
||||
url: api.totalPartition,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getLineDispatchQuantity (parameter) {
|
||||
return request({
|
||||
url: api.lineDispatchQuantity,
|
||||
|
@ -47,7 +47,7 @@ request.interceptors.request.use(config => {
|
||||
// 如果 token 存在
|
||||
// 让每个请求携带自定义 token 请根据实际情况自行修改
|
||||
if (token) {
|
||||
config.headers['easy-retry-AUTH'] = token
|
||||
config.headers['EASY-RETRY-AUTH'] = token
|
||||
}
|
||||
return config
|
||||
}, errorHandler)
|
||||
|
@ -64,7 +64,7 @@
|
||||
'groupPartition'
|
||||
]"
|
||||
:min="0"
|
||||
:max="10"
|
||||
:max="maxGroupPartition"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@ -76,7 +76,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getGroupConfigByGroupName } from '@/api/manage'
|
||||
import { getGroupConfigByGroupName, getTotalPartition } from '@/api/manage'
|
||||
import pick from 'lodash.pick'
|
||||
|
||||
export default {
|
||||
@ -90,6 +90,7 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
form: this.$form.createForm(this),
|
||||
maxGroupPartition: 32,
|
||||
routeKey: {
|
||||
'1': '一致性hash算法',
|
||||
'2': '随机算法',
|
||||
@ -99,6 +100,10 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
this.$nextTick(() => {
|
||||
getTotalPartition().then(res => {
|
||||
this.maxGroupPartition = res.data
|
||||
})
|
||||
|
||||
const groupName = this.$route.query.groupName
|
||||
if (groupName) {
|
||||
getGroupConfigByGroupName(groupName).then(res => {
|
||||
|
Loading…
Reference in New Issue
Block a user