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