feat(system): 新增 Web AI 客户端权限控制字段
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantagencypackage.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -50,4 +51,7 @@ public class TenantAgencyPackagePageReqVO extends PageParam {
|
||||
@Schema(description = "套餐类型", example = "2")
|
||||
private Integer packageType;
|
||||
|
||||
@Schema(description = "WebAi权限 0关闭 1开启")
|
||||
private Integer webAi;
|
||||
|
||||
}
|
||||
@@ -63,4 +63,8 @@ public class TenantAgencyPackageRespVO {
|
||||
@Schema(description = "Ai自动回复权限 0关闭 1 开启")
|
||||
@ExcelProperty("Ai 自动回复权限 0关闭 1开启")
|
||||
private Integer aiReplay;
|
||||
|
||||
@Schema(description = "WebAi权限 0关闭 1开启")
|
||||
@ExcelProperty("WebAi权限 0关闭 1开启")
|
||||
private Integer webAi;
|
||||
}
|
||||
@@ -49,4 +49,7 @@ public class TenantAgencyPackageSaveReqVO {
|
||||
|
||||
@Schema(description = "Ai自动回复权限 0关闭 1 开启")
|
||||
private Integer aiReplay;
|
||||
|
||||
@Schema(description = "WebAi权限 0关闭 1开启")
|
||||
private Integer webAi;
|
||||
}
|
||||
@@ -36,4 +36,7 @@ public class UserClientSaveReqVO {
|
||||
|
||||
@Schema(description = "是否允许使用 AI 回复", example = "0不允许,1允许")
|
||||
private Byte aiReplay;
|
||||
|
||||
@Schema(description = "是否允许登录 Web AI 客户端", example = "0不允许,1允许")
|
||||
private Byte webAi;
|
||||
}
|
||||
|
||||
@@ -83,4 +83,7 @@ public class UserRespVO{
|
||||
|
||||
@Schema(description = "是否允许使用 AI 回复", example = "0不允许,1允许")
|
||||
private Byte aiReplay;
|
||||
|
||||
@Schema(description = "是否允许登录 Web AI 客户端", example = "0不允许,1允许")
|
||||
private Byte webAi;
|
||||
}
|
||||
|
||||
@@ -91,4 +91,7 @@ public class UserSaveReqVO {
|
||||
|
||||
@Schema(description = "是否允许使用 AI 回复", example = "0不允许,1允许")
|
||||
private Byte aiReplay;
|
||||
|
||||
@Schema(description = "是否允许登录 Web AI 客户端", example = "0不允许,1允许")
|
||||
private Byte webAi;
|
||||
}
|
||||
|
||||
@@ -78,4 +78,9 @@ public class TenantAgencyPackageDO extends BaseDO {
|
||||
* Ai自动回复权限 0关闭 1开启
|
||||
*/
|
||||
private Integer aiReplay;
|
||||
|
||||
/**
|
||||
* WebAi权限 0关闭 1开启
|
||||
*/
|
||||
private Integer webAi;
|
||||
}
|
||||
@@ -108,4 +108,7 @@ public class AdminUserDO extends TenantBaseDO {
|
||||
|
||||
@Schema(description = "是否允许使用AI回复", example = "0不允许,1允许")
|
||||
private Byte aiReplay;
|
||||
|
||||
@Schema(description = "是否允许登录Web AI客户端", example = "0不允许,1允许")
|
||||
private Byte webAi;
|
||||
}
|
||||
|
||||
@@ -257,6 +257,7 @@ public class TenantServiceImpl implements TenantService {
|
||||
if (tenantAgencyPackageDO.getAiClient() == 1){
|
||||
tenant.setAiExpireTime(offset);
|
||||
}
|
||||
if(tenantAgencyPackageDO.getBrotherClient() == 2){}
|
||||
// 设置新租户的级别为当前租户级别+1(层级关系)
|
||||
if (createReqVO.getTenantType().equals(TenantEnum.AGENCY.getTenantType())){
|
||||
tenant.setTenantLevel(currentTenant.getTenantLevel() + 1);
|
||||
@@ -302,6 +303,9 @@ public class TenantServiceImpl implements TenantService {
|
||||
if (tenantAgencyPackageDO.getAiReplay() == 1){
|
||||
user.setAiReplay((byte) 1);
|
||||
}
|
||||
if (tenantAgencyPackageDO.getWebAi() == 1){
|
||||
user.setWebAi((byte) 1);
|
||||
}
|
||||
userMapper.updateById(user);
|
||||
// 将创建的用户设置为租户的联系人(管理员)
|
||||
tenantMapper.updateById(new TenantDO().setId(tenant.getId()).setContactUserId(userId));
|
||||
|
||||
Reference in New Issue
Block a user