Procházet zdrojové kódy

移除AccountsStrategy

shimingxy před 15 hodinami
rodič
revize
02085f0e1c

+ 0 - 281
maxkey-entity/src/main/java/org/dromara/maxkey/entity/AccountsStrategy.java

@@ -1,281 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.dromara.maxkey.entity;
-
-import java.io.Serializable;
-import java.util.Base64;
-import java.util.Date;
-
-import org.dromara.mybatis.jpa.entity.JpaEntity;
-
-import jakarta.persistence.Column;
-import jakarta.persistence.Entity;
-import jakarta.persistence.GeneratedValue;
-import jakarta.persistence.Id;
-import jakarta.persistence.Table;
-
-
-@Entity
-@Table(name = "MXK_ACCOUNTS_STRATEGY")
-public class AccountsStrategy extends JpaEntity implements Serializable {
-    
-    /**
-     * 
-     */
-    private static final long serialVersionUID = -8743329570694948718L;
-    @Id
-    @Column
-    @GeneratedValue
-    private String id;
-    @Column
-    private String name;
-    @Column
-    private String appId;
-    private byte[] appIcon;
-    private String appIconBase64;
-    @Column
-    private String appName;
-    @Column
-    private String mapping;
-    @Column
-    String filters ;
-    @Column
-    String orgIdsList;
-    @Column
-    String suffixes;
-    @Column
-    String createType;
-    @Column
-    String status;
-    @Column
-    String description;
-    @Column
-    String createdBy;
-    @Column
-    Date createdDate;
-    @Column
-    String modifiedBy;
-    @Column
-    Date modifiedDate;
-    
-    @Column
-    private String instId;
-    
-    private String instName;
-
-    public AccountsStrategy() {
-        super();
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public String getCreatedBy() {
-        return createdBy;
-    }
-
-    public void setCreatedBy(String createdBy) {
-        this.createdBy = createdBy;
-    }
-
-    public String getModifiedBy() {
-        return modifiedBy;
-    }
-
-    public void setModifiedBy(String modifiedBy) {
-        this.modifiedBy = modifiedBy;
-    }
-
-    public Date getCreatedDate() {
-        return createdDate;
-    }
-
-    public void setCreatedDate(Date createdDate) {
-        this.createdDate = createdDate;
-    }
-
-    public Date getModifiedDate() {
-        return modifiedDate;
-    }
-
-    public void setModifiedDate(Date modifiedDate) {
-        this.modifiedDate = modifiedDate;
-    }
-
-    public String getFilters() {
-        return filters;
-    }
-
-    public void setFilters(String filters) {
-        this.filters = filters;
-    }
-
-    public String getOrgIdsList() {
-        return orgIdsList;
-    }
-
-    public void setOrgIdsList(String orgIdsList) {
-        this.orgIdsList = orgIdsList;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public void setAppId(String appId) {
-        this.appId = appId;
-    }
-
-    public String getAppName() {
-        return appName;
-    }
-
-    public void setAppName(String appName) {
-        this.appName = appName;
-    }
-
-    public String getMapping() {
-        return mapping;
-    }
-
-    public void setMapping(String mapping) {
-        this.mapping = mapping;
-    }
-
-    public byte[] getAppIcon() {
-        return appIcon;
-    }
-
-    public String getAppIconBase64() {
-        return appIconBase64;
-    }
-
-    public void setAppIconBase64(String appIconBase64) {
-        this.appIconBase64 = appIconBase64;
-    }
-
-    public void setAppIcon(byte[] appIcon) {
-        this.appIcon = appIcon;
-    }
-
-    public String getCreateType() {
-        return createType;
-    }
-
-    public void setCreateType(String createType) {
-        this.createType = createType;
-    }
-
-    public String getSuffixes() {
-        return suffixes;
-    }
-
-    public void setSuffixes(String suffixes) {
-        this.suffixes = suffixes;
-    }
-
-    public String getInstId() {
-        return instId;
-    }
-
-    public void setInstId(String instId) {
-        this.instId = instId;
-    }
-
-    public String getInstName() {
-        return instName;
-    }
-
-    public void setInstName(String instName) {
-        this.instName = instName;
-    }
-
-    
-    public void transIconBase64() {
-        if(this.appIcon !=null) {
-            this.appIconBase64 = "data:image/png;base64," + 
-                    Base64.getEncoder().encodeToString(appIcon);
-        }
-    }
-    
-    
-    @Override
-    public String toString() {
-        StringBuilder builder = new StringBuilder();
-        builder.append("AccountsStrategy [id=");
-        builder.append(id);
-        builder.append(", name=");
-        builder.append(name);
-        builder.append(", appId=");
-        builder.append(appId);
-        builder.append(", appName=");
-        builder.append(appName);
-        builder.append(", mapping=");
-        builder.append(mapping);
-        builder.append(", filters=");
-        builder.append(filters);
-        builder.append(", orgIdsList=");
-        builder.append(orgIdsList);
-        builder.append(", status=");
-        builder.append(status);
-        builder.append(", description=");
-        builder.append(description);
-        builder.append(", createdBy=");
-        builder.append(createdBy);
-        builder.append(", createdDate=");
-        builder.append(createdDate);
-        builder.append(", modifiedBy=");
-        builder.append(modifiedBy);
-        builder.append(", modifiedDate=");
-        builder.append(modifiedDate);
-        builder.append("]");
-        return builder.toString();
-    }
-   
-    
-
-}

+ 0 - 7
maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/mapper/AccountsMapper.java

@@ -26,8 +26,6 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
 import org.dromara.maxkey.entity.Accounts;
-import org.dromara.maxkey.entity.AccountsStrategy;
-import org.dromara.maxkey.entity.idm.UserInfo;
 import org.dromara.mybatis.jpa.IJpaMapper;
 
 /**
@@ -36,11 +34,6 @@ import org.dromara.mybatis.jpa.IJpaMapper;
  */
 public  interface AccountsMapper extends IJpaMapper<Accounts,String> {
     
-
-    public List<UserInfo> queryUserNotInStrategy(AccountsStrategy strategy);
-    
-    public long deleteByStrategy(AccountsStrategy strategy);
-    
     public List<Accounts> queryByAppIdAndDate(Accounts account);
     
     @Select("select * from mxk_accounts where appid=#{appId} and    relatedusername=#{relatedUsername}")

+ 0 - 37
maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/mapper/AccountsStrategyMapper.java

@@ -1,37 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-/**
- * 
- */
-package org.dromara.maxkey.persistence.mapper;
-
-import java.util.List;
-
-import org.dromara.maxkey.entity.AccountsStrategy;
-import org.dromara.maxkey.entity.permissions.Roles;
-import org.dromara.mybatis.jpa.IJpaMapper;
-
-/**
- * @author Crystal.sea
- *
- */
-
-public  interface AccountsStrategyMapper extends IJpaMapper<AccountsStrategy,String> {
-
-    public List<Roles> queryDynamicGroups(Roles groups);
-}

+ 0 - 13
maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/service/AccountsService.java

@@ -20,8 +20,6 @@ package org.dromara.maxkey.persistence.service;
 import java.util.List;
 
 import org.dromara.maxkey.entity.Accounts;
-import org.dromara.maxkey.entity.AccountsStrategy;
-import org.dromara.maxkey.entity.idm.UserInfo;
 import org.dromara.mybatis.jpa.service.IJpaService;
 
 public interface AccountsService  extends IJpaService<Accounts,String>{
@@ -30,19 +28,8 @@ public interface AccountsService  extends IJpaService<Accounts,String>{
    
    public boolean remove(String id) ;
    
-   public void refreshByStrategy(AccountsStrategy strategy) ;
-   
-   public void refreshAllByStrategy() ;
-   
-   public List<UserInfo> queryUserNotInStrategy(AccountsStrategy strategy);
-   
-   public long deleteByStrategy(AccountsStrategy strategy) ;
-    
    public List<Accounts> queryByAppIdAndDate(Accounts account) ;
    
    public List<Accounts> queryByAppIdAndAccount(String appId,String relatedUsername);
-   
-   public String generateAccount(UserInfo  userInfo,AccountsStrategy accountsStrategy) ;
   
-    
 }

+ 0 - 32
maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/service/AccountsStrategyService.java

@@ -1,32 +0,0 @@
-/*
- * Copyright [2024] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.dromara.maxkey.persistence.service;
-
-import java.util.List;
-
-import org.dromara.maxkey.entity.AccountsStrategy;
-import org.dromara.maxkey.entity.permissions.Roles;
-import org.dromara.mybatis.jpa.service.IJpaService;
-
-public interface AccountsStrategyService  extends IJpaService<AccountsStrategy,String> {
-
-    public List<Roles> queryDynamicGroups(Roles groups);
-    
-    public boolean deleteById(String groupId) ;
-    
-}

+ 0 - 104
maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/service/impl/AccountsServiceImpl.java

@@ -23,11 +23,9 @@ import org.apache.commons.lang3.StringUtils;
 import org.dromara.maxkey.constants.ConstsStatus;
 import org.dromara.maxkey.crypto.password.PasswordReciprocal;
 import org.dromara.maxkey.entity.Accounts;
-import org.dromara.maxkey.entity.AccountsStrategy;
 import org.dromara.maxkey.entity.idm.UserInfo;
 import org.dromara.maxkey.persistence.mapper.AccountsMapper;
 import org.dromara.maxkey.persistence.service.AccountsService;
-import org.dromara.maxkey.persistence.service.AccountsStrategyService;
 import org.dromara.maxkey.persistence.service.OrganizationsCastService;
 import org.dromara.maxkey.persistence.service.UserInfoService;
 import org.dromara.mybatis.jpa.service.impl.JpaServiceImpl;
@@ -48,9 +46,6 @@ public class AccountsServiceImpl  extends JpaServiceImpl<AccountsMapper,Accounts
     UserInfoService  userInfoService;
     
     @Autowired
-    AccountsStrategyService accountsStrategyService;
-    
-    @Autowired
     OrganizationsCastService organizationsCastService;
     
     @Override
@@ -80,49 +75,7 @@ public class AccountsServiceImpl  extends JpaServiceImpl<AccountsMapper,Accounts
        return false;
    }
    
-   public void refreshByStrategy(AccountsStrategy strategy) {
-       if(StringUtils.isNotBlank(strategy.getOrgIdsList())) {
-           strategy.setOrgIdsList("'"+strategy.getOrgIdsList().replace(",", "','")+"'");
-       }
-       List<UserInfo>  userList = queryUserNotInStrategy(strategy);
-       for(UserInfo user : userList) {
-           Accounts account = new Accounts();
-           account.setAppId(strategy.getAppId());
-           account.setAppName(strategy.getAppName());
-           
-           account.setUserId(user.getId());
-           account.setUsername(user.getUsername());
-           account.setDisplayName(user.getDisplayName());
-           account.setRelatedUsername(generateAccount(user,strategy));
-           account.setRelatedPassword(PasswordReciprocal.getInstance().encode(userInfoService.randomPassword()));
-           
-           account.setInstId(strategy.getInstId());
-           account.setCreateType("automatic");
-           account.setStatus(ConstsStatus.ACTIVE);
-           account.setStrategyId(strategy.getId());
-           
-           insert(account);
-       }
-       deleteByStrategy(strategy);
-   }
-   public void refreshAllByStrategy() {
-       AccountsStrategy queryStrategy = new AccountsStrategy();
-       queryStrategy.setCreateType("automatic");
-       for( AccountsStrategy strategy : accountsStrategyService.query(queryStrategy)) {
-           refreshByStrategy(strategy);
-       }
-   }
-   
    
-   public List<UserInfo> queryUserNotInStrategy(AccountsStrategy strategy){
-       return getMapper().queryUserNotInStrategy(strategy);
-   }
-   
-   public long deleteByStrategy(AccountsStrategy strategy) {
-       return getMapper().deleteByStrategy(strategy);
-   }
-    
-    
    public List<Accounts> queryByAppIdAndDate(Accounts account) {
        return getMapper().queryByAppIdAndDate(account);
    }
@@ -131,63 +84,6 @@ public class AccountsServiceImpl  extends JpaServiceImpl<AccountsMapper,Accounts
        return getMapper().queryByAppIdAndAccount(appId,relatedUsername);
    }
    
-   
-   public String generateAccount(UserInfo  userInfo,AccountsStrategy accountsStrategy) {
-       String shortAccount = generateAccount(userInfo,accountsStrategy,true);
-       String account = generateAccount(userInfo,accountsStrategy,false);
-       String accountResult = shortAccount;
-       List<Accounts> accountsList =getMapper().queryByAppIdAndAccount(accountsStrategy.getAppId(),shortAccount +accountsStrategy.getSuffixes());
-       if(!accountsList.isEmpty()) {
-           if(accountsStrategy.getMapping().equalsIgnoreCase("email")) {
-               accountResult = account;
-               accountsList =getMapper().queryByAppIdAndAccount(accountsStrategy.getAppId(),account + accountsStrategy.getSuffixes());
-           }
-           if(!accountsList.isEmpty()) {
-                for(int i =1 ;i < 100 ;i++) {
-                    accountResult = account + i;
-                    accountsList =getMapper().queryByAppIdAndAccount(accountsStrategy.getAppId(),accountResult + accountsStrategy.getSuffixes());
-                    if(accountsList.isEmpty()) {
-                        break;
-                    }
-                }
-           }
-       }
-       if(StringUtils.isNotBlank(accountsStrategy.getSuffixes())){
-           accountResult = accountResult + accountsStrategy.getSuffixes();
-       }
-       return accountResult;
-   }
-   
-   
-    private String generateAccount(UserInfo  userInfo,AccountsStrategy strategy,boolean isShort) {
-        String account = "";
-        if(strategy.getMapping().equalsIgnoreCase("username")) {
-            account = userInfo.getUsername();
-        }else if(strategy.getMapping().equalsIgnoreCase("mobile")) {
-            account = userInfo.getMobile();
-        }else if(strategy.getMapping().equalsIgnoreCase("email")) {
-            try {
-                if(isShort) {
-                    account = getPinYinShortName(userInfo.getDisplayName());
-                }else {
-                    account = getPinYinName(userInfo.getDisplayName());
-                }
-            }catch(Exception e) {
-                e.printStackTrace();
-            }
-        }else if(strategy.getMapping().equalsIgnoreCase("employeeNumber")) {
-            account = userInfo.getEmployeeNumber();
-        }else if(strategy.getMapping().equalsIgnoreCase("windowsAccount")) {
-            account = userInfo.getWindowsAccount();
-        }else if(strategy.getMapping().equalsIgnoreCase("idCardNo")) {
-            account = userInfo.getIdCardNo();
-        }else {
-            account = userInfo.getUsername();
-        }
-        
-        return account;
-    }
-    
     public static String getPinYinName(String name) throws BadHanyuPinyinOutputFormatCombination {
         HanyuPinyinOutputFormat pinyinFormat = new        HanyuPinyinOutputFormat();
         pinyinFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);

+ 0 - 98
maxkey-persistence/src/main/java/org/dromara/maxkey/persistence/service/impl/AccountsStrategyServiceImpl.java

@@ -1,98 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.dromara.maxkey.persistence.service.impl;
-
-import java.util.List;
-
-import org.dromara.maxkey.entity.AccountsStrategy;
-import org.dromara.maxkey.entity.permissions.Roles;
-import org.dromara.maxkey.persistence.mapper.AccountsStrategyMapper;
-import org.dromara.maxkey.persistence.service.AccountsStrategyService;
-import org.dromara.mybatis.jpa.service.impl.JpaServiceImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public class AccountsStrategyServiceImpl  extends JpaServiceImpl<AccountsStrategyMapper,AccountsStrategy,String> implements AccountsStrategyService{
-    static final  Logger _logger = LoggerFactory.getLogger(AccountsStrategyServiceImpl.class);
-
-    public List<Roles> queryDynamicGroups(Roles groups){
-        return this.getMapper().queryDynamicGroups(groups);
-    }
-    
-    public boolean deleteById(String groupId) {
-        this.delete(groupId);
-        //groupMemberService.deleteByGroupId(groupId);
-        return true;
-    }
-    /*
-    public void refreshDynamicGroups(Groups dynamicGroup){
-        if(dynamicGroup.getDynamic().equals("1")) {
-            boolean isDynamicTimeSupport = false;
-            boolean isBetweenEffectiveTime = false;
-            if(dynamicGroup.getResumeTime()!=null&&dynamicGroup.getResumeTime().equals("")
-                    &&dynamicGroup.getSuspendTime()!=null&&dynamicGroup.getSuspendTime().equals("")) {
-                LocalTime currentTime = LocalDateTime.now().toLocalTime();
-                LocalTime resumeTime = LocalTime.parse(dynamicGroup.getResumeTime());
-                LocalTime suspendTime = LocalTime.parse(dynamicGroup.getSuspendTime());
-                
-                _logger.info("currentTime: " + currentTime 
-                        + " , resumeTime : " + resumeTime 
-                        + " , suspendTime: " + suspendTime);
-                isDynamicTimeSupport = true;
-                
-                if(resumeTime.isBefore(currentTime) && currentTime.isBefore(suspendTime)) {
-                    isBetweenEffectiveTime = true;
-                }
-                
-            }
-            
-            if(dynamicGroup.getOrgIdsList()!=null && !dynamicGroup.getOrgIdsList().equals("")) {
-                dynamicGroup.setOrgIdsList("'"+dynamicGroup.getOrgIdsList().replace(",", "','")+"'");
-            }
-            String filters = dynamicGroup.getFilters();
-            if(StringUtils.filtersSQLInjection(filters.toLowerCase())) {  
-                _logger.info("filters include SQL Injection Attack Risk.");
-                return;
-            }
-            
-            filters = filters.replace("&", " AND ");
-            filters = filters.replace("|", " OR ");
-            
-            dynamicGroup.setFilters(filters);
-            
-            if(isDynamicTimeSupport) {
-                if(isBetweenEffectiveTime) {
-                    groupMemberService.deleteDynamicGroupMember(dynamicGroup);
-                    groupMemberService.addDynamicGroupMember(dynamicGroup);
-                }else {
-                    groupMemberService.deleteDynamicGroupMember(dynamicGroup);
-                }
-            }else{
-                groupMemberService.deleteDynamicGroupMember(dynamicGroup);
-                groupMemberService.addDynamicGroupMember(dynamicGroup);
-            }
-        }
-    }*/
-
-  
-    
-
-    
-}

+ 0 - 106
maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/config/controller/AccountsStrategyController.java

@@ -1,106 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.dromara.maxkey.web.config.controller;
-
-import java.util.List;
-
-import org.apache.commons.collections4.CollectionUtils;
-import org.dromara.maxkey.authn.annotation.CurrentUser;
-import org.dromara.maxkey.entity.AccountsStrategy;
-import org.dromara.maxkey.entity.Message;
-import org.dromara.maxkey.entity.idm.UserInfo;
-import org.dromara.maxkey.persistence.service.AccountsService;
-import org.dromara.maxkey.persistence.service.AccountsStrategyService;
-import org.dromara.mybatis.jpa.entity.JpaPageResults;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.*;
-
-@RestController
-@RequestMapping(value={"/config/accountsstrategy"})
-public class AccountsStrategyController {
-    static final  Logger logger = LoggerFactory.getLogger(AccountsStrategyController.class);
-    
-    @Autowired
-    AccountsStrategyService accountsStrategyService;
-    
-    @Autowired
-    AccountsService accountsService;
-    
-    @GetMapping(value = { "/fetch" }, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public Message<JpaPageResults<AccountsStrategy>> fetch(@ModelAttribute AccountsStrategy accountsStrategy,@CurrentUser UserInfo currentUser) {
-        accountsStrategy.setInstId(currentUser.getInstId());
-        JpaPageResults<AccountsStrategy> accountsStrategyList =accountsStrategyService.fetchPageResults(accountsStrategy);
-        for (AccountsStrategy strategy : accountsStrategyList.getRows()){
-            strategy.transIconBase64();
-        }
-        logger.debug("Accounts Strategy {}" , accountsStrategyList);
-        return new Message<>(accountsStrategyList);
-    }
-
-    @GetMapping(value={"/query"}, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public Message<AccountsStrategy> query(@ModelAttribute AccountsStrategy accountsStrategy,@CurrentUser UserInfo currentUser) {
-        logger.debug("-query  : {}" , accountsStrategy);
-        if (CollectionUtils.isNotEmpty(accountsStrategyService.query(accountsStrategy))) {
-             return new Message<>(Message.SUCCESS);
-        } else {
-             return new Message<>(Message.FAIL);
-        }
-    }
-    
-    @GetMapping(value = { "/get/{id}" }, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public Message<AccountsStrategy> get(@PathVariable String id) {
-        AccountsStrategy accountsStrategy = accountsStrategyService.get(id);
-        return new Message<>(accountsStrategy);
-    }
-    
-    @PostMapping(value={"/add"}, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public Message<AccountsStrategy> insert(@RequestBody AccountsStrategy accountsStrategy,@CurrentUser UserInfo currentUser) {
-        logger.debug("-Add  : {}" , accountsStrategy);
-        
-        if (accountsStrategyService.insert(accountsStrategy)) {
-            accountsService.refreshByStrategy(accountsStrategy);
-            return new Message<>(Message.SUCCESS);
-        } else {
-            return new Message<>(Message.FAIL);
-        }
-    }
-    
-    @PutMapping(value={"/update"}, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public Message<AccountsStrategy> update(@RequestBody  AccountsStrategy accountsStrategy,@CurrentUser UserInfo currentUser) {
-        logger.debug("-update  : {}" , accountsStrategy);
-        if (accountsStrategyService.update(accountsStrategy)) {
-            accountsService.refreshByStrategy(accountsStrategy);
-            return new Message<>(Message.SUCCESS);
-        } else {
-            return new Message<>(Message.FAIL);
-        }
-    }
-    
-    @DeleteMapping(value={"/delete"}, produces = {MediaType.APPLICATION_JSON_VALUE})
-    public Message<AccountsStrategy> delete(@RequestParam List<String> ids,@CurrentUser UserInfo currentUser) {
-        logger.debug("-delete  ids : {} " , ids);
-        if (accountsStrategyService.deleteBatch(ids)) {
-             return new Message<>(Message.SUCCESS);
-        } else {
-            return new Message<>(Message.FAIL);
-        }
-    }
-}

+ 0 - 14
maxkey-webs/maxkey-web-mgt/src/main/java/org/dromara/maxkey/web/controller/AccountsController.java

@@ -26,11 +26,9 @@ import org.dromara.maxkey.constants.ConstsAct;
 import org.dromara.maxkey.constants.ConstsActResult;
 import org.dromara.maxkey.crypto.password.PasswordReciprocal;
 import org.dromara.maxkey.entity.Accounts;
-import org.dromara.maxkey.entity.AccountsStrategy;
 import org.dromara.maxkey.entity.Message;
 import org.dromara.maxkey.entity.idm.UserInfo;
 import org.dromara.maxkey.persistence.service.AccountsService;
-import org.dromara.maxkey.persistence.service.AccountsStrategyService;
 import org.dromara.maxkey.persistence.service.AppsService;
 import org.dromara.maxkey.persistence.service.HistorySystemLogsService;
 import org.dromara.maxkey.persistence.service.UserInfoService;
@@ -60,9 +58,6 @@ public class AccountsController {
     AccountsService accountsService;
     
     @Autowired
-    AccountsStrategyService accountsStrategyService;
-    
-    @Autowired
     AppsService appsService;
     
     @Autowired
@@ -175,14 +170,5 @@ public class AccountsController {
         }
         
     }
-    
-    @GetMapping(value = "/generate")
-    public Message<String> generate(@ModelAttribute Accounts account) {
-        AccountsStrategy accountsStrategy = accountsStrategyService.get(account.getStrategyId());
-           UserInfo  userInfo  = userInfoService.get(account.getUserId());
-        return new Message<>(
-                Message.SUCCESS,accountsService.generateAccount(userInfo,accountsStrategy)
-            );
-    }
 
 }