19 changed files with 634 additions and 68 deletions
@ -0,0 +1,108 @@ |
|||
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.img.domain.TiktokImg; |
|||
import com.bnyer.img.dto.CreatorDto; |
|||
import com.bnyer.img.dto.TiktokImgListMiniDto; |
|||
import com.bnyer.img.dto.TiktokImgMiniDto; |
|||
import com.bnyer.img.service.*; |
|||
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 = "img-creator-【小程序】艺术家接口",tags = "img-creator-【小程序】艺术家接口") |
|||
@RestController |
|||
@RequestMapping("/img/mini/creator") |
|||
@Slf4j |
|||
public class CreatorMiniController extends BaseController { |
|||
|
|||
|
|||
@Autowired |
|||
private CreatorService creatorService; |
|||
|
|||
@Autowired |
|||
private VerifyLogService verifyLogService; |
|||
|
|||
@Autowired |
|||
private TiktokImgService tiktokImgService; |
|||
|
|||
@Autowired |
|||
private TypeService typeService; |
|||
|
|||
@Autowired |
|||
private BannerService bannerService; |
|||
|
|||
//@TokenCheck
|
|||
@ApiOperation(value="成为艺术家") |
|||
@PostMapping(value = "/insertCreator") |
|||
public AjaxResult insertCreator(@Validated @RequestBody @ApiParam("艺术家对象") CreatorDto dto){ |
|||
log.info("【艺术家小程序】成为艺术家参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(creatorService.insertCreator(dto)); |
|||
} |
|||
|
|||
//@TokenCheck
|
|||
@ApiOperation(value="查看审核结果") |
|||
@GetMapping(value = "/queryVerifyStatus/{creatorId}") |
|||
public AjaxResult queryVerifyStatus(@PathVariable @ApiParam("审核结果id") Long creatorId){ |
|||
log.info("【艺术家小程序】查看审核结果参数为:{}", JSON.toJSONString(creatorId)); |
|||
return AjaxResult.success(verifyLogService.queryVerifyStatus(creatorId)); |
|||
} |
|||
|
|||
//@TokenCheck
|
|||
@ApiOperation(value="查询指定艺术家图片集合") |
|||
@PostMapping(value = "/listTiktokImgIn") |
|||
public AjaxResult listTiktokImgIn(@Validated @RequestBody @ApiParam("TiktokImg对象") TiktokImgListMiniDto dto){ |
|||
log.info("【艺术家小程序】查询指定艺术家【{}】图片集合参数为:{}",dto.getCreatorId(), JSON.toJSONString(dto)); |
|||
return AjaxResult.success(tiktokImgService.queryInList(dto.getCreatorId(),dto.getTypeId())); |
|||
} |
|||
|
|||
//@TokenCheck
|
|||
@ApiOperation(value="批量删除艺术家图片") |
|||
@GetMapping(value = "/deleteTiktokImg/{ids}") |
|||
public AjaxResult deleteTiktokImg(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.info("【艺术家小程序】删除艺术家图片参数为:{}", JSON.toJSONString(ids)); |
|||
return AjaxResult.success(tiktokImgService.delete(ids)); |
|||
} |
|||
|
|||
//@TokenCheck
|
|||
@ApiOperation(value="修改艺术家图片") |
|||
@PostMapping(value = "/updateTiktokImg") |
|||
public AjaxResult updateTiktokImg(@Validated @RequestBody @ApiParam("TiktokImg对象") TiktokImgMiniDto dto){ |
|||
log.info("【艺术家小程序】艺术家【{}】修改图片参数为:{}",dto.getCreatorId(), JSON.toJSONString(dto)); |
|||
TiktokImg tiktokImg = dto.extractParam(); |
|||
tiktokImg.setStatus("0"); |
|||
return AjaxResult.success(tiktokImgService.update(dto.extractParam())); |
|||
} |
|||
|
|||
//@TokenCheck
|
|||
@ApiOperation(value="新增艺术家图片") |
|||
@PostMapping(value = "/insertTiktokImg") |
|||
public AjaxResult insertTiktokImg(@Validated @RequestBody @ApiParam("TiktokImg对象") TiktokImgMiniDto dto){ |
|||
log.info("【艺术家小程序】艺术家【{}】新增图片参数为:{}",dto.getCreatorId(),JSON.toJSONString(dto)); |
|||
TiktokImg tiktokImg = dto.extractParam(); |
|||
tiktokImg.setStatus("0"); |
|||
return AjaxResult.success(tiktokImgService.insert(tiktokImg)); |
|||
} |
|||
|
|||
//@TokenCheck
|
|||
@ApiOperation(value="查询type列表") |
|||
@GetMapping(value = "/listType") |
|||
public AjaxResult listType(){ |
|||
return AjaxResult.success(typeService.queryList()); |
|||
} |
|||
|
|||
//@TokenCheck
|
|||
@ApiOperation(value="查询banner列表") |
|||
@GetMapping(value = "/listBanner") |
|||
public AjaxResult listBanner(){ |
|||
return AjaxResult.success(bannerService.queryList("0")); |
|||
} |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
package com.bnyer.img.controller; |
|||
|
|||
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.VerifyLog; |
|||
import com.bnyer.img.dto.VerifyPageDto; |
|||
import com.bnyer.img.service.VerifyLogService; |
|||
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.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Api(value = "img-verifyLog-【后端】审核记录接口",tags = "img-verifyLog-【后端】审核记录接口") |
|||
@RestController |
|||
@RequestMapping("/img/verifyLog") |
|||
@Slf4j |
|||
public class VerifyLogController extends BaseController { |
|||
|
|||
@Autowired |
|||
private VerifyLogService verifyLogService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询审核记录分页") |
|||
@PostMapping("/page") |
|||
public TableDataInfo pageVerifyLog(@RequestBody @ApiParam("分页对象") VerifyPageDto dto){ |
|||
startPage(); |
|||
List<VerifyLog> verifyLogs = verifyLogService.queryPage(dto); |
|||
return getDataTable(verifyLogs); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="删除审核记录") |
|||
@DeleteMapping(value = "/delete/{ids}") |
|||
public AjaxResult deleteVerifyLog(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("删除审核记录参数为:{}", ids); |
|||
return AjaxResult.success(verifyLogService.delete(ids)); |
|||
} |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
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 com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/31 9:38 |
|||
*/ |
|||
/** |
|||
* 图文平台审核记录表 |
|||
*/ |
|||
@ApiModel(value="com-bnyer-img-domain-VerifyLog") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_verify_log") |
|||
public class VerifyLog implements Serializable { |
|||
/** |
|||
* 主键id |
|||
*/ |
|||
@TableId(value = "id", type = IdType.INPUT) |
|||
@ApiModelProperty(value="主键id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 艺术家id |
|||
*/ |
|||
@TableField(value = "creator_id") |
|||
@ApiModelProperty(value="艺术家id") |
|||
private Long creatorId; |
|||
|
|||
/** |
|||
* 管理员id |
|||
*/ |
|||
@TableField(value = "admin_id") |
|||
@ApiModelProperty(value="管理员id") |
|||
private Long adminId; |
|||
|
|||
/** |
|||
* 审核原因 |
|||
*/ |
|||
@TableField(value = "reason") |
|||
@ApiModelProperty(value="审核原因") |
|||
private String reason; |
|||
|
|||
/** |
|||
* 审核状态(0->不通过;1->通过) |
|||
*/ |
|||
@TableField(value = "`status`") |
|||
@ApiModelProperty(value="审核状态(0->不通过;1->通过)") |
|||
private String status; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@TableField(value = "create_time") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty(value="创建时间") |
|||
private Date createTime; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
@TableField(value = "update_time") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty(value="更新时间") |
|||
private Date updateTime; |
|||
|
|||
/** |
|||
* 是否显示 (0->隐藏;1->显示) |
|||
*/ |
|||
@TableField(value = "is_show") |
|||
@ApiModelProperty(value="是否显示 (0->隐藏;1->显示)") |
|||
private String isShow; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/31 9:43 |
|||
*/ |
|||
@Getter |
|||
@Setter |
|||
@ApiModel("审核接收类") |
|||
public class VerifyDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="主键") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="管理员id") |
|||
private Long adminId; |
|||
|
|||
@ApiModelProperty(value="审核原因") |
|||
private String reason; |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("审核记录分页接收类") |
|||
public class VerifyPageDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="审核状态") |
|||
private String status; |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.bnyer.img.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.bnyer.img.domain.VerifyLog; |
|||
import com.bnyer.img.vo.VerifyLogVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/31 9:38 |
|||
*/ |
|||
@Mapper |
|||
public interface VerifyLogMapper extends BaseMapper<VerifyLog> { |
|||
|
|||
/** |
|||
* 根据艺术家id查询审核状态记录 |
|||
* @param creatorId 艺术家id |
|||
* @return - |
|||
*/ |
|||
VerifyLogVo queryVerifyStatus(Long creatorId); |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.bnyer.img.domain.VerifyLog; |
|||
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 VerifyLogService { |
|||
|
|||
/** |
|||
* 查询审核记录分页 |
|||
* @param params 分页参数 |
|||
* @return - |
|||
*/ |
|||
List<VerifyLog> queryPage(VerifyPageDto params); |
|||
|
|||
/** |
|||
* 删除记录 |
|||
* @param ids 主键ids |
|||
* @return - |
|||
*/ |
|||
int delete(List<Long> ids); |
|||
|
|||
/** |
|||
* 根据艺术家id查询审核状态记录 |
|||
* @param creatorId 艺术家id |
|||
* @return - |
|||
*/ |
|||
VerifyLogVo queryVerifyStatus(Long creatorId); |
|||
} |
|||
@ -0,0 +1,64 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import com.bnyer.common.core.exception.ServiceException; |
|||
import com.bnyer.common.core.utils.Sm4Util; |
|||
import com.bnyer.common.core.utils.StringUtils; |
|||
import com.bnyer.common.redis.service.RedisService; |
|||
import com.bnyer.img.constants.RedisKeyConstant; |
|||
import com.bnyer.img.constants.TiktokConstant; |
|||
import com.bnyer.img.domain.Creator; |
|||
import com.bnyer.img.domain.TiktokImg; |
|||
import com.bnyer.img.domain.VerifyLog; |
|||
import com.bnyer.img.dto.CreatorDto; |
|||
import com.bnyer.img.dto.CreatorPageDto; |
|||
import com.bnyer.img.dto.VerifyDto; |
|||
import com.bnyer.img.dto.VerifyPageDto; |
|||
import com.bnyer.img.mapper.CreatorMapper; |
|||
import com.bnyer.img.mapper.TiktokImgMapper; |
|||
import com.bnyer.img.mapper.VerifyLogMapper; |
|||
import com.bnyer.img.service.CreatorService; |
|||
import com.bnyer.img.service.VerifyLogService; |
|||
import com.bnyer.img.vo.CreatorVo; |
|||
import com.bnyer.img.vo.VerifyLogVo; |
|||
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; |
|||
import java.util.concurrent.TimeUnit; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/5/30 16:46 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class VerifyLogServiceImpl implements VerifyLogService { |
|||
|
|||
@Autowired |
|||
private VerifyLogMapper verifyLogMapper; |
|||
|
|||
|
|||
@Override |
|||
public List<VerifyLog> queryPage(VerifyPageDto params) { |
|||
LambdaQueryWrapper<VerifyLog> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(params.getStatus()),VerifyLog::getStatus,params.getStatus()); |
|||
return verifyLogMapper.selectList(wrapper); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int delete(List<Long> ids) { |
|||
return verifyLogMapper.deleteBatchIds(ids); |
|||
} |
|||
|
|||
@Override |
|||
public VerifyLogVo queryVerifyStatus(Long creatorId) { |
|||
return verifyLogMapper.queryVerifyStatus(creatorId); |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.bnyer.img.vo; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("审核响应体") |
|||
public class VerifyLogVo implements Serializable { |
|||
@ApiModelProperty(value="id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="审核原因") |
|||
private String reason; |
|||
|
|||
@ApiModelProperty(value="审核状态(0->不通过;1->通过)") |
|||
private String status; |
|||
|
|||
@ApiModelProperty(value="艺术家姓名") |
|||
private String creatorName; |
|||
|
|||
@ApiModelProperty(value="审核时间") |
|||
private String 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.VerifyLogMapper"> |
|||
<resultMap id="BaseResultMap" type="com.bnyer.img.domain.VerifyLog"> |
|||
<!--@mbg.generated--> |
|||
<!--@Table img_verify_log--> |
|||
<id column="id" jdbcType="BIGINT" property="id" /> |
|||
<result column="creator_id" jdbcType="BIGINT" property="creatorId" /> |
|||
<result column="admin_id" jdbcType="BIGINT" property="adminId" /> |
|||
<result column="reason" jdbcType="VARCHAR" property="reason" /> |
|||
<result column="status" jdbcType="CHAR" property="status" /> |
|||
<result column="is_show" jdbcType="CHAR" property="isShow" /> |
|||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
|||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
|||
</resultMap> |
|||
<sql id="Base_Column_List"> |
|||
<!--@mbg.generated--> |
|||
id, creator_id, admin_id, reason, `status`, is_show, create_time, update_time |
|||
</sql> |
|||
|
|||
<select id="queryVerifyStatus" resultType="com.bnyer.img.vo.VerifyLogVo"> |
|||
select |
|||
ic.name as creatorName, |
|||
ivl.id as id,ivl.reason as reason,ivl.status as status,ivl.create_time as createTime |
|||
from img_verify_log ivl |
|||
join img_creator ic on ivl.creator_id = ic.id |
|||
where ic.id = #{creatorId} |
|||
</select> |
|||
</mapper> |
|||
Loading…
Reference in new issue