feat: update

This commit is contained in:
landaiqing
2024-05-23 20:45:39 +08:00
parent ad098bf3b9
commit c3a29cedca
39 changed files with 1575 additions and 56 deletions

View File

@@ -0,0 +1,161 @@
package com.schisandra.auth.application.controller;
import com.alibaba.fastjson.JSON;
import com.google.common.base.Preconditions;
import com.schisandra.auth.application.convert.SchisandraAuthSocialUserDTOConverter;
import com.schisandra.auth.application.dto.SchisandraAuthSocialUserDTO;
import com.schisandra.auth.common.entity.Result;
import com.schisandra.auth.domain.bo.SchisandraAuthSocialUserBO;
import com.schisandra.auth.domain.service.SchisandraAuthSocialUserDomainService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* controller
*
* @author landaiqing
* @since 2024-05-23 20:07:57
*/
@RestController
@RequestMapping("/auth/")
@Slf4j
public class SchisandraAuthSocialUserController {
@Resource
private SchisandraAuthSocialUserDomainService schisandraAuthSocialUserDomainService;
/**
* 新增
*/
@RequestMapping("add")
public Result<Boolean> add(@RequestBody SchisandraAuthSocialUserDTO schisandraAuthSocialUserDTO) {
try {
if (log.isInfoEnabled()) {
log.info("SchisandraAuthSocialUserController.add.dto:{}", JSON.toJSONString(schisandraAuthSocialUserDTO));
}
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getId(), "不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUuid(), "第三方系统的唯一ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getSource(), "第三方用户来源不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getAccessToken(), "用户的授权令牌不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getExpireIn(), "第三方用户的授权令牌的有效期不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getRefreshToken(), "刷新令牌不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getOpenId(), "第三方用户的 open id不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUid(), "第三方用户的 ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getAccessCode(), "个别平台的授权信息不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUnionId(), "第三方用户的 union id不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getScope(), "第三方用户授予的权限不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getTokenType(), "个别平台的授权信息不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getIdToken(), "id token不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getMacAlgorithm(), "小米平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getMacKey(), "小米平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getCode(), "用户的授权code不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getOauthToken(), "Twitter平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getOauthTokenSecret(), "Twitter平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getStatus(), "状态不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getCreatedBy(), "创建人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getCreatedTime(), "创建时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUpdateBy(), "更新人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUpdateTime(), "更新时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getIsDeleted(), "是否删除不能为空");
SchisandraAuthSocialUserBO SchisandraAuthSocialUserBO = SchisandraAuthSocialUserDTOConverter.INSTANCE.convertDTOToBO(schisandraAuthSocialUserDTO);
return Result.ok(schisandraAuthSocialUserDomainService.add(SchisandraAuthSocialUserBO));
} catch (Exception e) {
log.error("SchisandraAuthSocialUserController.register.error:{}", e.getMessage(), e);
return Result.fail("新增失败");
}
}
/**
* 修改
*/
@RequestMapping("update")
public Result<Boolean> update(@RequestBody SchisandraAuthSocialUserDTO schisandraAuthSocialUserDTO) {
try {
if (log.isInfoEnabled()) {
log.info("SchisandraAuthSocialUserController.update.dto:{}", JSON.toJSONString(schisandraAuthSocialUserDTO));
}
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getId(), "不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUuid(), "第三方系统的唯一ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getSource(), "第三方用户来源不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getAccessToken(), "用户的授权令牌不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getExpireIn(), "第三方用户的授权令牌的有效期不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getRefreshToken(), "刷新令牌不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getOpenId(), "第三方用户的 open id不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUid(), "第三方用户的 ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getAccessCode(), "个别平台的授权信息不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUnionId(), "第三方用户的 union id不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getScope(), "第三方用户授予的权限不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getTokenType(), "个别平台的授权信息不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getIdToken(), "id token不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getMacAlgorithm(), "小米平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getMacKey(), "小米平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getCode(), "用户的授权code不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getOauthToken(), "Twitter平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getOauthTokenSecret(), "Twitter平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getStatus(), "状态不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getCreatedBy(), "创建人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getCreatedTime(), "创建时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUpdateBy(), "更新人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUpdateTime(), "更新时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getIsDeleted(), "是否删除不能为空");
SchisandraAuthSocialUserBO schisandraAuthSocialUserBO = SchisandraAuthSocialUserDTOConverter.INSTANCE.convertDTOToBO(schisandraAuthSocialUserDTO);
return Result.ok(schisandraAuthSocialUserDomainService.update(schisandraAuthSocialUserBO));
} catch (Exception e) {
log.error("SchisandraAuthSocialUserController.update.error:{}", e.getMessage(), e);
return Result.fail("更新信息失败");
}
}
/**
* 删除
*/
@RequestMapping("delete")
public Result<Boolean> delete(@RequestBody SchisandraAuthSocialUserDTO schisandraAuthSocialUserDTO) {
try {
if (log.isInfoEnabled()) {
log.info("SchisandraAuthSocialUserController.delete.dto:{}", JSON.toJSONString(schisandraAuthSocialUserDTO));
}
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getId(), "不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUuid(), "第三方系统的唯一ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getSource(), "第三方用户来源不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getAccessToken(), "用户的授权令牌不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getExpireIn(), "第三方用户的授权令牌的有效期不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getRefreshToken(), "刷新令牌不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getOpenId(), "第三方用户的 open id不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUid(), "第三方用户的 ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getAccessCode(), "个别平台的授权信息不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUnionId(), "第三方用户的 union id不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getScope(), "第三方用户授予的权限不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getTokenType(), "个别平台的授权信息不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getIdToken(), "id token不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getMacAlgorithm(), "小米平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getMacKey(), "小米平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getCode(), "用户的授权code不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getOauthToken(), "Twitter平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getOauthTokenSecret(), "Twitter平台用户的附带属性不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getStatus(), "状态不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getCreatedBy(), "创建人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getCreatedTime(), "创建时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUpdateBy(), "更新人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getUpdateTime(), "更新时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserDTO.getIsDeleted(), "是否删除不能为空");
SchisandraAuthSocialUserBO schisandraAuthSocialUserBO = SchisandraAuthSocialUserDTOConverter.INSTANCE.convertDTOToBO(schisandraAuthSocialUserDTO);
return Result.ok(schisandraAuthSocialUserDomainService.delete(schisandraAuthSocialUserBO));
} catch (Exception e) {
log.error("SchisandraAuthSocialUserController.delete.error:{}", e.getMessage(), e);
return Result.fail("删除信息失败");
}
}
}

View File

@@ -0,0 +1,113 @@
package com.schisandra.auth.application.controller;
import com.alibaba.fastjson.JSON;
import com.google.common.base.Preconditions;
import com.schisandra.auth.application.convert.SchisandraAuthSocialUserMapperDTOConverter;
import com.schisandra.auth.application.dto.SchisandraAuthSocialUserMapperDTO;
import com.schisandra.auth.common.entity.Result;
import com.schisandra.auth.domain.bo.SchisandraAuthSocialUserMapperBO;
import com.schisandra.auth.domain.service.SchisandraAuthSocialUserMapperDomainService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* controller
*
* @author landaiqing
* @since 2024-05-23 20:13:10
*/
@RestController
@RequestMapping("/auth/")
@Slf4j
public class SchisandraAuthSocialUserMapperController {
@Resource
private SchisandraAuthSocialUserMapperDomainService schisandraAuthSocialUserMapperDomainService;
/**
* 新增
*/
@RequestMapping("add")
public Result<Boolean> add(@RequestBody SchisandraAuthSocialUserMapperDTO schisandraAuthSocialUserMapperDTO) {
try {
if (log.isInfoEnabled()) {
log.info("SchisandraAuthSocialUserMapperController.add.dto:{}", JSON.toJSONString(schisandraAuthSocialUserMapperDTO));
}
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getId(), "不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getUserId(), "系统用户ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getSocialUserId(), "社会化用户ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getCreatedBy(), "创建人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getCreatedTime(), "创建时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getUpdateBy(), "更新人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getUpdateTime(), "更新时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getIsDeleted(), "不能为空");
SchisandraAuthSocialUserMapperBO SchisandraAuthSocialUserMapperBO = SchisandraAuthSocialUserMapperDTOConverter.INSTANCE.convertDTOToBO(schisandraAuthSocialUserMapperDTO);
return Result.ok(schisandraAuthSocialUserMapperDomainService.add(SchisandraAuthSocialUserMapperBO));
} catch (Exception e) {
log.error("SchisandraAuthSocialUserMapperController.register.error:{}", e.getMessage(), e);
return Result.fail("新增失败");
}
}
/**
* 修改
*/
@RequestMapping("update")
public Result<Boolean> update(@RequestBody SchisandraAuthSocialUserMapperDTO schisandraAuthSocialUserMapperDTO) {
try {
if (log.isInfoEnabled()) {
log.info("SchisandraAuthSocialUserMapperController.update.dto:{}", JSON.toJSONString(schisandraAuthSocialUserMapperDTO));
}
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getId(), "不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getUserId(), "系统用户ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getSocialUserId(), "社会化用户ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getCreatedBy(), "创建人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getCreatedTime(), "创建时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getUpdateBy(), "更新人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getUpdateTime(), "更新时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getIsDeleted(), "不能为空");
SchisandraAuthSocialUserMapperBO schisandraAuthSocialUserMapperBO = SchisandraAuthSocialUserMapperDTOConverter.INSTANCE.convertDTOToBO(schisandraAuthSocialUserMapperDTO);
return Result.ok(schisandraAuthSocialUserMapperDomainService.update(schisandraAuthSocialUserMapperBO));
} catch (Exception e) {
log.error("SchisandraAuthSocialUserMapperController.update.error:{}", e.getMessage(), e);
return Result.fail("更新信息失败");
}
}
/**
* 删除
*/
@RequestMapping("delete")
public Result<Boolean> delete(@RequestBody SchisandraAuthSocialUserMapperDTO schisandraAuthSocialUserMapperDTO) {
try {
if (log.isInfoEnabled()) {
log.info("SchisandraAuthSocialUserMapperController.delete.dto:{}", JSON.toJSONString(schisandraAuthSocialUserMapperDTO));
}
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getId(), "不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getUserId(), "系统用户ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getSocialUserId(), "社会化用户ID不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getCreatedBy(), "创建人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getCreatedTime(), "创建时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getUpdateBy(), "更新人不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getUpdateTime(), "更新时间不能为空");
Preconditions.checkNotNull(schisandraAuthSocialUserMapperDTO.getIsDeleted(), "不能为空");
SchisandraAuthSocialUserMapperBO schisandraAuthSocialUserMapperBO = SchisandraAuthSocialUserMapperDTOConverter.INSTANCE.convertDTOToBO(schisandraAuthSocialUserMapperDTO);
return Result.ok(schisandraAuthSocialUserMapperDomainService.delete(schisandraAuthSocialUserMapperBO));
} catch (Exception e) {
log.error("SchisandraAuthSocialUserMapperController.delete.error:{}", e.getMessage(), e);
return Result.fail("删除信息失败");
}
}
}

View File

@@ -8,7 +8,9 @@ import com.schisandra.auth.common.entity.Result;
import com.schisandra.auth.domain.bo.SchisandraAuthUserBO;
import com.schisandra.auth.domain.service.SchisandraAuthUserDomainService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@@ -16,7 +18,7 @@ import javax.annotation.Resource;
* controller
*
* @author landaiqing
* @since 2024-05-23 12:55:58
* @since 2024-05-23 20:00:28
*/
@RestController
@RequestMapping("/auth/")
@@ -29,7 +31,7 @@ public class SchisandraAuthUserController {
/**
* 新增
*/
@PostMapping("add")
@RequestMapping("add")
public Result<Boolean> add(@RequestBody SchisandraAuthUserDTO schisandraAuthUserDTO) {
try {
@@ -37,13 +39,12 @@ public class SchisandraAuthUserController {
log.info("SchisandraAuthUserController.add.dto:{}", JSON.toJSONString(schisandraAuthUserDTO));
}
Preconditions.checkNotNull(schisandraAuthUserDTO.getId(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getUuid(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getUserName(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getNickName(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getEmail(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getPhone(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getPassword(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getSex(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getGender(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getAvatar(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getStatus(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getIntroduce(), "不能为空");
@@ -68,7 +69,7 @@ public class SchisandraAuthUserController {
/**
* 修改
*/
@PostMapping("update")
@RequestMapping("update")
public Result<Boolean> update(@RequestBody SchisandraAuthUserDTO schisandraAuthUserDTO) {
try {
@@ -76,13 +77,12 @@ public class SchisandraAuthUserController {
log.info("SchisandraAuthUserController.update.dto:{}", JSON.toJSONString(schisandraAuthUserDTO));
}
Preconditions.checkNotNull(schisandraAuthUserDTO.getId(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getUuid(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getUserName(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getNickName(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getEmail(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getPhone(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getPassword(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getSex(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getGender(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getAvatar(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getStatus(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getIntroduce(), "不能为空");
@@ -107,7 +107,7 @@ public class SchisandraAuthUserController {
/**
* 删除
*/
@DeleteMapping("delete")
@RequestMapping("delete")
public Result<Boolean> delete(@RequestBody SchisandraAuthUserDTO schisandraAuthUserDTO) {
try {
@@ -115,13 +115,12 @@ public class SchisandraAuthUserController {
log.info("SchisandraAuthUserController.delete.dto:{}", JSON.toJSONString(schisandraAuthUserDTO));
}
Preconditions.checkNotNull(schisandraAuthUserDTO.getId(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getUuid(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getUserName(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getNickName(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getEmail(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getPhone(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getPassword(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getSex(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getGender(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getAvatar(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getStatus(), "不能为空");
Preconditions.checkNotNull(schisandraAuthUserDTO.getIntroduce(), "不能为空");

View File

@@ -0,0 +1,22 @@
package com.schisandra.auth.application.convert;
import com.schisandra.auth.application.dto.SchisandraAuthSocialUserDTO;
import com.schisandra.auth.domain.bo.SchisandraAuthSocialUserBO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
* dto转换器
*
* @author landaiqing
* @since 2024-05-23 20:07:57
*/
@Mapper
public interface SchisandraAuthSocialUserDTOConverter {
SchisandraAuthSocialUserDTOConverter INSTANCE = Mappers.getMapper(SchisandraAuthSocialUserDTOConverter.class);
SchisandraAuthSocialUserBO convertDTOToBO(SchisandraAuthSocialUserDTO schisandraAuthSocialUserDTO);
}

View File

@@ -0,0 +1,22 @@
package com.schisandra.auth.application.convert;
import com.schisandra.auth.application.dto.SchisandraAuthSocialUserMapperDTO;
import com.schisandra.auth.domain.bo.SchisandraAuthSocialUserMapperBO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
* dto转换器
*
* @author landaiqing
* @since 2024-05-23 20:13:10
*/
@Mapper
public interface SchisandraAuthSocialUserMapperDTOConverter {
SchisandraAuthSocialUserMapperDTOConverter INSTANCE = Mappers.getMapper(SchisandraAuthSocialUserMapperDTOConverter.class);
SchisandraAuthSocialUserMapperBO convertDTOToBO(SchisandraAuthSocialUserMapperDTO schisandraAuthSocialUserMapperDTO);
}

View File

@@ -10,7 +10,7 @@ import org.mapstruct.factory.Mappers;
* dto转换器
*
* @author landaiqing
* @since 2024-05-23 12:55:58
* @since 2024-05-23 20:00:28
*/
@Mapper
public interface SchisandraAuthUserDTOConverter {

View File

@@ -0,0 +1,138 @@
package com.schisandra.auth.application.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* dto
*
* @author landaiqing
* @since 2024-05-23 20:07:57
*/
@Data
public class SchisandraAuthSocialUserDTO implements Serializable {
/**
*
*/
private Long id;
/**
* 第三方系统的唯一ID
*/
private String uuid;
/**
* 第三方用户来源
*/
private String source;
/**
* 用户的授权令牌
*/
private String accessToken;
/**
* 第三方用户的授权令牌的有效期
*/
private Integer expireIn;
/**
* 刷新令牌
*/
private String refreshToken;
/**
* 第三方用户的 open id
*/
private String openId;
/**
* 第三方用户的 ID
*/
private String uid;
/**
* 个别平台的授权信息
*/
private String accessCode;
/**
* 第三方用户的 union id
*/
private String unionId;
/**
* 第三方用户授予的权限
*/
private String scope;
/**
* 个别平台的授权信息
*/
private String tokenType;
/**
* id token
*/
private String idToken;
/**
* 小米平台用户的附带属性
*/
private String macAlgorithm;
/**
* 小米平台用户的附带属性
*/
private String macKey;
/**
* 用户的授权code
*/
private String code;
/**
* Twitter平台用户的附带属性
*/
private String oauthToken;
/**
* Twitter平台用户的附带属性
*/
private String oauthTokenSecret;
/**
* 状态
*/
private Integer status;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 是否删除
*/
private Integer isDeleted;
}

View File

@@ -0,0 +1,58 @@
package com.schisandra.auth.application.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* dto
*
* @author landaiqing
* @since 2024-05-23 20:13:10
*/
@Data
public class SchisandraAuthSocialUserMapperDTO implements Serializable {
/**
*
*/
private Long id;
/**
* 系统用户ID
*/
private Long userId;
/**
* 社会化用户ID
*/
private Long socialUserId;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
*
*/
private Integer isDeleted;
}

View File

@@ -9,7 +9,7 @@ import java.util.Date;
* dto
*
* @author landaiqing
* @since 2024-05-23 12:55:58
* @since 2024-05-23 20:00:28
*/
@Data
public class SchisandraAuthUserDTO implements Serializable {
@@ -19,11 +19,6 @@ public class SchisandraAuthUserDTO implements Serializable {
*/
private Long id;
/**
*
*/
private String uuid;
/**
*
*/
@@ -52,7 +47,7 @@ public class SchisandraAuthUserDTO implements Serializable {
/**
*
*/
private Integer sex;
private String gender;
/**
*

View File

@@ -0,0 +1,138 @@
package com.schisandra.auth.domain.bo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* bo
*
* @author landaiqing
* @since 2024-05-23 20:07:57
*/
@Data
public class SchisandraAuthSocialUserBO implements Serializable {
/**
*
*/
private Long id;
/**
* 第三方系统的唯一ID
*/
private String uuid;
/**
* 第三方用户来源
*/
private String source;
/**
* 用户的授权令牌
*/
private String accessToken;
/**
* 第三方用户的授权令牌的有效期
*/
private Integer expireIn;
/**
* 刷新令牌
*/
private String refreshToken;
/**
* 第三方用户的 open id
*/
private String openId;
/**
* 第三方用户的 ID
*/
private String uid;
/**
* 个别平台的授权信息
*/
private String accessCode;
/**
* 第三方用户的 union id
*/
private String unionId;
/**
* 第三方用户授予的权限
*/
private String scope;
/**
* 个别平台的授权信息
*/
private String tokenType;
/**
* id token
*/
private String idToken;
/**
* 小米平台用户的附带属性
*/
private String macAlgorithm;
/**
* 小米平台用户的附带属性
*/
private String macKey;
/**
* 用户的授权code
*/
private String code;
/**
* Twitter平台用户的附带属性
*/
private String oauthToken;
/**
* Twitter平台用户的附带属性
*/
private String oauthTokenSecret;
/**
* 状态
*/
private Integer status;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 是否删除
*/
private Integer isDeleted;
}

View File

@@ -0,0 +1,58 @@
package com.schisandra.auth.domain.bo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* bo
*
* @author landaiqing
* @since 2024-05-23 20:13:10
*/
@Data
public class SchisandraAuthSocialUserMapperBO implements Serializable {
/**
*
*/
private Long id;
/**
* 系统用户ID
*/
private Long userId;
/**
* 社会化用户ID
*/
private Long socialUserId;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
*
*/
private Integer isDeleted;
}

View File

@@ -9,7 +9,7 @@ import java.util.Date;
* bo
*
* @author landaiqing
* @since 2024-05-23 12:55:58
* @since 2024-05-23 20:00:28
*/
@Data
public class SchisandraAuthUserBO implements Serializable {
@@ -19,11 +19,6 @@ public class SchisandraAuthUserBO implements Serializable {
*/
private Long id;
/**
*
*/
private String uuid;
/**
*
*/
@@ -52,7 +47,7 @@ public class SchisandraAuthUserBO implements Serializable {
/**
*
*/
private Integer sex;
private String gender;
/**
*

View File

@@ -0,0 +1,21 @@
package com.schisandra.auth.domain.convert;
import com.schisandra.auth.domain.bo.SchisandraAuthSocialUserBO;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUser;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
* bo转换器
*
* @author landaiqing
* @since 2024-05-23 20:07:57
*/
@Mapper
public interface SchisandraAuthSocialUserBOConverter {
SchisandraAuthSocialUserBOConverter INSTANCE = Mappers.getMapper(SchisandraAuthSocialUserBOConverter.class);
SchisandraAuthSocialUser convertBOToEntity(SchisandraAuthSocialUserBO schisandraAuthSocialUserBO);
}

View File

@@ -0,0 +1,21 @@
package com.schisandra.auth.domain.convert;
import com.schisandra.auth.domain.bo.SchisandraAuthSocialUserMapperBO;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUserMapper;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
/**
* bo转换器
*
* @author landaiqing
* @since 2024-05-23 20:13:10
*/
@Mapper
public interface SchisandraAuthSocialUserMapperBOConverter {
SchisandraAuthSocialUserMapperBOConverter INSTANCE = Mappers.getMapper(SchisandraAuthSocialUserMapperBOConverter.class);
SchisandraAuthSocialUserMapper convertBOToEntity(SchisandraAuthSocialUserMapperBO schisandraAuthSocialUserMapperBO);
}

View File

@@ -10,7 +10,7 @@ import org.mapstruct.factory.Mappers;
* bo转换器
*
* @author landaiqing
* @since 2024-05-23 12:55:58
* @since 2024-05-23 20:00:28
*/
@Mapper
public interface SchisandraAuthUserBOConverter {

View File

@@ -0,0 +1,28 @@
package com.schisandra.auth.domain.service;
import com.schisandra.auth.domain.bo.SchisandraAuthSocialUserBO;
/**
* 领域service
*
* @author landaiqing
* @since 2024-05-23 20:07:57
*/
public interface SchisandraAuthSocialUserDomainService {
/**
* 添加 信息
*/
Boolean add(SchisandraAuthSocialUserBO schisandraAuthSocialUserBO);
/**
* 更新 信息
*/
Boolean update(SchisandraAuthSocialUserBO schisandraAuthSocialUserBO);
/**
* 删除 信息
*/
Boolean delete(SchisandraAuthSocialUserBO schisandraAuthSocialUserBO);
}

View File

@@ -0,0 +1,28 @@
package com.schisandra.auth.domain.service;
import com.schisandra.auth.domain.bo.SchisandraAuthSocialUserMapperBO;
/**
* 领域service
*
* @author landaiqing
* @since 2024-05-23 20:13:10
*/
public interface SchisandraAuthSocialUserMapperDomainService {
/**
* 添加 信息
*/
Boolean add(SchisandraAuthSocialUserMapperBO schisandraAuthSocialUserMapperBO);
/**
* 更新 信息
*/
Boolean update(SchisandraAuthSocialUserMapperBO schisandraAuthSocialUserMapperBO);
/**
* 删除 信息
*/
Boolean delete(SchisandraAuthSocialUserMapperBO schisandraAuthSocialUserMapperBO);
}

View File

@@ -6,7 +6,7 @@ import com.schisandra.auth.domain.bo.SchisandraAuthUserBO;
* 领域service
*
* @author landaiqing
* @since 2024-05-23 12:55:58
* @since 2024-05-23 20:00:28
*/
public interface SchisandraAuthUserDomainService {

View File

@@ -0,0 +1,48 @@
package com.schisandra.auth.domain.service.impl;
import com.schisandra.auth.common.enums.IsDeletedFlagEnum;
import com.schisandra.auth.domain.bo.SchisandraAuthSocialUserBO;
import com.schisandra.auth.domain.convert.SchisandraAuthSocialUserBOConverter;
import com.schisandra.auth.domain.service.SchisandraAuthSocialUserDomainService;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUser;
import com.schisandra.auth.infra.basic.service.SchisandraAuthSocialUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 领域service实现了
*
* @author landaiqing
* @since 2024-05-23 20:07:57
*/
@Service
@Slf4j
public class SchisandraAuthSocialUserDomainServiceImpl implements SchisandraAuthSocialUserDomainService {
@Resource
private SchisandraAuthSocialUserService schisandraAuthSocialUserService;
@Override
public Boolean add(SchisandraAuthSocialUserBO schisandraAuthSocialUserBO) {
SchisandraAuthSocialUser schisandraAuthSocialUser = SchisandraAuthSocialUserBOConverter.INSTANCE.convertBOToEntity(schisandraAuthSocialUserBO);
schisandraAuthSocialUser.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode());
return schisandraAuthSocialUserService.insert(schisandraAuthSocialUser) > 0;
}
@Override
public Boolean update(SchisandraAuthSocialUserBO schisandraAuthSocialUserBO) {
SchisandraAuthSocialUser schisandraAuthSocialUser = SchisandraAuthSocialUserBOConverter.INSTANCE.convertBOToEntity(schisandraAuthSocialUserBO);
return schisandraAuthSocialUserService.update(schisandraAuthSocialUser) > 0;
}
@Override
public Boolean delete(SchisandraAuthSocialUserBO schisandraAuthSocialUserBO) {
SchisandraAuthSocialUser schisandraAuthSocialUser = new SchisandraAuthSocialUser();
schisandraAuthSocialUser.setId(schisandraAuthSocialUserBO.getId());
schisandraAuthSocialUser.setIsDeleted(IsDeletedFlagEnum.DELETED.getCode());
return schisandraAuthSocialUserService.update(schisandraAuthSocialUser) > 0;
}
}

View File

@@ -0,0 +1,49 @@
package com.schisandra.auth.domain.service.impl;
import com.schisandra.auth.common.enums.IsDeletedFlagEnum;
import com.schisandra.auth.domain.bo.SchisandraAuthSocialUserMapperBO;
import com.schisandra.auth.domain.convert.SchisandraAuthSocialUserMapperBOConverter;
import com.schisandra.auth.domain.service.SchisandraAuthSocialUserMapperDomainService;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUserMapper;
import com.schisandra.auth.infra.basic.service.SchisandraAuthSocialUserMapperService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 领域service实现了
*
* @author landaiqing
* @since 2024-05-23 20:13:10
*/
@Service
@Slf4j
public class SchisandraAuthSocialUserMapperDomainServiceImpl implements SchisandraAuthSocialUserMapperDomainService {
@Resource
private SchisandraAuthSocialUserMapperService schisandraAuthSocialUserMapperService;
@Override
public Boolean add(SchisandraAuthSocialUserMapperBO schisandraAuthSocialUserMapperBO) {
SchisandraAuthSocialUserMapper schisandraAuthSocialUserMapper = SchisandraAuthSocialUserMapperBOConverter.INSTANCE.convertBOToEntity(schisandraAuthSocialUserMapperBO);
schisandraAuthSocialUserMapper.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode());
return schisandraAuthSocialUserMapperService.insert(schisandraAuthSocialUserMapper) > 0;
}
@Override
public Boolean update(SchisandraAuthSocialUserMapperBO schisandraAuthSocialUserMapperBO) {
SchisandraAuthSocialUserMapper schisandraAuthSocialUserMapper = SchisandraAuthSocialUserMapperBOConverter.INSTANCE.convertBOToEntity(schisandraAuthSocialUserMapperBO);
return schisandraAuthSocialUserMapperService.update(schisandraAuthSocialUserMapper) > 0;
}
@Override
public Boolean delete(SchisandraAuthSocialUserMapperBO schisandraAuthSocialUserMapperBO) {
SchisandraAuthSocialUserMapper schisandraAuthSocialUserMapper = new SchisandraAuthSocialUserMapper();
schisandraAuthSocialUserMapper.setId(schisandraAuthSocialUserMapperBO.getId());
schisandraAuthSocialUserMapper.setIsDeleted(IsDeletedFlagEnum.DELETED.getCode());
return schisandraAuthSocialUserMapperService.update(schisandraAuthSocialUserMapper) > 0;
}
}

View File

@@ -16,7 +16,7 @@ import javax.annotation.Resource;
* 领域service实现了
*
* @author landaiqing
* @since 2024-05-23 12:55:58
* @since 2024-05-23 20:00:28
*/
@Service
@Slf4j

View File

@@ -0,0 +1,18 @@
package com.schisandra.auth.infra.basic.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUser;
import org.springframework.stereotype.Repository;
/**
* 表数据库访问层
*
* @author landaiqing
* @since 2024-05-23 20:07:57
*/
@Repository
public interface SchisandraAuthSocialUserDao extends BaseMapper<SchisandraAuthSocialUser> {
}

View File

@@ -0,0 +1,18 @@
package com.schisandra.auth.infra.basic.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUserMapper;
import org.springframework.stereotype.Repository;
/**
* 表数据库访问层
*
* @author landaiqing
* @since 2024-05-23 20:13:10
*/
@Repository
public interface SchisandraAuthSocialUserMapperDao extends BaseMapper<SchisandraAuthSocialUserMapper> {
}

View File

@@ -8,7 +8,7 @@ import org.springframework.stereotype.Repository;
* 表数据库访问层
*
* @author landaiqing
* @since 2024-05-23 12:55:58
* @since 2024-05-23 20:00:28
*/
@Repository
public interface SchisandraAuthUserDao extends BaseMapper<SchisandraAuthUser> {

View File

@@ -0,0 +1,167 @@
package com.schisandra.auth.infra.basic.entity;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
/**
* 实体类
*
* @author landaiqing
* @since 2024-05-23 20:07:57
*/
@Data
@TableName("schisandra_auth_social_user")
public class SchisandraAuthSocialUser implements Serializable {
/**
*
*/
@TableId(value = "`id`", type = IdType.AUTO)
private Long id;
/**
* 第三方系统的唯一ID
*/
@TableField("`uuid`")
private String uuid;
/**
* 第三方用户来源
*/
@TableField("`source`")
private String source;
/**
* 用户的授权令牌
*/
@TableField("`access_token`")
private String accessToken;
/**
* 第三方用户的授权令牌的有效期
*/
@TableField("`expire_in`")
private Integer expireIn;
/**
* 刷新令牌
*/
@TableField("`refresh_token`")
private String refreshToken;
/**
* 第三方用户的 open id
*/
@TableField("`open_id`")
private String openId;
/**
* 第三方用户的 ID
*/
@TableField("`uid`")
private String uid;
/**
* 个别平台的授权信息
*/
@TableField("`access_code`")
private String accessCode;
/**
* 第三方用户的 union id
*/
@TableField("`union_id`")
private String unionId;
/**
* 第三方用户授予的权限
*/
@TableField("`scope`")
private String scope;
/**
* 个别平台的授权信息
*/
@TableField("`token_type`")
private String tokenType;
/**
* id token
*/
@TableField("`id_token`")
private String idToken;
/**
* 小米平台用户的附带属性
*/
@TableField("`mac_algorithm`")
private String macAlgorithm;
/**
* 小米平台用户的附带属性
*/
@TableField("`mac_key`")
private String macKey;
/**
* 用户的授权code
*/
@TableField("`code`")
private String code;
/**
* Twitter平台用户的附带属性
*/
@TableField("`oauth_token`")
private String oauthToken;
/**
* Twitter平台用户的附带属性
*/
@TableField("`oauth_token_secret`")
private String oauthTokenSecret;
/**
* 状态
*/
@TableField("`status`")
private Integer status;
/**
* 创建人
*/
@TableField("`created_by`")
private String createdBy;
/**
* 创建时间
*/
@TableField("`created_time`")
private Date createdTime;
/**
* 更新人
*/
@TableField("`update_by`")
private String updateBy;
/**
* 更新时间
*/
@TableField("`update_time`")
private Date updateTime;
/**
* 是否删除
*/
@TableField("`is_deleted`")
private Integer isDeleted;
}

View File

@@ -0,0 +1,71 @@
package com.schisandra.auth.infra.basic.entity;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
/**
* 实体类
*
* @author landaiqing
* @since 2024-05-23 20:13:10
*/
@Data
@TableName("schisandra_auth_social_user_mapper")
public class SchisandraAuthSocialUserMapper implements Serializable {
/**
*
*/
@TableId(value = "`id`", type = IdType.AUTO)
private Long id;
/**
* 系统用户ID
*/
@TableField("`user_id`")
private Long userId;
/**
* 社会化用户ID
*/
@TableField("`social_user_id`")
private Long socialUserId;
/**
* 创建人
*/
@TableField("`created_by`")
private String createdBy;
/**
* 创建时间
*/
@TableField("`created_time`")
private Date createdTime;
/**
* 更新人
*/
@TableField("`update_by`")
private String updateBy;
/**
* 更新时间
*/
@TableField("`update_time`")
private Date updateTime;
/**
*
*/
@TableField("`is_deleted`")
private Integer isDeleted;
}

View File

@@ -13,7 +13,7 @@ import java.util.Date;
* 实体类
*
* @author landaiqing
* @since 2024-05-23 12:55:58
* @since 2024-05-23 20:00:28
*/
@Data
@TableName("schisandra_auth_user")
@@ -25,12 +25,6 @@ public class SchisandraAuthUser implements Serializable {
@TableId(value = "`id`", type = IdType.AUTO)
private Long id;
/**
*
*/
@TableField("`uuid`")
private String uuid;
/**
*
*/
@@ -64,8 +58,8 @@ public class SchisandraAuthUser implements Serializable {
/**
*
*/
@TableField("`sex`")
private Integer sex;
@TableField("`gender`")
private String gender;
/**
*

View File

@@ -0,0 +1,50 @@
package com.schisandra.auth.infra.basic.service;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUserMapper;
/**
* 表服务接口
*
* @author landaiqing
* @since 2024-05-23 20:13:10
*/
public interface SchisandraAuthSocialUserMapperService {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
SchisandraAuthSocialUserMapper queryById(Long id);
/**
* 新增数据
*
* @param schisandraAuthSocialUserMapper 实例对象
* @return 实例对象
*/
int insert(SchisandraAuthSocialUserMapper schisandraAuthSocialUserMapper);
/**
* 修改数据
*
* @param schisandraAuthSocialUserMapper 实例对象
* @return 实例对象
*/
int update(SchisandraAuthSocialUserMapper schisandraAuthSocialUserMapper);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean deleteById(Long id);
/**
* 根据条件查询角色
*/
SchisandraAuthSocialUserMapper queryByCondition(SchisandraAuthSocialUserMapper schisandraAuthSocialUserMapper);
}

View File

@@ -0,0 +1,50 @@
package com.schisandra.auth.infra.basic.service;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUser;
/**
* 表服务接口
*
* @author landaiqing
* @since 2024-05-23 20:07:57
*/
public interface SchisandraAuthSocialUserService {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
SchisandraAuthSocialUser queryById(Long id);
/**
* 新增数据
*
* @param schisandraAuthSocialUser 实例对象
* @return 实例对象
*/
int insert(SchisandraAuthSocialUser schisandraAuthSocialUser);
/**
* 修改数据
*
* @param schisandraAuthSocialUser 实例对象
* @return 实例对象
*/
int update(SchisandraAuthSocialUser schisandraAuthSocialUser);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean deleteById(Long id);
/**
* 根据条件查询角色
*/
SchisandraAuthSocialUser queryByCondition(SchisandraAuthSocialUser schisandraAuthSocialUser);
}

View File

@@ -6,7 +6,7 @@ import com.schisandra.auth.infra.basic.entity.SchisandraAuthUser;
* 表服务接口
*
* @author landaiqing
* @since 2024-05-23 12:55:58
* @since 2024-05-23 20:00:28
*/
public interface SchisandraAuthUserService {

View File

@@ -0,0 +1,93 @@
package com.schisandra.auth.infra.basic.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.schisandra.auth.infra.basic.dao.SchisandraAuthSocialUserMapperDao;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUserMapper;
import com.schisandra.auth.infra.basic.service.SchisandraAuthSocialUserMapperService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Objects;
/**
* 表服务实现类
*
* @author landaiqing
* @since 2024-05-23 20:13:10
*/
@Service("SchisandraAuthSocialUserMapperService")
public class SchisandraAuthSocialUserMapperServiceImpl implements SchisandraAuthSocialUserMapperService {
@Resource
private SchisandraAuthSocialUserMapperDao schisandraAuthSocialUserMapperDao;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public SchisandraAuthSocialUserMapper queryById(Long id) {
return this.schisandraAuthSocialUserMapperDao.selectById(id);
}
/**
* 新增数据
*
* @param schisandraAuthSocialUserMapper 实例对象
* @return 实例对象
*/
@Override
public int insert(SchisandraAuthSocialUserMapper schisandraAuthSocialUserMapper) {
return this.schisandraAuthSocialUserMapperDao.insert(schisandraAuthSocialUserMapper);
}
/**
* 修改数据
*
* @param schisandraAuthSocialUserMapper 实例对象
* @return 实例对象
*/
@Override
public int update(SchisandraAuthSocialUserMapper schisandraAuthSocialUserMapper) {
return this.schisandraAuthSocialUserMapperDao.updateById(schisandraAuthSocialUserMapper);
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Long id) {
return this.schisandraAuthSocialUserMapperDao.deleteById(id) > 0;
}
/**
* 条件查询
*
* @param schisandraAuthSocialUserMapper 条件
* @return 实例对象
*/
@Override
public SchisandraAuthSocialUserMapper queryByCondition(SchisandraAuthSocialUserMapper schisandraAuthSocialUserMapper) {
LambdaQueryWrapper<SchisandraAuthSocialUserMapper> queryWrapper = Wrappers.<SchisandraAuthSocialUserMapper>lambdaQuery()
.eq(Objects.nonNull(schisandraAuthSocialUserMapper.getId()), SchisandraAuthSocialUserMapper::getId, schisandraAuthSocialUserMapper.getId())
.eq(Objects.nonNull(schisandraAuthSocialUserMapper.getUserId()), SchisandraAuthSocialUserMapper::getUserId, schisandraAuthSocialUserMapper.getUserId())
.eq(Objects.nonNull(schisandraAuthSocialUserMapper.getSocialUserId()), SchisandraAuthSocialUserMapper::getSocialUserId, schisandraAuthSocialUserMapper.getSocialUserId())
.eq(Objects.nonNull(schisandraAuthSocialUserMapper.getCreatedBy()), SchisandraAuthSocialUserMapper::getCreatedBy, schisandraAuthSocialUserMapper.getCreatedBy())
.eq(Objects.nonNull(schisandraAuthSocialUserMapper.getCreatedTime()), SchisandraAuthSocialUserMapper::getCreatedTime, schisandraAuthSocialUserMapper.getCreatedTime())
.eq(Objects.nonNull(schisandraAuthSocialUserMapper.getUpdateBy()), SchisandraAuthSocialUserMapper::getUpdateBy, schisandraAuthSocialUserMapper.getUpdateBy())
.eq(Objects.nonNull(schisandraAuthSocialUserMapper.getUpdateTime()), SchisandraAuthSocialUserMapper::getUpdateTime, schisandraAuthSocialUserMapper.getUpdateTime())
.eq(Objects.nonNull(schisandraAuthSocialUserMapper.getIsDeleted()), SchisandraAuthSocialUserMapper::getIsDeleted, schisandraAuthSocialUserMapper.getIsDeleted())
;
return schisandraAuthSocialUserMapperDao.selectOne(queryWrapper);
}
}

View File

@@ -0,0 +1,109 @@
package com.schisandra.auth.infra.basic.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.schisandra.auth.infra.basic.dao.SchisandraAuthSocialUserDao;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUser;
import com.schisandra.auth.infra.basic.service.SchisandraAuthSocialUserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Objects;
/**
* 表服务实现类
*
* @author landaiqing
* @since 2024-05-23 20:07:57
*/
@Service("SchisandraAuthSocialUserService")
public class SchisandraAuthSocialUserServiceImpl implements SchisandraAuthSocialUserService {
@Resource
private SchisandraAuthSocialUserDao schisandraAuthSocialUserDao;
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public SchisandraAuthSocialUser queryById(Long id) {
return this.schisandraAuthSocialUserDao.selectById(id);
}
/**
* 新增数据
*
* @param schisandraAuthSocialUser 实例对象
* @return 实例对象
*/
@Override
public int insert(SchisandraAuthSocialUser schisandraAuthSocialUser) {
return this.schisandraAuthSocialUserDao.insert(schisandraAuthSocialUser);
}
/**
* 修改数据
*
* @param schisandraAuthSocialUser 实例对象
* @return 实例对象
*/
@Override
public int update(SchisandraAuthSocialUser schisandraAuthSocialUser) {
return this.schisandraAuthSocialUserDao.updateById(schisandraAuthSocialUser);
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Long id) {
return this.schisandraAuthSocialUserDao.deleteById(id) > 0;
}
/**
* 条件查询
*
* @param schisandraAuthSocialUser 条件
* @return 实例对象
*/
@Override
public SchisandraAuthSocialUser queryByCondition(SchisandraAuthSocialUser schisandraAuthSocialUser) {
LambdaQueryWrapper<SchisandraAuthSocialUser> queryWrapper = Wrappers.<SchisandraAuthSocialUser>lambdaQuery()
.eq(Objects.nonNull(schisandraAuthSocialUser.getId()), SchisandraAuthSocialUser::getId, schisandraAuthSocialUser.getId())
.eq(Objects.nonNull(schisandraAuthSocialUser.getUuid()), SchisandraAuthSocialUser::getUuid, schisandraAuthSocialUser.getUuid())
.eq(Objects.nonNull(schisandraAuthSocialUser.getSource()), SchisandraAuthSocialUser::getSource, schisandraAuthSocialUser.getSource())
.eq(Objects.nonNull(schisandraAuthSocialUser.getAccessToken()), SchisandraAuthSocialUser::getAccessToken, schisandraAuthSocialUser.getAccessToken())
.eq(Objects.nonNull(schisandraAuthSocialUser.getExpireIn()), SchisandraAuthSocialUser::getExpireIn, schisandraAuthSocialUser.getExpireIn())
.eq(Objects.nonNull(schisandraAuthSocialUser.getRefreshToken()), SchisandraAuthSocialUser::getRefreshToken, schisandraAuthSocialUser.getRefreshToken())
.eq(Objects.nonNull(schisandraAuthSocialUser.getOpenId()), SchisandraAuthSocialUser::getOpenId, schisandraAuthSocialUser.getOpenId())
.eq(Objects.nonNull(schisandraAuthSocialUser.getUid()), SchisandraAuthSocialUser::getUid, schisandraAuthSocialUser.getUid())
.eq(Objects.nonNull(schisandraAuthSocialUser.getAccessCode()), SchisandraAuthSocialUser::getAccessCode, schisandraAuthSocialUser.getAccessCode())
.eq(Objects.nonNull(schisandraAuthSocialUser.getUnionId()), SchisandraAuthSocialUser::getUnionId, schisandraAuthSocialUser.getUnionId())
.eq(Objects.nonNull(schisandraAuthSocialUser.getScope()), SchisandraAuthSocialUser::getScope, schisandraAuthSocialUser.getScope())
.eq(Objects.nonNull(schisandraAuthSocialUser.getTokenType()), SchisandraAuthSocialUser::getTokenType, schisandraAuthSocialUser.getTokenType())
.eq(Objects.nonNull(schisandraAuthSocialUser.getIdToken()), SchisandraAuthSocialUser::getIdToken, schisandraAuthSocialUser.getIdToken())
.eq(Objects.nonNull(schisandraAuthSocialUser.getMacAlgorithm()), SchisandraAuthSocialUser::getMacAlgorithm, schisandraAuthSocialUser.getMacAlgorithm())
.eq(Objects.nonNull(schisandraAuthSocialUser.getMacKey()), SchisandraAuthSocialUser::getMacKey, schisandraAuthSocialUser.getMacKey())
.eq(Objects.nonNull(schisandraAuthSocialUser.getCode()), SchisandraAuthSocialUser::getCode, schisandraAuthSocialUser.getCode())
.eq(Objects.nonNull(schisandraAuthSocialUser.getOauthToken()), SchisandraAuthSocialUser::getOauthToken, schisandraAuthSocialUser.getOauthToken())
.eq(Objects.nonNull(schisandraAuthSocialUser.getOauthTokenSecret()), SchisandraAuthSocialUser::getOauthTokenSecret, schisandraAuthSocialUser.getOauthTokenSecret())
.eq(Objects.nonNull(schisandraAuthSocialUser.getStatus()), SchisandraAuthSocialUser::getStatus, schisandraAuthSocialUser.getStatus())
.eq(Objects.nonNull(schisandraAuthSocialUser.getCreatedBy()), SchisandraAuthSocialUser::getCreatedBy, schisandraAuthSocialUser.getCreatedBy())
.eq(Objects.nonNull(schisandraAuthSocialUser.getCreatedTime()), SchisandraAuthSocialUser::getCreatedTime, schisandraAuthSocialUser.getCreatedTime())
.eq(Objects.nonNull(schisandraAuthSocialUser.getUpdateBy()), SchisandraAuthSocialUser::getUpdateBy, schisandraAuthSocialUser.getUpdateBy())
.eq(Objects.nonNull(schisandraAuthSocialUser.getUpdateTime()), SchisandraAuthSocialUser::getUpdateTime, schisandraAuthSocialUser.getUpdateTime())
.eq(Objects.nonNull(schisandraAuthSocialUser.getIsDeleted()), SchisandraAuthSocialUser::getIsDeleted, schisandraAuthSocialUser.getIsDeleted())
;
return schisandraAuthSocialUserDao.selectOne(queryWrapper);
}
}

View File

@@ -15,7 +15,7 @@ import java.util.Objects;
* 表服务实现类
*
* @author landaiqing
* @since 2024-05-23 12:55:58
* @since 2024-05-23 20:00:28
*/
@Service("SchisandraAuthUserService")
public class SchisandraAuthUserServiceImpl implements SchisandraAuthUserService {
@@ -78,13 +78,12 @@ public class SchisandraAuthUserServiceImpl implements SchisandraAuthUserService
LambdaQueryWrapper<SchisandraAuthUser> queryWrapper = Wrappers.<SchisandraAuthUser>lambdaQuery()
.eq(Objects.nonNull(schisandraAuthUser.getId()), SchisandraAuthUser::getId, schisandraAuthUser.getId())
.eq(Objects.nonNull(schisandraAuthUser.getUuid()), SchisandraAuthUser::getUuid, schisandraAuthUser.getUuid())
.eq(Objects.nonNull(schisandraAuthUser.getUserName()), SchisandraAuthUser::getUserName, schisandraAuthUser.getUserName())
.eq(Objects.nonNull(schisandraAuthUser.getNickName()), SchisandraAuthUser::getNickName, schisandraAuthUser.getNickName())
.eq(Objects.nonNull(schisandraAuthUser.getEmail()), SchisandraAuthUser::getEmail, schisandraAuthUser.getEmail())
.eq(Objects.nonNull(schisandraAuthUser.getPhone()), SchisandraAuthUser::getPhone, schisandraAuthUser.getPhone())
.eq(Objects.nonNull(schisandraAuthUser.getPassword()), SchisandraAuthUser::getPassword, schisandraAuthUser.getPassword())
.eq(Objects.nonNull(schisandraAuthUser.getSex()), SchisandraAuthUser::getSex, schisandraAuthUser.getSex())
.eq(Objects.nonNull(schisandraAuthUser.getGender()), SchisandraAuthUser::getGender, schisandraAuthUser.getGender())
.eq(Objects.nonNull(schisandraAuthUser.getAvatar()), SchisandraAuthUser::getAvatar, schisandraAuthUser.getAvatar())
.eq(Objects.nonNull(schisandraAuthUser.getStatus()), SchisandraAuthUser::getStatus, schisandraAuthUser.getStatus())
.eq(Objects.nonNull(schisandraAuthUser.getIntroduce()), SchisandraAuthUser::getIntroduce, schisandraAuthUser.getIntroduce())

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.schisandra.auth.infra.basic.dao.SchisandraAuthSocialUserDao">
<resultMap id="BaseResultMap" type="com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUser">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="uuid" jdbcType="VARCHAR" property="uuid"/>
<result column="source" jdbcType="VARCHAR" property="source"/>
<result column="access_token" jdbcType="VARCHAR" property="accessToken"/>
<result column="expire_in" jdbcType="INTEGER" property="expireIn"/>
<result column="refresh_token" jdbcType="VARCHAR" property="refreshToken"/>
<result column="open_id" jdbcType="VARCHAR" property="openId"/>
<result column="uid" jdbcType="VARCHAR" property="uid"/>
<result column="access_code" jdbcType="VARCHAR" property="accessCode"/>
<result column="union_id" jdbcType="VARCHAR" property="unionId"/>
<result column="scope" jdbcType="VARCHAR" property="scope"/>
<result column="token_type" jdbcType="VARCHAR" property="tokenType"/>
<result column="id_token" jdbcType="VARCHAR" property="idToken"/>
<result column="mac_algorithm" jdbcType="VARCHAR" property="macAlgorithm"/>
<result column="mac_key" jdbcType="VARCHAR" property="macKey"/>
<result column="code" jdbcType="VARCHAR" property="code"/>
<result column="oauth_token" jdbcType="VARCHAR" property="oauthToken"/>
<result column="oauth_token_secret" jdbcType="VARCHAR" property="oauthTokenSecret"/>
<result column="status" jdbcType="TINYINT" property="status"/>
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.schisandra.auth.infra.basic.dao.SchisandraAuthSocialUserMapperDao">
<resultMap id="BaseResultMap" type="com.schisandra.auth.infra.basic.entity.SchisandraAuthSocialUserMapper">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="user_id" jdbcType="BIGINT" property="userId"/>
<result column="social_user_id" jdbcType="BIGINT" property="socialUserId"/>
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
</resultMap>
</mapper>

View File

@@ -4,13 +4,12 @@
<resultMap id="BaseResultMap" type="com.schisandra.auth.infra.basic.entity.SchisandraAuthUser">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="uuid" jdbcType="VARCHAR" property="uuid"/>
<result column="user_name" jdbcType="VARCHAR" property="userName"/>
<result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
<result column="email" jdbcType="VARCHAR" property="email"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
<result column="sex" jdbcType="TINYINT" property="sex"/>
<result column="gender" jdbcType="VARCHAR" property="gender"/>
<result column="avatar" jdbcType="VARCHAR" property="avatar"/>
<result column="status" jdbcType="TINYINT" property="status"/>
<result column="introduce" jdbcType="VARCHAR" property="introduce"/>

View File

@@ -8,7 +8,7 @@
# 数据库连接信息
jdbc:
dbName: schisandra-cloud-storage
tableName: schisandra_auth_user
tableName: schisandra_auth_social_user_mapper
url: jdbc:mysql://1.95.0.111:3306/
username: root
password: LDQ20020618xxx

View File

@@ -26,6 +26,7 @@ public class EncryptFilterConfig {
config.setKey("d86d7bab3d6ac01ad9dc6a897652f2d2");//1.2版本及以下key 16位1.2以上key 32位
config.setRequestDecryptUriList(Collections.emptyList());
config.setResponseCharset("UTF-8");
config.setDebug(true);
config.setResponseEncryptUriList(Collections.singletonList("/oss/minio/getAllMinioInfo"));
FilterRegistrationBean<EncryptionFilter> registration = new FilterRegistrationBean<EncryptionFilter>();
registration.setFilter(new EncryptionFilter(config));

View File

@@ -13,6 +13,7 @@ import io.minio.MinioClient;
import lombok.extern.slf4j.Slf4j;
import okhttp3.OkHttpClient;
import org.apache.commons.lang3.ObjectUtils;
import org.jetbrains.annotations.Nullable;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@@ -35,16 +36,8 @@ public class MinioOssConfiguration {
private SchisandraOssMinioDomainService schisandraOssMinioDomainService;
public StandardOssClient minioOssClient(String userId) {
CompletableFuture<SchisandraOssMinioDTO> futurePrice = CompletableFuture.supplyAsync(() -> {
SchisandraOssMinioBO minioBO = schisandraOssMinioDomainService.getMinioConfig(Long.valueOf(userId));
SchisandraOssMinioDTO minioDTO = SchisandraOssMinioDTOConverter.INSTANCE.convertBOToDTO(minioBO);
return minioDTO;
});
SchisandraOssMinioDTO minio = futurePrice.join();
if (ObjectUtils.isEmpty(minio)) {
log.error("minio配置信息获取失败");
return null;
}
SchisandraOssMinioDTO minio = getSchisandraOssMinioDTO(userId);
if (minio == null) return null;
MinioOssConfig minioOssConfig = new MinioOssConfig();
minioOssConfig.setBasePath(minio.getBasePath());
minioOssConfig.setBucketName(minio.getBucketName());
@@ -70,6 +63,21 @@ public class MinioOssConfiguration {
}
@Nullable
private SchisandraOssMinioDTO getSchisandraOssMinioDTO(String userId) {
CompletableFuture<SchisandraOssMinioDTO> futurePrice = CompletableFuture.supplyAsync(() -> {
SchisandraOssMinioBO minioBO = schisandraOssMinioDomainService.getMinioConfig(Long.valueOf(userId));
SchisandraOssMinioDTO minioDTO = SchisandraOssMinioDTOConverter.INSTANCE.convertBOToDTO(minioBO);
return minioDTO;
});
SchisandraOssMinioDTO minio = futurePrice.join();
if (ObjectUtils.isEmpty(minio)) {
log.error("minio配置信息获取失败");
return null;
}
return minio;
}
public StandardOssClient minioOssClient(MinioOssConfig minioOssConfig) {
return new MinioOssClient(minioClient(minioOssConfig),minioOssConfig);
}