Merge branch 'dev' of https://gitee.ltd/pig/pigx into dev
This commit is contained in:
commit
c3df685fd7
6 files changed
+48
-12
No files matched your search
@@ -78,10 +78,6 @@
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
<!--web 模块-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -45,6 +45,10 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
<!--UPMS API-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
|
||||
+2
-4
@@ -17,8 +17,6 @@
|
||||
|
||||
package com.pig4cloud.pigx.common.security.feign;
|
||||
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteLogService;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteUserService;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
@@ -51,7 +49,7 @@ public @interface EnablePigxFeignClients {
|
||||
*
|
||||
* @return the array of 'basePackages'.
|
||||
*/
|
||||
String[] basePackages() default {};
|
||||
String[] basePackages() default {"com.pig4cloud.pigx"};
|
||||
|
||||
/**
|
||||
* Type-safe alternative to {@link #basePackages()} for specifying the packages to
|
||||
@@ -78,5 +76,5 @@ public @interface EnablePigxFeignClients {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Class<?>[] clients() default {RemoteUserService.class, RemoteLogService.class};
|
||||
Class<?>[] clients() default {};
|
||||
}
|
||||
+2
-4
@@ -90,9 +90,7 @@ public class OauthClientDetailsController {
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('sys_client_del')")
|
||||
public R<Boolean> delete(@PathVariable String id) {
|
||||
SysOauthClientDetails sysOauthClientDetails = new SysOauthClientDetails();
|
||||
sysOauthClientDetails.setClientId(id);
|
||||
return new R<>(sysOauthClientDetailsService.deleteById(sysOauthClientDetails));
|
||||
return new R<>(sysOauthClientDetailsService.deleteClientDetailsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,6 +102,6 @@ public class OauthClientDetailsController {
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('sys_client_edit')")
|
||||
public R<Boolean> edit(@Valid @RequestBody SysOauthClientDetails sysOauthClientDetails) {
|
||||
return new R<>(sysOauthClientDetailsService.updateById(sysOauthClientDetails));
|
||||
return new R<>(sysOauthClientDetailsService.updateClientDetailsById(sysOauthClientDetails));
|
||||
}
|
||||
}
|
||||
+15
@@ -32,4 +32,19 @@ import com.pig4cloud.pigx.admin.api.entity.SysOauthClientDetails;
|
||||
*/
|
||||
public interface SysOauthClientDetailsService extends IService<SysOauthClientDetails> {
|
||||
|
||||
/**
|
||||
* 通过ID删除客户端
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteClientDetailsById(String id);
|
||||
|
||||
/**
|
||||
* 根据客户端信息
|
||||
*
|
||||
* @param sysOauthClientDetails
|
||||
* @return
|
||||
*/
|
||||
Boolean updateClientDetailsById(SysOauthClientDetails sysOauthClientDetails);
|
||||
}
|
||||
+25
@@ -23,6 +23,8 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysOauthClientDetails;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysOauthClientDetailsMapper;
|
||||
import com.pig4cloud.pigx.admin.service.SysOauthClientDetailsService;
|
||||
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -36,4 +38,27 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class SysOauthClientDetailsServiceImpl extends ServiceImpl<SysOauthClientDetailsMapper, SysOauthClientDetails> implements SysOauthClientDetailsService {
|
||||
|
||||
/**
|
||||
* 通过ID删除客户端
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@CacheEvict(value = SecurityConstants.CLIENT_DETAILS_KEY, key = "#id")
|
||||
public Boolean deleteClientDetailsById(String id) {
|
||||
return this.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据客户端信息
|
||||
*
|
||||
* @param clientDetails
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@CacheEvict(value = SecurityConstants.CLIENT_DETAILS_KEY, key = "#clientDetails.clientId")
|
||||
public Boolean updateClientDetailsById(SysOauthClientDetails clientDetails) {
|
||||
return this.updateById(clientDetails);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user