32 changed files with 902 additions and 46 deletions
@ -0,0 +1,9 @@ |
|||
package com.bnyer.img.constants; |
|||
|
|||
public class RedisKeyConstant { |
|||
|
|||
/** |
|||
* 小程序用户图片首页键 |
|||
*/ |
|||
public static final String TIKTOK_USER_IMG_KEY = "bnyer.tiktok.userImg"; |
|||
} |
|||
@ -1,17 +1,71 @@ |
|||
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.common.security.annotation.RequiresPermissions; |
|||
import com.bnyer.img.domain.Banner; |
|||
import com.bnyer.img.dto.BannerDto; |
|||
import com.bnyer.img.dto.BannerPageDto; |
|||
import com.bnyer.img.service.BannerService; |
|||
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.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Api("img-banner-【后端】接口") |
|||
@RestController |
|||
@RequestMapping("/banner") |
|||
@Slf4j |
|||
public class BannerController extends BaseController { |
|||
|
|||
@Autowired |
|||
private BannerService bannerService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询banner分页") |
|||
@PostMapping("/page") |
|||
public TableDataInfo list(BannerPageDto dto){ |
|||
startPage(); |
|||
List<Banner> banners = bannerService.queryPage(dto); |
|||
return getDataTable(banners); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="新增banner") |
|||
@PostMapping(value = "/insert") |
|||
public AjaxResult insert(@Validated @RequestBody @ApiParam("banner对象")BannerDto dto){ |
|||
log.debug("新增banner参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(bannerService.insert(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="修改banner") |
|||
@PostMapping(value = "/update") |
|||
public AjaxResult update(@Validated @RequestBody @ApiParam("banner对象")BannerDto dto){ |
|||
log.debug("修改banner参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(bannerService.update(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="删除banner") |
|||
@DeleteMapping(value = "/delete/{ids}") |
|||
public AjaxResult delete(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("删除banner参数为:{}", JSON.toJSONString(ids)); |
|||
return AjaxResult.success(bannerService.delete(ids)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询banner详情") |
|||
@GetMapping(value = "/details/{id}") |
|||
public AjaxResult details(@PathVariable @ApiParam("主键id") Long id){ |
|||
log.debug("查询banner详情参数为:{}", id); |
|||
return AjaxResult.success(bannerService.queryDetails(id)); |
|||
} |
|||
} |
|||
|
|||
@ -1,17 +1,64 @@ |
|||
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.Banner; |
|||
import com.bnyer.img.domain.Feedback; |
|||
import com.bnyer.img.dto.BannerDto; |
|||
import com.bnyer.img.dto.BannerPageDto; |
|||
import com.bnyer.img.dto.FeedBackDto; |
|||
import com.bnyer.img.service.FeedBackService; |
|||
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.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
@Api("img-feedback-【后端】接口") |
|||
import java.util.List; |
|||
|
|||
@Api("img-feedback-【后端】反馈接口") |
|||
@RestController |
|||
@RequestMapping("/feedback") |
|||
@Slf4j |
|||
public class FeedBackController extends BaseController { |
|||
|
|||
@Autowired |
|||
private FeedBackService feedBackService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询feedback分页") |
|||
@PostMapping("/page") |
|||
public TableDataInfo list(){ |
|||
startPage(); |
|||
List<Feedback> feedback = feedBackService.queryPage("0"); |
|||
return getDataTable(feedback); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="修改feedback") |
|||
@PostMapping(value = "/update") |
|||
public AjaxResult update(@Validated @RequestBody @ApiParam("feedback对象") FeedBackDto dto){ |
|||
log.debug("修改feedback参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(feedBackService.update(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="删除feedback") |
|||
@DeleteMapping(value = "/delete/{ids}") |
|||
public AjaxResult delete(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("删除feedback参数为:{}", JSON.toJSONString(ids)); |
|||
return AjaxResult.success(feedBackService.delete(ids)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询feedback详情") |
|||
@GetMapping(value = "/details/{id}") |
|||
public AjaxResult details(@PathVariable @ApiParam("主键ids") Long id){ |
|||
log.debug("查询feedback详情参数为:{}", id); |
|||
return AjaxResult.success(feedBackService.queryDetails(id)); |
|||
} |
|||
} |
|||
|
|||
@ -1,17 +1,70 @@ |
|||
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.TiktokImg; |
|||
import com.bnyer.img.dto.TiktokImgDto; |
|||
import com.bnyer.img.dto.TiktokImgPageDto; |
|||
import com.bnyer.img.service.TiktokImgService; |
|||
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.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
@Api("img-tiktokImg-【后端】接口") |
|||
import java.util.List; |
|||
|
|||
@Api("img-tiktokImg-【后端】抖音图片接口") |
|||
@RestController |
|||
@RequestMapping("/tiktokImg") |
|||
@Slf4j |
|||
public class TiktokImgController extends BaseController { |
|||
|
|||
@Autowired |
|||
private TiktokImgService tiktokImgService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询TiktokImg分页") |
|||
@PostMapping("/page") |
|||
public TableDataInfo list(TiktokImgPageDto dto){ |
|||
startPage(); |
|||
List<TiktokImg> tiktokImg = tiktokImgService.queryPage(dto); |
|||
return getDataTable(tiktokImg); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="新增TiktokImg") |
|||
@PostMapping(value = "/insert") |
|||
public AjaxResult insert(@Validated @RequestBody @ApiParam("TiktokImg对象") TiktokImgDto dto){ |
|||
log.debug("后台管理系统新增TiktokImg参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(tiktokImgService.insert(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="修改TiktokImg") |
|||
@PostMapping(value = "/update") |
|||
public AjaxResult update(@Validated @RequestBody @ApiParam("TiktokImg对象") TiktokImgDto dto){ |
|||
log.debug("后台管理系统修改TiktokImg参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(tiktokImgService.update(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="删除TiktokImg") |
|||
@DeleteMapping(value = "/delete/{ids}") |
|||
public AjaxResult delete(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("后台管理系统删除TiktokImg参数为:{}", ids); |
|||
return AjaxResult.success(tiktokImgService.delete(ids)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询TiktokImg详情") |
|||
@GetMapping(value = "/details/{id}") |
|||
public AjaxResult details(@PathVariable @ApiParam("主键id") Long id){ |
|||
log.debug("查询TiktokImg详情参数为:{}", id); |
|||
return AjaxResult.success(tiktokImgService.queryDetails(id)); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,110 @@ |
|||
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.Feedback; |
|||
import com.bnyer.img.domain.TiktokImg; |
|||
import com.bnyer.img.dto.*; |
|||
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("img-抖音平台-【小程序】接口") |
|||
@RestController |
|||
@RequestMapping("/tiktok") |
|||
@Slf4j |
|||
public class TiktokMiniController extends BaseController { |
|||
|
|||
@Autowired |
|||
private BannerService bannerService; |
|||
|
|||
@Autowired |
|||
private FeedBackService feedBackService; |
|||
|
|||
@Autowired |
|||
private TypeService typeService; |
|||
|
|||
@Autowired |
|||
private TiktokImgService tiktokImgService; |
|||
|
|||
@Autowired |
|||
private TiktokUserService tiktokUserService; |
|||
|
|||
@ApiOperation(value="查询banner列表") |
|||
@GetMapping(value = "/listBanner") |
|||
public AjaxResult listBanner(){ |
|||
return AjaxResult.success(bannerService.queryList("1")); |
|||
} |
|||
|
|||
@ApiOperation(value="新增feedback") |
|||
@PostMapping(value = "/insertFeedback") |
|||
public AjaxResult insertFeedback(@Validated @RequestBody @ApiParam("feedback对象") FeedBackDto dto){ |
|||
log.debug("新增feedback参数为:{}", JSON.toJSONString(dto)); |
|||
Feedback feedback = dto.extractParam(); |
|||
feedback.setSource("0"); |
|||
return AjaxResult.success(feedBackService.insert(feedback)); |
|||
} |
|||
|
|||
@ApiOperation(value="查询type列表") |
|||
@GetMapping(value = "/listType") |
|||
public AjaxResult listType(){ |
|||
return AjaxResult.success(typeService.queryList()); |
|||
} |
|||
|
|||
@ApiOperation(value="新增TiktokImg") |
|||
@PostMapping(value = "/insertTiktokImg") |
|||
public AjaxResult insertTiktokImg(@Validated @RequestBody @ApiParam("TiktokImg对象") TiktokImgMiniDto dto){ |
|||
log.debug("抖音小程序端用户【{}】新增TiktokImg参数为:{}",dto.getUserId(),JSON.toJSONString(dto)); |
|||
TiktokImg tiktokImg = dto.extractParam(); |
|||
tiktokImg.setStatus("0"); |
|||
return AjaxResult.success(tiktokImgService.insert(tiktokImg)); |
|||
} |
|||
|
|||
@ApiOperation(value="修改TiktokImg") |
|||
@PostMapping(value = "/updateTiktokImg") |
|||
public AjaxResult updateTiktokImg(@Validated @RequestBody @ApiParam("TiktokImg对象") TiktokImgMiniDto dto){ |
|||
log.debug("抖音小程序端用户【{}】修改TiktokImg参数为:{}",dto.getUserId(), JSON.toJSONString(dto)); |
|||
TiktokImg tiktokImg = dto.extractParam(); |
|||
tiktokImg.setStatus("0"); |
|||
return AjaxResult.success(tiktokImgService.update(dto.extractParam())); |
|||
} |
|||
|
|||
@ApiOperation(value="删除TiktokImg") |
|||
@DeleteMapping(value = "/deleteTiktokImg/{ids}") |
|||
public AjaxResult deleteTiktokImg(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("抖音小程序端删除TiktokImg参数为:{}", ids); |
|||
return AjaxResult.success(tiktokImgService.delete(ids)); |
|||
} |
|||
|
|||
@ApiOperation(value="查询指定用户对内的图片集合") |
|||
@PostMapping(value = "/listTiktokImgIn") |
|||
public AjaxResult listTiktokImgIn(@Validated @RequestBody @ApiParam("TiktokImg对象") TiktokImgListMiniDto dto){ |
|||
return AjaxResult.success(tiktokImgService.queryInList(dto.getUserId(),dto.getTypeId())); |
|||
} |
|||
|
|||
@ApiOperation(value="查询指定用户对外的图片集合") |
|||
@PostMapping(value = "/listTiktokImgOut") |
|||
public AjaxResult listTiktokImgOut(@Validated @RequestBody @ApiParam("TiktokImg对象") TiktokImgListMiniDto dto){ |
|||
return AjaxResult.success(tiktokImgService.queryOutList(dto.getUserId(),dto.getTypeId())); |
|||
} |
|||
|
|||
@ApiOperation(value="查询小程序审核通过图片详情") |
|||
@GetMapping(value = "/detailsTiktokImg/{id}") |
|||
public AjaxResult detailsTiktokImg(@ApiParam("图片id") @PathVariable Long id){ |
|||
return AjaxResult.success(tiktokImgService.queryImgDetails(String.valueOf(id))); |
|||
} |
|||
|
|||
@ApiOperation(value="查询小程序用户图片列表") |
|||
@GetMapping(value = "/tiktokUserImgs") |
|||
public AjaxResult tiktokUserImgs(){ |
|||
return AjaxResult.success(tiktokUserService.queryUserImgList()); |
|||
} |
|||
} |
|||
@ -1,17 +1,69 @@ |
|||
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.TiktokUser; |
|||
import com.bnyer.img.dto.TiktokUserDto; |
|||
import com.bnyer.img.dto.TiktokUserPageDto; |
|||
import com.bnyer.img.service.TiktokUserService; |
|||
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.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
@Api("img-tiktokUser-【后端】接口") |
|||
import java.util.List; |
|||
|
|||
@Api("img-tiktokUser-【后端】抖音平台用户接口") |
|||
@RestController |
|||
@RequestMapping("/tiktokUser") |
|||
@Slf4j |
|||
public class TiktokUserController extends BaseController { |
|||
|
|||
@Autowired |
|||
private TiktokUserService tiktokUserService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询user分页") |
|||
@PostMapping("/page") |
|||
public TableDataInfo list(TiktokUserPageDto dto){ |
|||
startPage(); |
|||
List<TiktokUser> tiktokUsers = tiktokUserService.queryPage(dto); |
|||
return getDataTable(tiktokUsers); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="新增user") |
|||
@PostMapping(value = "/insert") |
|||
public AjaxResult insert(@Validated @RequestBody @ApiParam("user对象") TiktokUserDto dto){ |
|||
log.debug("新增user参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(tiktokUserService.insert(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="修改user") |
|||
@PostMapping(value = "/update") |
|||
public AjaxResult update(@Validated @RequestBody @ApiParam("user对象") TiktokUserDto dto){ |
|||
log.debug("修改user参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(tiktokUserService.update(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="删除user") |
|||
@DeleteMapping(value = "/delete/{ids}") |
|||
public AjaxResult delete(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("删除user参数为:{}", ids); |
|||
return AjaxResult.success(tiktokUserService.delete(ids)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询user详情") |
|||
@GetMapping(value = "/details/{id}") |
|||
public AjaxResult details(@PathVariable @ApiParam("主键id") Long id){ |
|||
return AjaxResult.success(tiktokUserService.queryDetails(id)); |
|||
} |
|||
} |
|||
|
|||
@ -1,17 +1,70 @@ |
|||
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.Type; |
|||
import com.bnyer.img.dto.TypeDto; |
|||
import com.bnyer.img.dto.TypePageDto; |
|||
import com.bnyer.img.service.TypeService; |
|||
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.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
@Api("img-banner-【后端】接口") |
|||
import java.util.List; |
|||
|
|||
@Api("img-type-【后端】图片类型接口") |
|||
@RestController |
|||
@RequestMapping("/type") |
|||
@Slf4j |
|||
public class TypeController extends BaseController { |
|||
|
|||
@Autowired |
|||
private TypeService typeService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询type分页") |
|||
@PostMapping("/page") |
|||
public TableDataInfo list(TypePageDto dto){ |
|||
startPage(); |
|||
List<Type> types = typeService.queryPage(dto.getTypeName()); |
|||
return getDataTable(types); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="新增type") |
|||
@PostMapping(value = "/insert") |
|||
public AjaxResult insert(@Validated @RequestBody @ApiParam("type对象") TypeDto dto){ |
|||
log.debug("新增type参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(typeService.insert(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="修改type") |
|||
@PostMapping(value = "/update") |
|||
public AjaxResult update(@Validated @RequestBody @ApiParam("type对象") TypeDto dto){ |
|||
log.debug("修改type参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(typeService.update(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="删除type") |
|||
@DeleteMapping(value = "/delete/{ids}") |
|||
public AjaxResult delete(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("删除type参数为:{}", ids); |
|||
return AjaxResult.success(typeService.delete(ids)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询type详情") |
|||
@GetMapping(value = "/details/{id}") |
|||
public AjaxResult details(@PathVariable @ApiParam("主键id") Long id){ |
|||
log.debug("查询type详情参数为:{}", id); |
|||
return AjaxResult.success(typeService.queryDetails(id)); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,21 @@ |
|||
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("banner响应类") |
|||
public class BannerPageDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="banner名称") |
|||
private String bannerName; |
|||
|
|||
@ApiModelProperty(value="平台渠道") |
|||
private String source; |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.bnyer.common.core.utils.bean.BeanUtils; |
|||
import com.bnyer.img.domain.Feedback; |
|||
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("feedback接收类") |
|||
public class FeedBackDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="主键Id") |
|||
private Long id; |
|||
|
|||
@NotNull(message = "反馈信息不能为空!") |
|||
@ApiModelProperty(value="反馈信息") |
|||
private String info; |
|||
|
|||
public Feedback extractParam(){ |
|||
Feedback feedback = new Feedback(); |
|||
BeanUtils.copyProperties(this,feedback); |
|||
return feedback; |
|||
} |
|||
} |
|||
@ -1,27 +1,51 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.bnyer.common.core.utils.bean.BeanUtils; |
|||
import com.bnyer.img.domain.TiktokImg; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
import org.apache.poi.ss.formula.functions.T; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("抖音图片响应类") |
|||
@ApiModel("抖音图片接收类") |
|||
public class TiktokImgDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="图片地址") |
|||
private String imgUrl; |
|||
|
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@ApiModelProperty(value="分类id") |
|||
private Long typeId; |
|||
|
|||
@ApiModelProperty(value="下载量") |
|||
private Integer downloadNum; |
|||
|
|||
@ApiModelProperty(value="点赞量") |
|||
private Integer greatNum; |
|||
|
|||
@ApiModelProperty(value="收藏量") |
|||
private Integer collectionNum; |
|||
|
|||
@ApiModelProperty(value="状态(0->待审核;1->审核通过;2->审核拒绝)") |
|||
private String status; |
|||
|
|||
@ApiModelProperty(value="是否热门(0->冷门;1->热门)") |
|||
private String isHot; |
|||
|
|||
public TiktokImg extractParam(){ |
|||
TiktokImg tiktokImg = new TiktokImg(); |
|||
BeanUtils.copyProperties(this,tiktokImg); |
|||
return tiktokImg; |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,23 @@ |
|||
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 TiktokImgListMiniDto implements Serializable { |
|||
|
|||
@NotNull(message = "用户id不能为空") |
|||
@ApiModelProperty(value="用户id") |
|||
private String userId; |
|||
|
|||
@ApiModelProperty(value="分类id") |
|||
private String typeId; |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.bnyer.common.core.utils.bean.BeanUtils; |
|||
import com.bnyer.img.domain.TiktokImg; |
|||
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 TiktokImgMiniDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="图片地址") |
|||
private String imgUrl; |
|||
|
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@ApiModelProperty(value="分类id") |
|||
private Long typeId; |
|||
|
|||
public TiktokImg extractParam(){ |
|||
TiktokImg tiktokImg = new TiktokImg(); |
|||
BeanUtils.copyProperties(this,tiktokImg); |
|||
return tiktokImg; |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.*; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("抖音图片接收类") |
|||
public class TiktokImgPageDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@ApiModelProperty(value="分类id") |
|||
private Long typeId; |
|||
|
|||
@ApiModelProperty(value="状态(0->待审核;1->审核通过;2->审核拒绝)") |
|||
private String status; |
|||
|
|||
@ApiModelProperty(value="是否热门(0->冷门;1->热门)") |
|||
private String isHot; |
|||
} |
|||
@ -1,33 +1,62 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.bnyer.common.core.utils.bean.BeanUtils; |
|||
import com.bnyer.img.domain.TiktokUser; |
|||
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("抖音用户响应类") |
|||
@ApiModel("抖音用户接收类") |
|||
public class TiktokUserDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="id") |
|||
private Long id; |
|||
|
|||
@NotNull(message = "用户昵称不能为空!") |
|||
@ApiModelProperty(value="用户昵称") |
|||
private String username; |
|||
|
|||
@NotNull(message = "抖音id不能为空!") |
|||
@ApiModelProperty(value="抖音id") |
|||
private String tiktokCode; |
|||
|
|||
@NotNull(message = "抖音号不能为空!") |
|||
@ApiModelProperty(value="抖音号") |
|||
private String tiktokNumber; |
|||
|
|||
@NotNull(message = "手机号不能为空!") |
|||
@ApiModelProperty(value="手机号") |
|||
private String phone; |
|||
|
|||
@NotNull(message = "搜索码不能为空!") |
|||
@ApiModelProperty(value="搜索码") |
|||
private String scanCode; |
|||
|
|||
@NotNull(message = "邀请码不能为空!") |
|||
@ApiModelProperty(value="邀请码") |
|||
private String inviteCode; |
|||
|
|||
@ApiModelProperty(value="个人简介") |
|||
private String intro; |
|||
|
|||
@NotNull(message = "头像地址不能为空!") |
|||
@ApiModelProperty(value="头像img地址") |
|||
private String img; |
|||
|
|||
@NotNull(message = "是否活跃不能为空!") |
|||
@ApiModelProperty(value="是否活跃(0->不活跃;1->活跃 连续10天以上更新内容)") |
|||
private String isHot; |
|||
|
|||
public TiktokUser extractParam(){ |
|||
TiktokUser tiktokUser = new TiktokUser(); |
|||
BeanUtils.copyProperties(this, tiktokUser); |
|||
return tiktokUser; |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,36 @@ |
|||
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 TiktokUserPageDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="用户昵称") |
|||
private String username; |
|||
|
|||
@ApiModelProperty(value="抖音号") |
|||
private String tiktokNumber; |
|||
|
|||
@ApiModelProperty(value="手机号") |
|||
private String phone; |
|||
|
|||
@ApiModelProperty(value="搜索码") |
|||
private String scanCode; |
|||
|
|||
@ApiModelProperty(value="邀请码") |
|||
private String inviteCode; |
|||
|
|||
@ApiModelProperty(value="是否活跃(0->不活跃;1->活跃 连续10天以上更新内容)") |
|||
private String isHot; |
|||
|
|||
@ApiModelProperty(value="是否展示") |
|||
private String isShow; |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.bnyer.common.core.utils.bean.BeanUtils; |
|||
import com.bnyer.img.domain.Type; |
|||
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("type接收类") |
|||
public class TypeDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="主键") |
|||
private Long id; |
|||
|
|||
@NotNull(message = "分类名称不能为空!") |
|||
@ApiModelProperty(value="分类名称") |
|||
private String typeName; |
|||
|
|||
public Type extractParam(){ |
|||
Type type = new Type(); |
|||
BeanUtils.copyProperties(this,type); |
|||
return type; |
|||
} |
|||
} |
|||
@ -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("type分页接收类") |
|||
public class TypePageDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="分类名称") |
|||
private String typeName; |
|||
} |
|||
@ -1,10 +1,88 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.alibaba.fastjson.TypeReference; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.bnyer.common.core.utils.StringUtils; |
|||
import com.bnyer.common.redis.service.RedisService; |
|||
import com.bnyer.img.constants.RedisKeyConstant; |
|||
import com.bnyer.img.domain.TiktokImg; |
|||
import com.bnyer.img.domain.TiktokUser; |
|||
import com.bnyer.img.dto.TiktokUserPageDto; |
|||
import com.bnyer.img.mapper.TiktokImgMapper; |
|||
import com.bnyer.img.mapper.TiktokUserMapper; |
|||
import com.bnyer.img.service.TiktokUserService; |
|||
import com.bnyer.img.vo.TiktokUserVo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.concurrent.TimeUnit; |
|||
|
|||
@Service |
|||
@Slf4j |
|||
public class TiktokUserServiceImpl implements TiktokUserService { |
|||
|
|||
@Autowired |
|||
private TiktokUserMapper tiktokUserMapper; |
|||
|
|||
@Autowired |
|||
private RedisService redisService; |
|||
|
|||
@Autowired |
|||
private TiktokImgMapper tiktokImgMapper; |
|||
|
|||
@Override |
|||
public int insert(TiktokUser tiktokUser) { |
|||
return 0; |
|||
} |
|||
|
|||
@Override |
|||
public int update(TiktokUser tiktokUser) { |
|||
return 0; |
|||
} |
|||
|
|||
@Override |
|||
public int delete(List<Long> ids) { |
|||
int delete = tiktokUserMapper.deleteBatchIds(ids); |
|||
//删除对应用户图片
|
|||
LambdaQueryWrapper<TiktokImg> wrapper = new LambdaQueryWrapper<>(); |
|||
for (Long id : ids) { |
|||
wrapper.eq(TiktokImg::getUserId,id); |
|||
tiktokImgMapper.delete(wrapper); |
|||
} |
|||
return delete; |
|||
} |
|||
|
|||
@Override |
|||
public List<TiktokUser> queryPage(TiktokUserPageDto dto) { |
|||
LambdaQueryWrapper<TiktokUser> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.like(StringUtils.isNotNull(dto.getUsername()), TiktokUser::getUsername, dto.getUsername()); |
|||
wrapper.eq(StringUtils.isNotNull(dto.getPhone()),TiktokUser::getPhone, dto.getPhone()); |
|||
wrapper.eq(StringUtils.isNotNull(dto.getTiktokNumber()), TiktokUser::getTiktokNumber, dto.getTiktokNumber()); |
|||
wrapper.eq(StringUtils.isNotNull(dto.getScanCode()), TiktokUser::getScanCode, dto.getScanCode()); |
|||
wrapper.eq(StringUtils.isNotNull(dto.getInviteCode()), TiktokUser::getInviteCode, dto.getInviteCode()); |
|||
wrapper.eq(StringUtils.isNotNull(dto.getIsHot()), TiktokUser::getIsHot, dto.getIsHot()); |
|||
wrapper.eq(StringUtils.isNotNull(dto.getIsShow()), TiktokUser::getIsShow, dto.getIsShow()); |
|||
return tiktokUserMapper.selectList(wrapper); |
|||
} |
|||
|
|||
@Override |
|||
public TiktokUser queryDetails(Long id) { |
|||
return tiktokUserMapper.selectById(id); |
|||
} |
|||
|
|||
@Override |
|||
public List<TiktokUserVo> queryUserImgList() { |
|||
//走缓存
|
|||
String redisKey = RedisKeyConstant.TIKTOK_USER_IMG_KEY; |
|||
if(redisService.hasKey(redisKey)){ |
|||
return JSONObject.parseArray(redisService.getCacheObject(redisKey).toString(), TiktokUserVo.class); |
|||
} |
|||
List<TiktokUserVo> tiktokUserVo = tiktokUserMapper.queryThreeImgUserList(); |
|||
redisService.setCacheObject(redisKey,tiktokUserVo,3600L, TimeUnit.SECONDS); |
|||
return tiktokUserVo; |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue