李雨欣 9.3测试接口 22:30
parent
e35d8f8cbf
commit
ec5da46291
|
@ -53,4 +53,10 @@ public class Spend extends BaseEntity {
|
|||
@Schema(description = "消费时间",type = "Date")
|
||||
private Date spendTime;
|
||||
|
||||
private String createBy;
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
private Date updateTime;
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.market.admain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "market_top_log",autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class TopLog extends BaseEntity {
|
||||
|
||||
|
||||
/**
|
||||
* 充值ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO,value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@Schema(description = "订单编号",type = "String")
|
||||
private String number;
|
||||
/**
|
||||
* 交易名称
|
||||
*/
|
||||
@Schema(description = "交易名称",type = "String")
|
||||
private String channel;
|
||||
/**
|
||||
* 交易金额
|
||||
*/
|
||||
@Schema(description = "交易金额",type = "BigDecimal")
|
||||
private BigDecimal money;
|
||||
/**
|
||||
* 充值时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "充值时间",type = "String")
|
||||
private Date time;
|
||||
|
||||
|
||||
|
||||
private String createBy;
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
private Date updateTime;
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.muyu.market.admain.request;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "充值记录表",description = "记录客户充值的数据")
|
||||
public class TopLogreq extends BaseEntity {
|
||||
|
||||
|
||||
/**
|
||||
* 充值ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO,value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@Schema(description = "订单编号",type = "String")
|
||||
private String number;
|
||||
/**
|
||||
* 交易名称
|
||||
*/
|
||||
@Schema(description = "交易名称",type = "String")
|
||||
private String channel;
|
||||
/**
|
||||
* 交易金额
|
||||
*/
|
||||
@Schema(description = "交易金额",type = "BigDecimal")
|
||||
private BigDecimal money;
|
||||
/**
|
||||
* 充值时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "充值时间",type = "String")
|
||||
private Date time;
|
||||
|
||||
|
||||
|
||||
private String create_by;
|
||||
private String create_time;
|
||||
private String update_by;
|
||||
private String update_time;
|
||||
private String remark;
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.muyu.market.admain.response;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.market.admain.Spend;
|
||||
import com.muyu.market.admain.TopLog;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "充值记录表",description = "记录客户充值的数据")
|
||||
public class TopLogresp extends BaseEntity {
|
||||
|
||||
|
||||
/**
|
||||
* 充值ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO,value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@Schema(description = "订单编号",type = "String")
|
||||
private String number;
|
||||
/**
|
||||
* 交易名称
|
||||
*/
|
||||
@Schema(description = "交易名称",type = "String")
|
||||
private String channel;
|
||||
/**
|
||||
* 交易金额
|
||||
*/
|
||||
@Schema(description = "交易金额",type = "BigDecimal")
|
||||
private BigDecimal money;
|
||||
/**
|
||||
* 充值时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "充值时间",type = "String")
|
||||
private Date time;
|
||||
|
||||
|
||||
|
||||
private String create_by;
|
||||
private String create_time;
|
||||
private String update_by;
|
||||
private String update_time;
|
||||
private String remark;
|
||||
|
||||
|
||||
public static TopLogresp selTopLogList(TopLog topLog){
|
||||
|
||||
return TopLogresp
|
||||
.builder()
|
||||
.id(topLog.getId())
|
||||
.number(topLog.getNumber())
|
||||
.channel(topLog.getChannel())
|
||||
.money(topLog.getMoney())
|
||||
.time(topLog.getTime())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.market.server.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.market.admain.request.SpendReq;
|
||||
import com.muyu.market.admain.request.TopLogreq;
|
||||
import com.muyu.market.admain.response.SpendResp;
|
||||
import com.muyu.market.admain.response.TopLogresp;
|
||||
import com.muyu.market.server.service.TopLogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/topLog")
|
||||
@Tag(name = "充值记录控制层",description = "充值记录控制层")
|
||||
@RequiredArgsConstructor
|
||||
public class TopLogController {
|
||||
|
||||
@Autowired
|
||||
private TopLogService topLogService;
|
||||
|
||||
@RequestMapping(path = "/toplogList",method = RequestMethod.POST)
|
||||
@Operation(summary = "充值记录展示",description = "根据接口")
|
||||
public Result<List<TopLogresp>> findBySpendList(@Validated @RequestBody TopLogreq topLogreq){
|
||||
return Result.success(topLogService.findByTopLOgList(topLogreq));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package com.muyu.market.server.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.market.admain.TopLog;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TopLogMapper extends BaseMapper<TopLog> {
|
||||
}
|
|
@ -4,10 +4,8 @@ package com.muyu.market.server.service.Impl;
|
|||
import com.alibaba.nacos.common.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.market.admain.Record;
|
||||
import com.muyu.market.admain.Spend;
|
||||
import com.muyu.market.admain.request.SpendReq;
|
||||
import com.muyu.market.admain.response.RecordListResp;
|
||||
import com.muyu.market.admain.response.SpendResp;
|
||||
import com.muyu.market.server.mapper.SpendMapper;
|
||||
import com.muyu.market.server.service.SpendService;
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
package com.muyu.market.server.service.Impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.JwtUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import com.muyu.market.admain.Myapi;
|
||||
import com.muyu.market.admain.SysUser;
|
||||
import com.muyu.market.server.mapper.SysUserMapper;
|
||||
import com.muyu.market.server.service.SysUserService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package com.muyu.market.server.service.Impl;
|
||||
|
||||
import com.alibaba.nacos.common.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.market.admain.Myapi;
|
||||
import com.muyu.market.admain.TopLog;
|
||||
import com.muyu.market.admain.request.TopLogreq;
|
||||
import com.muyu.market.admain.response.MyapiListResp;
|
||||
import com.muyu.market.admain.response.TopLogresp;
|
||||
import com.muyu.market.server.mapper.TopLogMapper;
|
||||
import com.muyu.market.server.service.TopLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class TopLogServiceImpl extends ServiceImpl<TopLogMapper, TopLog> implements TopLogService {
|
||||
|
||||
@Autowired
|
||||
private TopLogMapper topLogMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<TopLogresp> findByTopLOgList(TopLogreq topLogreq) {
|
||||
|
||||
|
||||
|
||||
LambdaQueryWrapper<TopLog> lambdaQueryWrapperlist = new LambdaQueryWrapper<>();
|
||||
/**
|
||||
* 查询接口名称
|
||||
*/
|
||||
|
||||
if (StringUtils.isNotBlank( topLogreq.getChannel())) {
|
||||
lambdaQueryWrapperlist.like( TopLog::getChannel, topLogreq.getChannel());
|
||||
}
|
||||
|
||||
List<TopLog> topLogslist = this.list(lambdaQueryWrapperlist);
|
||||
|
||||
return topLogslist.stream()
|
||||
.map( TopLogresp::selTopLogList)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.muyu.market.server.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.market.admain.TopLog;
|
||||
import com.muyu.market.admain.request.TopLogreq;
|
||||
import com.muyu.market.admain.response.TopLogresp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TopLogService extends IService<TopLog> {
|
||||
List<TopLogresp> findByTopLOgList(TopLogreq topLogreq);
|
||||
}
|
Loading…
Reference in New Issue