20 changed files with 517 additions and 16 deletions
@ -0,0 +1,51 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
|
|||
/** |
|||
* 意心记录表 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-common-core-DiamondLog") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_diamond_log") |
|||
public class DiamondLog extends BaseDomain { |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
@TableField(value = "user_id") |
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
/** |
|||
* 意心获取/消耗点数 |
|||
*/ |
|||
@TableField(value = "diamond_num") |
|||
@ApiModelProperty(value="意心获取/消耗点数") |
|||
private Integer diamondNum; |
|||
|
|||
/** |
|||
* 获取/消耗原因 |
|||
*/ |
|||
@TableField(value = "reason") |
|||
@ApiModelProperty(value="获取/消耗原因") |
|||
private String reason; |
|||
|
|||
/** |
|||
* 平台(0->Hub;1->抖音;2->快手;3->微信) |
|||
*/ |
|||
@TableField(value = "`source`") |
|||
@ApiModelProperty(value="平台(0->Hub;1->抖音;2->快手;3->微信)") |
|||
private String source; |
|||
|
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
package com.bnyer.common.core.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
|
|||
/** |
|||
* 画意值记录 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-common-core-GoldLog") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_gold_log") |
|||
public class GoldLog extends BaseDomain { |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
@TableField(value = "user_id") |
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
/** |
|||
* 画意值获取/消耗点数 |
|||
*/ |
|||
@TableField(value = "gold_num") |
|||
@ApiModelProperty(value="画意值获取/消耗点数") |
|||
private Integer goldNum; |
|||
|
|||
/** |
|||
* 获取/消耗原因 |
|||
*/ |
|||
@TableField(value = "reason") |
|||
@ApiModelProperty(value="获取/消耗原因") |
|||
private String reason; |
|||
|
|||
/** |
|||
* 平台(0->Hub;1->抖音;2->快手;3->微信) |
|||
*/ |
|||
@TableField(value = "`source`") |
|||
@ApiModelProperty(value="平台(0->Hub;1->抖音;2->快手;3->微信)") |
|||
private String source; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.bnyer.common.core.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("意心记录分页接收类") |
|||
public class DiamondLogPageDto extends BasePageDto { |
|||
|
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@ApiModelProperty(value="平台(0->Hub;1->抖音;2->快手;3->微信)") |
|||
private String source; |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.bnyer.common.core.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("画意值记录分页接收类") |
|||
public class GoldLogPageDto extends BasePageDto { |
|||
|
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@ApiModelProperty(value="平台(0->Hub;1->抖音;2->快手;3->微信)") |
|||
private String source; |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.bnyer.img.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.bnyer.common.core.domain.DiamondLog; |
|||
import com.bnyer.img.vo.DiamondLogVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface DiamondLogMapper extends BaseMapper<DiamondLog> { |
|||
|
|||
/** |
|||
* 获取意心记录 |
|||
* @param userId 用户id |
|||
* @param source 平台 |
|||
* @return - |
|||
*/ |
|||
List<DiamondLogVo> queryPage(@Param("userId") Long userId, @Param("source") String source); |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.bnyer.img.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.bnyer.common.core.domain.GoldLog; |
|||
import com.bnyer.img.vo.GoldLogVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface GoldLogMapper extends BaseMapper<GoldLog> { |
|||
|
|||
/** |
|||
* 获取画意值记录 |
|||
* @param userId 用户id |
|||
* @param source 平台 |
|||
* @return - |
|||
*/ |
|||
List<GoldLogVo> queryPage(@Param("userId") Long userId, @Param("source") String source); |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.bnyer.common.core.domain.DiamondLog; |
|||
import com.bnyer.common.core.domain.GoldLog; |
|||
import com.bnyer.img.vo.DiamondLogVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface DiamondLogService { |
|||
|
|||
/** |
|||
* 新增意心记录 |
|||
* @param goldLog 意心记录 |
|||
* @return - |
|||
*/ |
|||
int insert(DiamondLog goldLog); |
|||
|
|||
/** |
|||
* 获取意心记录分页 |
|||
* @param userId 用户id |
|||
* @param source 平台(0->Hub;1->抖音;2->快手;3->微信) |
|||
* @return - |
|||
*/ |
|||
List<DiamondLogVo> queryPage(Long userId, String source); |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.bnyer.common.core.domain.GoldLog; |
|||
import com.bnyer.img.vo.GoldLogVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface GoldLogService { |
|||
|
|||
/** |
|||
* 新增画意值记录 |
|||
* @param goldLog 画意值记录 |
|||
* @return - |
|||
*/ |
|||
int insert(GoldLog goldLog); |
|||
|
|||
/** |
|||
* 获取画意值记录分页 |
|||
* @param userId 用户id |
|||
* @param source 平台(0->Hub;1->抖音;2->快手;3->微信) |
|||
* @return - |
|||
*/ |
|||
List<GoldLogVo> queryPage(Long userId, String source); |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import com.bnyer.common.core.domain.DiamondLog; |
|||
import com.bnyer.common.core.domain.GoldLog; |
|||
import com.bnyer.img.mapper.DiamondLogMapper; |
|||
import com.bnyer.img.mapper.GoldLogMapper; |
|||
import com.bnyer.img.service.DiamondLogService; |
|||
import com.bnyer.img.service.GoldLogService; |
|||
import com.bnyer.img.vo.DiamondLogVo; |
|||
import com.bnyer.img.vo.GoldLogVo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
public class DiamondLogServiceImpl implements DiamondLogService { |
|||
|
|||
@Autowired |
|||
private DiamondLogMapper diamondLogMapper; |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int insert(DiamondLog diamondLog) { |
|||
diamondLog.setCreateTime(new Date()); |
|||
diamondLog.setUpdateTime(new Date()); |
|||
diamondLog.setSort(0); |
|||
return diamondLogMapper.insert(diamondLog); |
|||
} |
|||
|
|||
@Override |
|||
public List<DiamondLogVo> queryPage(Long userId, String source) { |
|||
return diamondLogMapper.queryPage(userId,source); |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.bnyer.common.core.domain.GoldLog; |
|||
import com.bnyer.common.core.dto.GoldLogPageDto; |
|||
import com.bnyer.img.mapper.GoldLogMapper; |
|||
import com.bnyer.img.service.GoldLogService; |
|||
import com.bnyer.img.vo.GoldLogVo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
public class GoldLogServiceImpl implements GoldLogService { |
|||
|
|||
@Autowired |
|||
private GoldLogMapper goldLogMapper; |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int insert(GoldLog goldLog) { |
|||
goldLog.setCreateTime(new Date()); |
|||
goldLog.setUpdateTime(new Date()); |
|||
goldLog.setSort(0); |
|||
return goldLogMapper.insert(goldLog); |
|||
} |
|||
|
|||
@Override |
|||
public List<GoldLogVo> queryPage(Long userId, String source) { |
|||
return goldLogMapper.queryPage(userId,source); |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.bnyer.img.vo; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("意心记录响应体") |
|||
public class DiamondLogVo implements Serializable { |
|||
|
|||
@ApiModelProperty(value="主键Id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@ApiModelProperty(value="意心获取/消耗点数") |
|||
private Integer diamondNum; |
|||
|
|||
@ApiModelProperty(value="获取/消耗原因") |
|||
private String reason; |
|||
@ApiModelProperty(value="平台(0->Hub;1->抖音;2->快手;3->微信)") |
|||
private String source; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty(value="创建时间") |
|||
private Date createTime; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.bnyer.img.vo; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("画意值记录响应体") |
|||
public class GoldLogVo implements Serializable { |
|||
|
|||
@ApiModelProperty(value="主键Id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@ApiModelProperty(value="画意值获取/消耗点数") |
|||
private Integer goldNum; |
|||
|
|||
@ApiModelProperty(value="获取/消耗原因") |
|||
private String reason; |
|||
@ApiModelProperty(value="平台(0->Hub;1->抖音;2->快手;3->微信)") |
|||
private String source; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty(value="创建时间") |
|||
private Date createTime; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
<?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.bnyer.img.mapper.DiamondLogMapper"> |
|||
<resultMap id="BaseResultMap" type="com.bnyer.common.core.domain.DiamondLog"> |
|||
<!--@mbg.generated--> |
|||
<!--@Table img_diamond_log--> |
|||
<id column="id" jdbcType="BIGINT" property="id" /> |
|||
<result column="user_id" jdbcType="BIGINT" property="userId" /> |
|||
<result column="diamond_num" jdbcType="INTEGER" property="diamondNum" /> |
|||
<result column="reason" jdbcType="VARCHAR" property="reason" /> |
|||
<result column="source" jdbcType="CHAR" property="source" /> |
|||
<result column="is_show" jdbcType="CHAR" property="isShow" /> |
|||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
|||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
|||
<result column="sort" jdbcType="INTEGER" property="sort" /> |
|||
</resultMap> |
|||
<sql id="Base_Column_List"> |
|||
<!--@mbg.generated--> |
|||
id, user_id, diamond_num, reason, `source`, is_show, create_time, update_time, sort |
|||
</sql> |
|||
|
|||
<select id="queryPage" resultType="com.bnyer.img.vo.DiamondLogVo"> |
|||
select |
|||
id, user_id, diamond_num, reason, `source`,create_time |
|||
from img_diamond_log |
|||
where user_id = #{userId} and source = #{source} |
|||
order by create_time desc |
|||
</select> |
|||
</mapper> |
|||
@ -0,0 +1,29 @@ |
|||
<?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.bnyer.img.mapper.GoldLogMapper"> |
|||
<resultMap id="BaseResultMap" type="com.bnyer.common.core.domain.GoldLog"> |
|||
<!--@mbg.generated--> |
|||
<!--@Table img_gold_log--> |
|||
<id column="id" jdbcType="BIGINT" property="id" /> |
|||
<result column="user_id" jdbcType="BIGINT" property="userId" /> |
|||
<result column="gold_num" jdbcType="INTEGER" property="goldNum" /> |
|||
<result column="reason" jdbcType="VARCHAR" property="reason" /> |
|||
<result column="source" jdbcType="CHAR" property="source" /> |
|||
<result column="is_show" jdbcType="CHAR" property="isShow" /> |
|||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
|||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
|||
<result column="sort" jdbcType="INTEGER" property="sort" /> |
|||
</resultMap> |
|||
<sql id="Base_Column_List"> |
|||
<!--@mbg.generated--> |
|||
id, user_id, gold_num, reason, `source`, is_show, create_time, update_time, sort |
|||
</sql> |
|||
|
|||
<select id="queryPage" resultType="com.bnyer.img.vo.GoldLogVo"> |
|||
select |
|||
id, user_id, gold_num, reason, `source`,create_time |
|||
from img_gold_log |
|||
where user_id = #{userId} and source = #{source} |
|||
order by create_time desc |
|||
</select> |
|||
</mapper> |
|||
Loading…
Reference in new issue