增加城市/ISP查询接口

This commit is contained in:
刘祥超
2022-01-06 16:25:23 +08:00
parent e7b0f0df90
commit d35db163ae
12 changed files with 251 additions and 31 deletions

View File

@@ -377,13 +377,30 @@ func (this *ServerGroupService) UpdateServerGroupUDPReverseProxy(ctx context.Con
// FindEnabledServerGroupConfigInfo 取得分组的配置概要信息
func (this *ServerGroupService) FindEnabledServerGroupConfigInfo(ctx context.Context, req *pb.FindEnabledServerGroupConfigInfoRequest) (*pb.FindEnabledServerGroupConfigInfoResponse, error) {
// 校验请求
_, err := this.ValidateAdmin(ctx, 0)
_, userId, err := this.ValidateAdminAndUser(ctx, 0, 0)
if err != nil {
return nil, err
}
tx := this.NullTx()
// 检查用户权限
if userId > 0 {
if req.ServerId > 0 {
err = models.SharedServerDAO.CheckUserServer(tx, userId, req.ServerId)
if err != nil {
return nil, err
}
}
if req.ServerGroupId > 0 {
err = models.SharedServerGroupDAO.CheckUserGroup(tx, userId, req.ServerGroupId)
if err != nil {
return nil, err
}
}
}
var group *models.ServerGroup
if req.ServerGroupId > 0 {
group, err = models.SharedServerGroupDAO.FindEnabledServerGroup(tx, req.ServerGroupId)