feat():新增根据身份证号查询用户信息
parent
feece98782
commit
511c1bd8d0
|
@ -0,0 +1,38 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-market</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cloud-market-client</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.muyu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu
|
||||||
|
* @Project:Default (Template) Project
|
||||||
|
* @name:${NAME}
|
||||||
|
* @Date:2024/8/20 9:01
|
||||||
|
*/
|
||||||
|
public class Main {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("Hello world!");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.muyu.cloud.market.domin;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.market.domin
|
||||||
|
* @Project:cloud-market
|
||||||
|
* @name:Customer
|
||||||
|
* @Date:2024/8/20 10:03
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "",autoResultMap = true)
|
||||||
|
public class Customer extends BaseEntity {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.muyu.cloud.market.domin.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.market.domin.req
|
||||||
|
* @Project:cloud-market
|
||||||
|
* @name:CustomerListReq
|
||||||
|
* @Date:2024/8/20 10:24
|
||||||
|
*/
|
||||||
|
@Tag(name = "客户信息列表请求对象")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class CustomerListReq {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.muyu.cloud.market.domin.resp;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.market.domin.resp
|
||||||
|
* @Project:cloud-market
|
||||||
|
* @name:CustomerListResp
|
||||||
|
* @Date:2024/8/20 10:45
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Tag(name = "客户信息", description = "客户详细信息情况")
|
||||||
|
public class CustomerListResp {
|
||||||
|
|
||||||
|
}
|
|
@ -19,6 +19,11 @@
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-market-common</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -89,8 +94,14 @@
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-pay-common</artifactId>
|
<artifactId>cloud-pay-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-market-common</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- <dependency>-->
|
<!-- <dependency>-->
|
||||||
<!-- <groupId>com.muyu</groupId>-->
|
<!-- <groupId>com.muyu</groupId>-->
|
||||||
<!-- <artifactId>cloud-common-nacos-remote</artifactId>-->
|
<!-- <artifactId>cloud-common-nacos-remote</artifactId>-->
|
||||||
<!-- </dependency>-->
|
<!-- </dependency>-->
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.muyu.cloud.market.controller;
|
||||||
|
|
||||||
|
import com.muyu.cloud.market.domin.Customer;
|
||||||
|
import com.muyu.cloud.market.domin.resp.CustomerListResp;
|
||||||
|
import com.muyu.cloud.market.service.FindCustomerMeaasgeService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.market.controller
|
||||||
|
* @Project:cloud-market
|
||||||
|
* @name:FindUserMeaasgeController
|
||||||
|
* @Date:2024/8/20 9:42
|
||||||
|
*/
|
||||||
|
@Log4j2
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("customer")
|
||||||
|
@Tag(name = "客户控制层",description = "进行客户信息管理、查看等相关操作")
|
||||||
|
public class FindCustomerMeaasgeController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户信息业务层
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private FindCustomerMeaasgeService findCustomerMeaasgeService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据身份证号查询客户信息
|
||||||
|
* @param userCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(path = "/findListByuserCard/{userCard}")
|
||||||
|
@Operation(summary = "查询客户信息",description = "根据身份证号查询客户信息")
|
||||||
|
public Result<Customer> findListByuserCard(@Validated @PathVariable String userCard){
|
||||||
|
return Result.success(findCustomerMeaasgeService.findListByuserCard(userCard));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.muyu.cloud.market.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.cloud.market.domin.Customer;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.market.mapper
|
||||||
|
* @Project:cloud-market
|
||||||
|
* @name:FindCustomerMeaasgeMapper
|
||||||
|
* @Date:2024/8/20 9:55
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface FindCustomerMeaasgeMapper extends BaseMapper<Customer> {
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.muyu.cloud.market.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.cloud.market.domin.Customer;
|
||||||
|
import com.muyu.cloud.market.domin.resp.CustomerListResp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.market.service
|
||||||
|
* @Project:cloud-market
|
||||||
|
* @name:FindCustomerMeaasgeService
|
||||||
|
* @Date:2024/8/20 9:50
|
||||||
|
*/
|
||||||
|
public interface FindCustomerMeaasgeService extends IService<Customer> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据身份证号查询客户信息
|
||||||
|
* @param userCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Customer findListByuserCard(String userCard);
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.muyu.cloud.market.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.cloud.market.domin.Customer;
|
||||||
|
import com.muyu.cloud.market.domin.resp.CustomerListResp;
|
||||||
|
import com.muyu.cloud.market.mapper.FindCustomerMeaasgeMapper;
|
||||||
|
import com.muyu.cloud.market.service.FindCustomerMeaasgeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.market.service.impl
|
||||||
|
* @Project:cloud-market
|
||||||
|
* @name:FindCustomerMeaasgeService
|
||||||
|
* @Date:2024/8/20 9:51
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FindCustomerMeaasgeServiceImpl extends ServiceImpl<FindCustomerMeaasgeMapper,Customer> implements FindCustomerMeaasgeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户信息持久层
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private FindCustomerMeaasgeMapper findCustomerMeaasgeMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据身份证号查询客户信息
|
||||||
|
* @param userCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Customer findListByuserCard(String userCard) {
|
||||||
|
QueryWrapper<Customer> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("userCard", userCard);
|
||||||
|
return this.getOne(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ nacos:
|
||||||
addr: 21.12.0.8:8848
|
addr: 21.12.0.8:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
|
namespace: ec66ecf1-f28e-43bc-aa86-625f1bc53bf8
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
|
1
pom.xml
1
pom.xml
|
@ -19,6 +19,7 @@
|
||||||
<module>cloud-market-common</module>
|
<module>cloud-market-common</module>
|
||||||
<module>cloud-market-remote</module>
|
<module>cloud-market-remote</module>
|
||||||
<module>cloud-market-server</module>
|
<module>cloud-market-server</module>
|
||||||
|
<module>cloud-market-client</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
Loading…
Reference in New Issue