18 changed files with 444 additions and 149 deletions
@ -0,0 +1,72 @@ |
|||
package com.bnyer.img.controller; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.bnyer.common.core.web.controller.BaseController; |
|||
import com.bnyer.common.core.web.domain.AjaxResult; |
|||
import com.bnyer.common.core.web.page.TableDataInfo; |
|||
import com.bnyer.img.domain.CreatorProfit; |
|||
import com.bnyer.img.dto.CreatorProfitPageDto; |
|||
import com.bnyer.img.dto.CreatorProfitUpdateDto; |
|||
import com.bnyer.img.dto.StatusDto; |
|||
import com.bnyer.img.service.CreatorProfitService; |
|||
import com.github.pagehelper.PageHelper; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Api(value = "【图文平台】艺术家收益接口",tags = "【图文平台】艺术家收益接口") |
|||
@RestController |
|||
@RequestMapping("/img/creatorProfit") |
|||
@Slf4j |
|||
public class CreatorProfitController extends BaseController { |
|||
|
|||
@Autowired |
|||
private CreatorProfitService creatorProfitService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询creatorProfit分页") |
|||
@PostMapping("/page") |
|||
public TableDataInfo pageCreatorProfit(@RequestBody @ApiParam("分页对象") CreatorProfitPageDto dto){ |
|||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); |
|||
List<CreatorProfit> creatorProfits = creatorProfitService.queryPage(dto); |
|||
return getDataTable(creatorProfits); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="修改creatorProfit") |
|||
@PostMapping(value = "/update") |
|||
public AjaxResult updateCreatorProfit(@Validated @RequestBody @ApiParam("creatorProfit对象") CreatorProfitUpdateDto dto){ |
|||
log.debug("【图文平台后台】修改creatorProfit参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(creatorProfitService.update(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="删除creatorProfit") |
|||
@DeleteMapping(value = "/delete/{ids}") |
|||
public AjaxResult deleteCreatorProfit(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("【图文平台后台】删除creatorProfit参数为:{}", JSON.toJSONString(ids)); |
|||
return AjaxResult.success(creatorProfitService.delete(ids)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询creatorProfit详情") |
|||
@GetMapping(value = "/details/{id}") |
|||
public AjaxResult detailsCreatorProfit(@PathVariable @ApiParam("主键id") Long id){ |
|||
log.debug("【图文平台后台】查询creatorProfit详情参数为:{}", id); |
|||
return AjaxResult.success(creatorProfitService.queryDetails(id)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="变更type显示状态") |
|||
@PostMapping(value = "/changeStatus") |
|||
public AjaxResult changeStatus(@Validated @RequestBody @ApiParam("type状态对象") StatusDto dto){ |
|||
log.debug("【图文平台后台】变更type参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(creatorProfitService.changeIsShow(dto.getId(),dto.getStatus())); |
|||
} |
|||
} |
|||
@ -1,48 +0,0 @@ |
|||
package com.bnyer.img.domain; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.IdType; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
|
|||
@ApiModel(value="com-bnyer-img-domain-DownloadLog") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_download_log") |
|||
public class DownloadLog extends BaseDomain { |
|||
/** |
|||
* 主键id |
|||
*/ |
|||
@TableId(value = "id", type = IdType.INPUT) |
|||
@ApiModelProperty(value="主键id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 搜索码 |
|||
*/ |
|||
@TableField(value = "scan_code") |
|||
@ApiModelProperty(value="搜索码") |
|||
private String scanCode; |
|||
|
|||
/** |
|||
* 渠道(0->抖音;1->快手;2->微信) |
|||
*/ |
|||
@TableField(value = "channel") |
|||
@ApiModelProperty(value="渠道(0->抖音;1->快手;2->微信)") |
|||
private String channel; |
|||
|
|||
/** |
|||
* 图片id |
|||
*/ |
|||
@TableField(value = "img_id") |
|||
@ApiModelProperty(value="图片id") |
|||
private Long imgId; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("艺术家手动确认收益接收类") |
|||
public class CreatorHandleConfirmProfitDto implements Serializable { |
|||
|
|||
@NotNull(message = "艺术家id不能为空!") |
|||
@ApiModelProperty(value="id") |
|||
private Long id; |
|||
|
|||
@NotNull(message = "艺术家id不能为空!") |
|||
@ApiModelProperty(value="艺术家id") |
|||
private Long creatorId; |
|||
|
|||
} |
|||
@ -0,0 +1,55 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("艺术家新增权益接收类") |
|||
public class CreatorProfitInsertDto implements Serializable { |
|||
|
|||
@NotNull(message = "艺术家id不能为空!") |
|||
@ApiModelProperty(value="艺术家id") |
|||
private Long creatorId; |
|||
|
|||
@NotBlank(message = "收益人/邀请人搜索码不能为空!") |
|||
@ApiModelProperty(value="收益人/邀请人搜索码") |
|||
private String scanCode; |
|||
|
|||
@NotNull(message = "图片id不能为空!") |
|||
@ApiModelProperty(value="图片id") |
|||
private Long imgId; |
|||
|
|||
@NotBlank(message = "图片地址不能为空!") |
|||
@ApiModelProperty(value="图片地址") |
|||
private String imgUrl; |
|||
|
|||
@NotBlank(message = "结算平台不能为空!") |
|||
@ApiModelProperty(value="结算平台(0->抖音;1->快手;2->微信;3->uniapp)") |
|||
private String platform; |
|||
|
|||
@NotBlank(message = "应用类型不能为空!") |
|||
@ApiModelProperty(value="应用类型(0->bnyer壁纸)") |
|||
private String appType; |
|||
|
|||
@NotBlank(message = "收益类型不能为空!") |
|||
@ApiModelProperty(value="收益类型(0->广告浏览;1->邀请;2->会员)") |
|||
private String type; |
|||
|
|||
@NotBlank(message = "收益状态不能为空!") |
|||
@ApiModelProperty(value="收益状态(0->即将到账;1->已到账;2->转入钱包)") |
|||
private String status; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty(value="创建时间") |
|||
private Date createTime; |
|||
} |
|||
@ -0,0 +1,79 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.bnyer.common.core.utils.bean.BeanUtils; |
|||
import com.bnyer.img.domain.CreatorProfit; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("艺术家修改权益接收类") |
|||
public class CreatorProfitUpdateDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="主键id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="结算流水号") |
|||
private String orderNo; |
|||
|
|||
@NotNull(message = "艺术家id不能为空!") |
|||
@ApiModelProperty(value="艺术家id") |
|||
private Long creatorId; |
|||
|
|||
@NotBlank(message = "收益人/邀请人搜索码不能为空!") |
|||
@ApiModelProperty(value="收益人/邀请人搜索码") |
|||
private String scanCode; |
|||
|
|||
@NotNull(message = "图片id不能为空!") |
|||
@ApiModelProperty(value="图片id") |
|||
private Long imgId; |
|||
|
|||
@NotNull(message = "结算收益不能为空!") |
|||
@ApiModelProperty(value="结算收益(单位毫分)") |
|||
private Integer profit; |
|||
|
|||
@NotBlank(message = "结算平台不能为空!") |
|||
@ApiModelProperty(value="结算平台(0->抖音;1->快手;2->微信;3->uniapp)") |
|||
private String platform; |
|||
|
|||
@NotBlank(message = "应用类型不能为空!") |
|||
@ApiModelProperty(value="应用类型(0->bnyer壁纸)") |
|||
private String appType; |
|||
|
|||
@NotBlank(message = "收益类型不能为空!") |
|||
@ApiModelProperty(value="收益类型(0->广告浏览;1->邀请;2->会员)") |
|||
private String type; |
|||
|
|||
@NotBlank(message = "收益状态不能为空!") |
|||
@ApiModelProperty(value="收益状态(0->即将到账;1->已到账;2->转入钱包)") |
|||
private String status; |
|||
|
|||
@NotBlank(message = "确认收益方式不能为空!") |
|||
@ApiModelProperty(value="确认收益方式(0->系统自动;1->艺术家手动)") |
|||
private String confirmType; |
|||
|
|||
@NotBlank(message = "艺术家确认收益状态不能为空!") |
|||
@ApiModelProperty(value="艺术家确认收益状态(0->待确认;1->已确认)") |
|||
private String confirmStatus; |
|||
|
|||
@NotNull(message = "下载次数不能为空!") |
|||
@ApiModelProperty(value="下载次数") |
|||
private Integer downloadNum; |
|||
|
|||
@NotNull(message = "浏览次数不能为空!") |
|||
@ApiModelProperty(value="浏览次数") |
|||
private Integer viewNum; |
|||
|
|||
public CreatorProfit extractParam(){ |
|||
CreatorProfit creatorProfit = new CreatorProfit(); |
|||
BeanUtils.copyProperties(this,creatorProfit); |
|||
return creatorProfit; |
|||
} |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
package com.bnyer.img.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.bnyer.img.domain.DownloadLog; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface DownloadLogMapper extends BaseMapper<DownloadLog> { |
|||
} |
|||
@ -1,44 +0,0 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.bnyer.img.domain.DownloadLog; |
|||
import com.bnyer.img.domain.VerifyLog; |
|||
import com.bnyer.img.dto.DownloadLogPageDto; |
|||
import com.bnyer.img.dto.VerifyPageDto; |
|||
import com.bnyer.img.vo.VerifyLogVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/31 10:37 |
|||
*/ |
|||
public interface DownloadLogService { |
|||
|
|||
/** |
|||
* 新增下载记录 |
|||
* @param downloadLog 记录参数 |
|||
* @return - |
|||
*/ |
|||
int insertDownloadLog(DownloadLog downloadLog); |
|||
|
|||
/** |
|||
* 查询下载记录分页 |
|||
* @param params 分页参数 |
|||
* @return - |
|||
*/ |
|||
List<DownloadLog> queryPage(DownloadLogPageDto params); |
|||
|
|||
/** |
|||
* 删除记录 |
|||
* @param ids 主键ids |
|||
* @return - |
|||
*/ |
|||
int delete(List<Long> ids); |
|||
|
|||
/** |
|||
* 根据艺术家id查询下载状态记录 |
|||
* @param creatorId 艺术家id |
|||
* @return - |
|||
*/ |
|||
VerifyLogVo queryVerifyStatus(Long creatorId); |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
package com.bnyer.img.task; |
|||
|
|||
import com.bnyer.img.service.CreatorProfitService; |
|||
import com.xxl.job.core.biz.model.ReturnT; |
|||
import com.xxl.job.core.handler.annotation.XxlJob; |
|||
import com.xxl.job.core.log.XxlJobLogger; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/12 18:13 |
|||
*/ |
|||
@Component |
|||
@Slf4j |
|||
public class CreatorProfitConfirmTypeSyncTask { |
|||
|
|||
@Autowired |
|||
private CreatorProfitService creatorProfitService; |
|||
|
|||
@XxlJob("creatorProfitConfirmTypeSyncTask") |
|||
public ReturnT<String> syncUpdateConfirmType(String param) throws Exception { |
|||
creatorProfitService.batchUpdateConfirmType(); |
|||
XxlJobLogger.log("{} 我执行了批量更新艺术家收益状态任务", System.currentTimeMillis()); |
|||
return ReturnT.SUCCESS; |
|||
} |
|||
} |
|||
@ -1,20 +0,0 @@ |
|||
<?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.DownloadLogMapper"> |
|||
<resultMap id="BaseResultMap" type="com.bnyer.img.domain.DownloadLog"> |
|||
<!--@mbg.generated--> |
|||
<!--@Table img_download_log--> |
|||
<id column="id" jdbcType="BIGINT" property="id" /> |
|||
<result column="scan_code" jdbcType="VARCHAR" property="scanCode" /> |
|||
<result column="channel" jdbcType="CHAR" property="channel" /> |
|||
<result column="img_id" jdbcType="BIGINT" property="imgId" /> |
|||
<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, scan_code, channel, img_id, create_time, update_time, sort,is_show |
|||
</sql> |
|||
</mapper> |
|||
Loading…
Reference in new issue