增加客户列表接口
parent
3cbce82a1c
commit
e1c4344796
|
@ -22,6 +22,15 @@
|
|||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
package com.bwie;
|
||||
|
||||
/**
|
||||
* @Author:zhangzhihao
|
||||
* @name:${NAME}
|
||||
* @Date:2024/7/29 18:59
|
||||
* 不准抄代码,添加注释,清楚每一行代码意思
|
||||
*/
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.bwie.cloud.pay.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:zhangzhihao
|
||||
* @name:OrderPayCustomer
|
||||
* @Date:2024/7/31 8:35
|
||||
* 不准抄代码,添加注释,清楚每一行代码意思
|
||||
*/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "order_pay_customer",autoResultMap = true)
|
||||
public class OrderPayCustomer extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服务/客户名称
|
||||
*/
|
||||
private String appName;
|
||||
|
||||
/**
|
||||
* 服务/客户编码
|
||||
*/
|
||||
private String appCode;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
//package com.bwie.cloud.pay.domain;
|
||||
//
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import lombok.Builder;
|
||||
//import lombok.Data;
|
||||
//import lombok.NoArgsConstructor;
|
||||
//
|
||||
///**
|
||||
// * @Author:zhangzhihao
|
||||
// * @name:orderPayInfo
|
||||
// * @Date:2024/7/31 9:54
|
||||
// * 不准抄代码,添加注释,清楚每一行代码意思
|
||||
// */
|
||||
//@Data
|
||||
//@Builder
|
||||
//@NoArgsConstructor
|
||||
//@AllArgsConstructor
|
||||
//public class orderPayInfo {
|
||||
// /**
|
||||
// * 主键
|
||||
// */
|
||||
// private Long id;
|
||||
//
|
||||
// /**
|
||||
// * 客户名称
|
||||
// */
|
||||
// private String appName;
|
||||
//
|
||||
// /**
|
||||
// * 客户编号
|
||||
// */
|
||||
// private String appCode;
|
||||
//
|
||||
// /**
|
||||
// * 客户单号
|
||||
// */
|
||||
// private String cusOrderNumber;
|
||||
//
|
||||
// /**
|
||||
// * 支付单号
|
||||
// */
|
||||
// private String
|
||||
//
|
||||
//
|
||||
//}
|
|
@ -0,0 +1,43 @@
|
|||
package com.bwie.cloud.pay.domain.req;
|
||||
|
||||
import com.muyu.common.core.validation.custom.IsSystemYseNo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:zhangzhihao
|
||||
* @name:CustomerListReq
|
||||
* @Date:2024/7/31 19:11
|
||||
* 不准抄代码,添加注释,清楚每一行代码意思
|
||||
*/
|
||||
@Tag(name = "客户列表请求对象")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CustomerListReq {
|
||||
|
||||
/**
|
||||
* 服务/客户名称
|
||||
*/
|
||||
@Schema(name = "服务/客户名称",type = "String",description = "客户名称,为微服务中文名称")
|
||||
private String appName;
|
||||
|
||||
/**
|
||||
* 服务/客户编码
|
||||
*/
|
||||
@Schema(name = "服务/客户编码",type = "String",description = "客户名称,为微服务中文名称")
|
||||
private String appCode;
|
||||
|
||||
/**
|
||||
* 状态 sys_ys_no
|
||||
*/
|
||||
@Schema(name = "是否开启",type = "String",description = "用户状态,Y是开启,N是关闭")
|
||||
@IsSystemYseNo
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -80,11 +80,16 @@
|
|||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-rabbit</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-rabbit</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.bwie</groupId>
|
||||
<artifactId>cloud-pay-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.bwie.cloud.pay;
|
|||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
|
@ -14,6 +15,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
@EnableCustomConfig
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.bwie.cloud.pay.mapper")
|
||||
public class PayApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(PayApplication.class,args);
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package com.bwie.cloud.pay.controller;
|
||||
|
||||
import com.bwie.cloud.pay.domain.OrderPayCustomer;
|
||||
import com.bwie.cloud.pay.domain.req.CustomerListReq;
|
||||
import com.bwie.cloud.pay.service.OrderPayCustomerService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:zhangzhihao
|
||||
* @name:OrderPayCustomerController
|
||||
* @Date:2024/7/31 8:57
|
||||
* 不准抄代码,添加注释,清楚每一行代码意思
|
||||
*/
|
||||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("/customer")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "客户控制层",description = "进行客户管理,查看等相关操作")
|
||||
public class OrderPayCustomerController {
|
||||
|
||||
private final OrderPayCustomerService orderPayCustomerService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有的客户
|
||||
* @param customerListReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
@Operation(summary = "查看看护",description = "根据客户的名称,编码,是否开启等可以运行客户的筛选")
|
||||
public Result<List<OrderPayCustomer>> selectList(@Validated @RequestBody CustomerListReq customerListReq){
|
||||
|
||||
return Result.success(orderPayCustomerService.selectList(customerListReq));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package com.bwie.cloud.pay.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author:zhangzhihao
|
||||
* @name:TestController
|
||||
* @Date:2024/7/29 19:28
|
||||
* 不准抄代码,添加注释,清楚每一行代码意思
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test")
|
||||
public class TestController {
|
||||
|
||||
@PostMapping
|
||||
public Result<String> post(){
|
||||
return Result.success("测试post成功");
|
||||
}
|
||||
@GetMapping
|
||||
public Result<String> get(){
|
||||
return Result.success("测试get成功");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.bwie.cloud.pay.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bwie.cloud.pay.domain.OrderPayCustomer;
|
||||
import com.bwie.cloud.pay.domain.req.CustomerListReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:zhangzhihao
|
||||
* @name:OrderPayCustomerMapper
|
||||
* @Date:2024/7/31 8:51
|
||||
* 不准抄代码,添加注释,清楚每一行代码意思
|
||||
*/
|
||||
public interface OrderPayCustomerMapper extends BaseMapper<OrderPayCustomer> {
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.bwie.cloud.pay.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bwie.cloud.pay.domain.OrderPayCustomer;
|
||||
import com.bwie.cloud.pay.domain.req.CustomerListReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:zhangzhihao
|
||||
* @name:OrderPayCustomerService
|
||||
* @Date:2024/7/31 8:56
|
||||
* 不准抄代码,添加注释,清楚每一行代码意思
|
||||
*/
|
||||
public interface OrderPayCustomerService extends IService<OrderPayCustomer> {
|
||||
|
||||
/**
|
||||
* 查询客户集合
|
||||
* @param customerListReq
|
||||
* @return
|
||||
*/
|
||||
public List<OrderPayCustomer> selectList(CustomerListReq customerListReq);
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.bwie.cloud.pay.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bwie.cloud.pay.domain.OrderPayCustomer;
|
||||
import com.bwie.cloud.pay.domain.req.CustomerListReq;
|
||||
import com.bwie.cloud.pay.mapper.OrderPayCustomerMapper;
|
||||
import com.bwie.cloud.pay.service.OrderPayCustomerService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:zhangzhihao
|
||||
* @name:OrderPayCustomerServiceImpl
|
||||
* @Date:2024/7/31 8:56
|
||||
* 不准抄代码,添加注释,清楚每一行代码意思
|
||||
*/
|
||||
@Log4j2
|
||||
@Service
|
||||
public class OrderPayCustomerServiceImpl
|
||||
extends ServiceImpl<OrderPayCustomerMapper, OrderPayCustomer>
|
||||
implements OrderPayCustomerService {
|
||||
@Override
|
||||
public List<OrderPayCustomer> selectList(CustomerListReq customerListReq) {
|
||||
LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(
|
||||
StringUtils.isNotEmpty(customerListReq.getAppName()),
|
||||
OrderPayCustomer::getAppName,customerListReq.getAppName()
|
||||
);
|
||||
queryWrapper.like(
|
||||
StringUtils.isNotEmpty(customerListReq.getAppCode()),
|
||||
OrderPayCustomer::getAppCode,customerListReq.getAppCode()
|
||||
);
|
||||
queryWrapper.eq(
|
||||
StringUtils.isNotEmpty(customerListReq.getStatus()),
|
||||
OrderPayCustomer::getStatus,customerListReq.getStatus()
|
||||
);
|
||||
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue