Commit d8d28246 authored by cq990612's avatar cq990612

增加实体类,mapper,mapper.xml

parent 35de3b5c
...@@ -18,6 +18,7 @@ public enum RespCodeEnum { ...@@ -18,6 +18,7 @@ public enum RespCodeEnum {
REQUEST_TIME_OUT("408", "无法接受请求中的媒体类型"), REQUEST_TIME_OUT("408", "无法接受请求中的媒体类型"),
MEDIA_TYPE_NOT_SUPPORTED("415", "不支持的媒体类型"), MEDIA_TYPE_NOT_SUPPORTED("415", "不支持的媒体类型"),
SERVER_ERROR("500", "获取数据异常"), SERVER_ERROR("500", "获取数据异常"),
INPUT_PARAMETER_ISEMPTY("600", "入参为空"),
/* ******************** 业务自定义异常 ********************* */ /* ******************** 业务自定义异常 ********************* */
RSA_PRIVATE_KEY_ERROR("1001", "生成RSA非对称加密公钥出错"), RSA_PRIVATE_KEY_ERROR("1001", "生成RSA非对称加密公钥出错"),
......
package cn.wisenergy.mapper; package cn.wisenergy.mapper;
import cn.wisenergy.model.app.OtcOrderDetails; import cn.wisenergy.model.app.UsdtOrderDetails;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
...@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author chenqi * @author chenqi
* @since 2021-06-15 * @since 2021-06-15
*/ */
public interface OtcOrderDetailsMapper extends BaseMapper<OtcOrderDetails> { public interface UsdtOrderDetailsMapper extends BaseMapper<UsdtOrderDetails> {
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.wisenergy.mapper.OtcOrderDetailsMapper"> <mapper namespace="cn.wisenergy.mapper.UsdtOrderDetailsMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.model.app.OtcOrderDetails"> <resultMap id="BaseResultMap" type="cn.wisenergy.model.app.UsdtOrderDetails">
<id column="id" property="id" /> <id column="id" property="id" />
<result column="order_no" property="orderNo" />
<result column="user_id" property="userId" /> <result column="user_id" property="userId" />
<result column="order_id" property="orderId" /> <result column="sell_user_id" property="sellUserId" />
<result column="type" property="type" /> <result column="status" property="status" />
<result column="coin_name" property="coinName" /> <result column="coin_name" property="coinName" />
<result column="coin_base" property="coinBase" />
<result column="trade_num" property="tradeNum" /> <result column="trade_num" property="tradeNum" />
<result column="trade_price" property="tradePrice" /> <result column="trade_price" property="tradePrice" />
<result column="fee" property="fee" /> <result column="fee" property="fee" />
<result column="time_at" property="timeAt" /> <result column="cny" property="cny" />
<result column="pay_time" property="payTime" />
<result column="pay_name" property="payName" />
<result column="prove" property="prove" />
<result column="bank_info" property="bankInfo" />
<result column="reason" property="reason" />
<result column="created_at" property="createdAt" /> <result column="created_at" property="createdAt" />
<result column="updated_at" property="updatedAt" /> <result column="updated_at" property="updatedAt" />
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, user_id, order_id, type, coin_name, coin_base, trade_num, trade_price, fee, time_at, created_at, updated_at id, order_no, user_id, sell_user_id, status, coin_name, trade_num, trade_price, fee, cny, pay_time, pay_name, prove, bank_info, reason, created_at, updated_at
</sql> </sql>
</mapper> </mapper>
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
<artifactId>easyexcel</artifactId> <artifactId>easyexcel</artifactId>
<version>2.2.6</version> <version>2.2.6</version>
</dependency> </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>${project.artifactId}-${moduleVersion.wisenergy-model}</finalName> <finalName>${project.artifactId}-${moduleVersion.wisenergy-model}</finalName>
......
...@@ -22,9 +22,9 @@ import java.util.Date; ...@@ -22,9 +22,9 @@ import java.util.Date;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("otc_order_details") @TableName("usdt_order_details")
@ApiModel(value="OtcOrderDetails对象", description="") @ApiModel(value="UsdtOrderDetails对象", description="")
public class OtcOrderDetails implements Serializable { public class UsdtOrderDetails implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -32,32 +32,47 @@ public class OtcOrderDetails implements Serializable { ...@@ -32,32 +32,47 @@ public class OtcOrderDetails implements Serializable {
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
@ApiModelProperty(name = "userId",value = "用户ID") @ApiModelProperty(name = "orderNo",value = "订单id")
private String orderNo;
@ApiModelProperty(name = "userId",value = "收购用户ID")
private Integer userId; private Integer userId;
@ApiModelProperty(name = "orderId",value = "订单id") @ApiModelProperty(name = "sellUserId",value = "出售用户ID")
private Integer orderId; private Integer sellUserId;
@ApiModelProperty(name = "type",value = "类型 1购买 2出售") @ApiModelProperty(name = "status",value = "状态 0待支付 1已支付 2已取消 3已完成")
private Integer type; private Integer status;
@ApiModelProperty(name = "id",value = "币种名称") @ApiModelProperty(name = "coinName",value = "币种名称")
private String coinName; private String coinName;
@ApiModelProperty(name = "coinBase",value = "基础币种")
private String coinBase;
@ApiModelProperty(name = "tradeNum",value = "交易币数量") @ApiModelProperty(name = "tradeNum",value = "交易币数量")
private BigDecimal tradeNum; private BigDecimal tradeNum;
@ApiModelProperty(name = "id",value = "交易价格") @ApiModelProperty(name = "tradePrice",value = "交易价格")
private BigDecimal tradePrice; private BigDecimal tradePrice;
@ApiModelProperty(name = "fee",value = "手续费") @ApiModelProperty(name = "fee",value = "手续费")
private BigDecimal fee; private BigDecimal fee;
@ApiModelProperty(name = "timeAt",value = "交易时间戳") @ApiModelProperty(name = "cny",value = "支付CNY金额")
private Integer timeAt; private BigDecimal cny;
@ApiModelProperty(name = "payTime",value = "支付时间")
private Integer payTime;
@ApiModelProperty(name = "payName",value = "支付人名称")
private String payName;
@ApiModelProperty(name = "prove",value = "支付凭证")
private String prove;
@ApiModelProperty(name = "bankInfo",value = "收款账号信息")
private String bankInfo;
@ApiModelProperty(name = "reason",value = "备注")
private String reason;
private Date createdAt; private Date createdAt;
......
package cn.wisenergy.service.app;
import cn.wisenergy.model.app.Users;
/**
* @Authotr:陈奇
* @QQ1799796883
*/
public interface TestUserService {
Users getByUserInfoById(Long userId);
}
package cn.wisenergy.service.app.impl;
import cn.wisenergy.common.enums.RespCodeEnum;
import cn.wisenergy.common.utils.exception.BaseCustomException;
import cn.wisenergy.mapper.UsersMapper;
import cn.wisenergy.model.app.Users;
import cn.wisenergy.service.app.TestUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Authotr:陈奇
* @QQ1799796883
*/
@Service
@Slf4j
public class TestUserServiceImpl implements TestUserService {
@Autowired
private UsersMapper usersMapper;
@Override
public Users getByUserInfoById(Long userId) {
log.info("TestUserServiceImpl[]getByUserInfoById[]input.param.userId:" + userId);
if (null == userId) {
throw new BaseCustomException(RespCodeEnum.INPUT_PARAMETER_ISEMPTY);
}
Users user = usersMapper.selectById(userId);
if (null == user) {
throw new BaseCustomException(RespCodeEnum.EMPLOYEE_IS_NOT_EXIST_ERROR);
}
return null;
}
}
package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.model.app.Users;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.service.app.TestUserService;
import cn.wisenergy.web.common.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author ASUS
*/
@Api(tags = "用户管理")
@RestController("/user")
@Slf4j
public class TestUserController2 extends BaseController {
@Autowired
private TestUserService testUserService;
@ApiOperation(value = "获取用户信息", notes = "获取用户信息", httpMethod = "GET")
@ApiImplicitParam(name = "userId", value = "用户id", dataType = "int")
@GetMapping("/getByUserId")
public R<Users> getUserInfoById(Long userId) {
log.info("TestUserController2[]getUserInfoById[]input.param.userId:" + userId);
Users user = testUserService.getByUserInfoById(userId);
return R.ok(user);
}
}
...@@ -3,17 +3,20 @@ package cn.wisenergy.web.admin.controller.app; ...@@ -3,17 +3,20 @@ package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.constant.RedisConsts; import cn.wisenergy.common.constant.RedisConsts;
import cn.wisenergy.common.utils.R; import cn.wisenergy.common.utils.R;
import cn.wisenergy.common.utils.RedisUtils; import cn.wisenergy.common.utils.RedisUtils;
import cn.wisenergy.model.app.*; import cn.wisenergy.model.app.Users;
import cn.wisenergy.service.app.*; import cn.wisenergy.service.app.UserService;
import cn.wisenergy.web.common.BaseController; import cn.wisenergy.web.common.BaseController;
import cn.wisenergy.web.config.JwtConfig; import cn.wisenergy.web.config.JwtConfig;
import cn.wisenergy.web.shiro.JwtUtil; import cn.wisenergy.web.shiro.JwtUtil;
import io.swagger.annotations.*; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
...@@ -68,4 +71,6 @@ public class UserController extends BaseController { ...@@ -68,4 +71,6 @@ public class UserController extends BaseController {
redisTemplate.opsForValue().set(RedisConsts.JWT_ACCESS_TOKEN + token, token); redisTemplate.opsForValue().set(RedisConsts.JWT_ACCESS_TOKEN + token, token);
return R.ok(token); return R.ok(token);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment