Compare commits
23 Commits
master
...
feature-1.
| Author | SHA1 | Date |
|---|---|---|
|
|
133cd56564 | 3 years ago |
|
|
c175874522 | 3 years ago |
|
|
b941ad440f | 3 years ago |
|
|
3a8b1f39e4 | 3 years ago |
|
|
34654e83f5 | 3 years ago |
|
|
1ae110efb7 | 4 years ago |
|
|
6bd84e9226 | 4 years ago |
|
|
94bdb9282f | 4 years ago |
|
|
fefc9503a8 | 4 years ago |
|
|
d18fda470e | 4 years ago |
|
|
7e85281205 | 4 years ago |
|
|
b38da16520 | 4 years ago |
|
|
959c0d137b | 4 years ago |
|
|
c0da69c21a | 4 years ago |
|
|
a02db2e7c1 | 4 years ago |
|
|
bf7a78b680 | 4 years ago |
|
|
d2151461c7 | 4 years ago |
|
|
86fbb507df | 4 years ago |
|
|
a803227125 | 4 years ago |
|
|
fb08179727 | 4 years ago |
|
|
ba3758897d | 4 years ago |
|
|
a5b2154104 | 4 years ago |
|
|
c4e7966ea0 | 4 years ago |
113 changed files with 3731 additions and 151 deletions
@ -0,0 +1,34 @@ |
|||
package com.bnyer.img.config; |
|||
|
|||
import lombok.Getter; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.boot.context.properties.ConfigurationProperties; |
|||
import org.springframework.cloud.context.config.annotation.RefreshScope; |
|||
import org.springframework.context.annotation.Configuration; |
|||
|
|||
/** |
|||
* 云媒配置类 |
|||
* @author chengkun |
|||
* @date 2022/4/21 17:43 |
|||
*/ |
|||
@Configuration |
|||
@ConfigurationProperties(prefix = "yunmei") |
|||
@Getter |
|||
@RefreshScope |
|||
public class YunmeiConfig { |
|||
|
|||
@Value("${yunmei.appId}") |
|||
public String appId; |
|||
|
|||
@Value("${yunmei.appSecret}") |
|||
public String appSecret; |
|||
|
|||
@Value("${yunmei.url}") |
|||
public String url; |
|||
|
|||
@Value("${yunmei.version}") |
|||
public String version; |
|||
|
|||
@Value("${yunmei.notifyUrl}") |
|||
public String notifyUrl; |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package com.bnyer.img.constants; |
|||
|
|||
/** |
|||
* 用户会员vip支付常量 |
|||
* @author chengkun |
|||
* @date 2022/4/21 18:12 |
|||
*/ |
|||
public class UserVipOrderStatusConstant { |
|||
|
|||
/** |
|||
* 待支付 |
|||
*/ |
|||
public static final String UN_PAY = "0"; |
|||
|
|||
/** |
|||
* 已支付 |
|||
*/ |
|||
public static final String PAYED = "1"; |
|||
|
|||
/** |
|||
* 支付失败 |
|||
*/ |
|||
public static final String PAY_FAIL = "2"; |
|||
|
|||
/** |
|||
* 支付失败 |
|||
*/ |
|||
public static final String PAY_EXCEPTION = "3"; |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.bnyer.img.constants; |
|||
|
|||
/** |
|||
* 用户会员vip常量 |
|||
* @author chengkun |
|||
* @date 2022/4/21 18:12 |
|||
*/ |
|||
public class UserVipTypeConstant { |
|||
|
|||
/** |
|||
* 月卡 |
|||
*/ |
|||
public static final String MONTH_CARD = "0"; |
|||
|
|||
/** |
|||
* 季卡 |
|||
*/ |
|||
public static final String SEASON_CARD = "1"; |
|||
|
|||
/** |
|||
* 年卡 |
|||
*/ |
|||
public static final String YEAR_CARD = "2"; |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
package com.bnyer.img.constants; |
|||
|
|||
/** |
|||
* 云媒敞亮类 |
|||
*/ |
|||
public class YunmeiConstant { |
|||
|
|||
|
|||
/** |
|||
* 商品列表 |
|||
*/ |
|||
public static final String PRODUCT_LIST = "/api/goods/list"; |
|||
|
|||
/** |
|||
* 商品详情 |
|||
*/ |
|||
public static final String PRODUCT_DETAILS = "/api/goods/get"; |
|||
|
|||
/** |
|||
* 直充/卡密下单 |
|||
*/ |
|||
public static final String CREATE_ORDER = "/api/order/create"; |
|||
|
|||
/** |
|||
* 订单查询 |
|||
*/ |
|||
public static final String ORDER_DETAILS = "/api/order/get"; |
|||
|
|||
/** |
|||
* 余额查询 |
|||
*/ |
|||
public static final String AMOUNT = "/api/account/balance"; |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.bnyer.img.controller; |
|||
|
|||
import com.bnyer.common.core.utils.StringUtils; |
|||
import com.bnyer.common.core.web.controller.BaseController; |
|||
import com.bnyer.common.core.web.domain.AjaxResult; |
|||
import com.bnyer.img.service.AlipayService; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
|
|||
@Api(value = "【图文平台】公共接口",tags = "【图文平台】公共接口") |
|||
@RestController |
|||
@RequestMapping("/img/common") |
|||
@Slf4j |
|||
public class CommonController extends BaseController { |
|||
|
|||
@Autowired |
|||
private AlipayService alipayService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value = "支付宝回调通知") |
|||
@PostMapping("/alipayCallback") |
|||
public AjaxResult alipayCallback(@RequestBody HttpServletRequest request) { |
|||
String result = alipayService.alipayCallBack(request); |
|||
if (StringUtils.isNotBlank(result)){ |
|||
return AjaxResult.success(result); |
|||
} |
|||
return AjaxResult.error(); |
|||
} |
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
package com.bnyer.img.controller; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.bnyer.common.core.utils.DesensitizedUtils; |
|||
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.LevelInfo; |
|||
import com.bnyer.img.dto.LevelInfoDto; |
|||
import com.bnyer.img.dto.LevelInfoPageDto; |
|||
import com.bnyer.img.dto.StatusDto; |
|||
import com.bnyer.img.service.LevelInfoService; |
|||
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/levelInfo") |
|||
@Slf4j |
|||
public class LevelInfoController extends BaseController { |
|||
|
|||
@Autowired |
|||
private LevelInfoService levelInfoService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询等级信息分页") |
|||
@PostMapping("/page") |
|||
public TableDataInfo pageLevelInfo(@RequestBody @ApiParam("分页对象") LevelInfoPageDto dto){ |
|||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); |
|||
List<LevelInfo> levelInfos = levelInfoService.queryList(dto); |
|||
return getDataTable(levelInfos); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="新增等级信息") |
|||
@PostMapping(value = "/insert") |
|||
public AjaxResult insertLevelInfo(@Validated @RequestBody @ApiParam("levelInfo对象") LevelInfoDto dto){ |
|||
log.debug("【图文平台后台】新增等级信息参数为:{}", DesensitizedUtils.getJson(dto)); |
|||
return AjaxResult.success(levelInfoService.insert(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="修改等级信息") |
|||
@PostMapping(value = "/update") |
|||
public AjaxResult updateLevelInfo(@Validated @RequestBody @ApiParam("levelInfo对象") LevelInfoDto dto){ |
|||
log.debug("【图文平台后台】修改等级信息参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(levelInfoService.update(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="删除levelInfo") |
|||
@DeleteMapping(value = "/delete/{ids}") |
|||
public AjaxResult deleteLevelInfo(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("【图文平台后台】删除等级信息参数为:{}", JSON.toJSONString(ids)); |
|||
return AjaxResult.success(levelInfoService.delete(ids)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询等级信息详情") |
|||
@GetMapping(value = "/details/{id}") |
|||
public AjaxResult detailsLevelInfo(@PathVariable @ApiParam("主键id") Long id){ |
|||
log.debug("【图文平台后台】查询等级信息详情参数为:{}", id); |
|||
return AjaxResult.success(levelInfoService.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(levelInfoService.changeStatus(dto.getId(),dto.getStatus())); |
|||
} |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
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.Product; |
|||
import com.bnyer.img.dto.ProductDto; |
|||
import com.bnyer.img.dto.ProductPageDto; |
|||
import com.bnyer.img.dto.StatusDto; |
|||
import com.bnyer.img.service.ProductService; |
|||
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/product") |
|||
@Slf4j |
|||
public class ProductController extends BaseController { |
|||
|
|||
@Autowired |
|||
private ProductService productService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询产品分页") |
|||
@PostMapping("/page") |
|||
public TableDataInfo pageProduct(@RequestBody @ApiParam("分页对象") ProductPageDto dto){ |
|||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); |
|||
List<Product> products = productService.queryPage(dto); |
|||
return getDataTable(products); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="新增产品") |
|||
@PostMapping(value = "/insert") |
|||
public AjaxResult insertProduct(@Validated @RequestBody @ApiParam("产品对象") ProductDto dto){ |
|||
log.debug("【图文平台后台】新增产品参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(productService.insert(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="修改产品") |
|||
@PostMapping(value = "/update") |
|||
public AjaxResult updateProduct(@Validated @RequestBody @ApiParam("产品对象")ProductDto dto){ |
|||
log.debug("【图文平台后台】修改产品参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(productService.update(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="删除产品") |
|||
@DeleteMapping(value = "/delete/{ids}") |
|||
public AjaxResult deleteProduct(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("【图文平台后台】删除产品参数为:{}", JSON.toJSONString(ids)); |
|||
return AjaxResult.success(productService.delete(ids)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询产品详情") |
|||
@GetMapping(value = "/details/{id}") |
|||
public AjaxResult detailsProduct(@PathVariable @ApiParam("主键id") Long id){ |
|||
log.debug("【图文平台后台】查询产品详情参数为:{}", id); |
|||
return AjaxResult.success(productService.details(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(productService.changeStatus(dto.getId(),dto.getStatus())); |
|||
} |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
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.UserVip; |
|||
import com.bnyer.img.dto.UserVipDto; |
|||
import com.bnyer.img.dto.UserVipPageDto; |
|||
import com.bnyer.img.dto.StatusDto; |
|||
import com.bnyer.img.service.UserVipService; |
|||
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 = "【图文平台】用户会员vip接口",tags = "【图文平台】用户会员vip接口") |
|||
@RestController |
|||
@RequestMapping("/img/userVip") |
|||
@Slf4j |
|||
public class UserVipController extends BaseController { |
|||
|
|||
@Autowired |
|||
private UserVipService userVipService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询用户会员vip分页") |
|||
@PostMapping("/page") |
|||
public TableDataInfo pageUserVip(@RequestBody @ApiParam("分页对象") UserVipPageDto dto){ |
|||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); |
|||
List<UserVip> userVips = userVipService.queryPage(dto); |
|||
return getDataTable(userVips); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="新增用户会员vip") |
|||
@PostMapping(value = "/insert") |
|||
public AjaxResult insertUserVip(@Validated @RequestBody @ApiParam("用户会员vip对象") UserVipDto dto){ |
|||
log.debug("【图文平台后台】新增用户会员vip参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(userVipService.insert(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="修改用户会员vip") |
|||
@PostMapping(value = "/update") |
|||
public AjaxResult updateUserVip(@Validated @RequestBody @ApiParam("用户会员vip对象")UserVipDto dto){ |
|||
log.debug("【图文平台后台】修改用户会员vip参数为:{}", JSON.toJSONString(dto)); |
|||
return AjaxResult.success(userVipService.update(dto.extractParam())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="删除用户会员vip") |
|||
@DeleteMapping(value = "/delete/{ids}") |
|||
public AjaxResult deleteUserVip(@PathVariable @ApiParam("主键ids") List<Long> ids){ |
|||
log.debug("【图文平台后台】删除用户会员vip参数为:{}", JSON.toJSONString(ids)); |
|||
return AjaxResult.success(userVipService.delete(ids)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询用户会员vip详情") |
|||
@GetMapping(value = "/details/{id}") |
|||
public AjaxResult detailsUserVip(@PathVariable @ApiParam("主键id") Long id){ |
|||
log.debug("【图文平台后台】查询用户会员vip详情参数为:{}", id); |
|||
return AjaxResult.success(userVipService.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(userVipService.changeStatus(dto.getId(),dto.getStatus())); |
|||
} |
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package com.bnyer.img.controller; |
|||
|
|||
import com.bnyer.common.core.web.controller.BaseController; |
|||
import com.bnyer.common.core.web.domain.AjaxResult; |
|||
import com.bnyer.img.dto.CardBuyOrderDto; |
|||
import com.bnyer.img.dto.DirectBuyOrderDto; |
|||
import com.bnyer.img.dto.OrderDetailsDto; |
|||
import com.bnyer.img.dto.OrderNotifyDto; |
|||
import com.bnyer.img.service.YunmeiService; |
|||
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.*; |
|||
|
|||
@Api(value = "【图文平台】云媒影视接口",tags = "【图文平台】云媒影视接口") |
|||
@RestController |
|||
@RequestMapping("/img/yunmei") |
|||
@Slf4j |
|||
public class YunmeiController extends BaseController { |
|||
|
|||
@Autowired |
|||
private YunmeiService yunmeiService; |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询云媒影视产品列表") |
|||
@PostMapping("/list") |
|||
public AjaxResult getProductList(){ |
|||
return AjaxResult.success(yunmeiService.getProductList()); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询云媒影视产品详情") |
|||
@PostMapping("/details/{skuId}") |
|||
public AjaxResult getProductDetails(@ApiParam("商品id") @PathVariable("skuId") Long skuId){ |
|||
return AjaxResult.success(yunmeiService.getProductDetails(skuId)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="直充下单") |
|||
@PostMapping("/directBuy") |
|||
public AjaxResult directBuy(@ApiParam("直充下单参数") @RequestBody DirectBuyOrderDto params){ |
|||
return AjaxResult.success(yunmeiService.directBuyOrder(params)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="卡密下单") |
|||
@PostMapping("/cardBuy") |
|||
public AjaxResult cardBuy(@ApiParam("卡密下单参数") @RequestBody CardBuyOrderDto params){ |
|||
return AjaxResult.success(yunmeiService.cardBuyOrder(params)); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询订单详情") |
|||
@PostMapping("/order/details") |
|||
public AjaxResult getProductDetails(@ApiParam("订单id对象") @RequestBody OrderDetailsDto params){ |
|||
return AjaxResult.success(yunmeiService.getOrderDetails(params.getOrderNo())); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="查询商户余额") |
|||
@PostMapping("/balance") |
|||
public AjaxResult getBalance(){ |
|||
return AjaxResult.success(yunmeiService.getBalance()); |
|||
} |
|||
|
|||
//@RequiresPermissions("system:config:list")
|
|||
@ApiOperation(value="云媒订单回调") |
|||
@PostMapping("/notifyOrder") |
|||
public AjaxResult notifyOrder(@ApiParam("云媒回调参数") @RequestBody OrderNotifyDto params){ |
|||
return AjaxResult.success(yunmeiService.orderNotify(params)); |
|||
} |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
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 java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
import lombok.ToString; |
|||
|
|||
@ApiModel(value="com-bnyer-img-domain-LevelInfo") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_level_info") |
|||
public class LevelInfo extends BaseDomain { |
|||
/** |
|||
* 主键id |
|||
*/ |
|||
@TableId(value = "id", type = IdType.AUTO) |
|||
@ApiModelProperty(value="主键id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 等级头衔名称 |
|||
*/ |
|||
@TableField(value = "title") |
|||
@ApiModelProperty(value="等级头衔名称") |
|||
private String title; |
|||
|
|||
/** |
|||
* 头衔图标 |
|||
*/ |
|||
@TableField(value = "title_icon") |
|||
@ApiModelProperty(value="头衔图标") |
|||
private String titleIcon; |
|||
|
|||
/** |
|||
* 最小经验值 |
|||
*/ |
|||
@TableField(value = "min_exp") |
|||
@ApiModelProperty(value="最小经验值") |
|||
private Integer minExp; |
|||
|
|||
/** |
|||
* 最大经验值 |
|||
*/ |
|||
@TableField(value = "max_exp") |
|||
@ApiModelProperty(value="最大经验值") |
|||
private Integer maxExp; |
|||
|
|||
/** |
|||
* 等级类型(0->用户;1->创作者) |
|||
*/ |
|||
@TableField(value = "type") |
|||
@ApiModelProperty(value="等级类型(0->用户;1->创作者)") |
|||
private String type; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,104 @@ |
|||
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 java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
import lombok.ToString; |
|||
|
|||
@ApiModel(value="com-bnyer-img-domain-Product") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_product") |
|||
public class Product extends BaseDomain { |
|||
/** |
|||
* 主键id |
|||
*/ |
|||
@TableId(value = "id", type = IdType.AUTO) |
|||
@ApiModelProperty(value="主键id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 商品名称 |
|||
*/ |
|||
@TableField(value = "product_name") |
|||
@ApiModelProperty(value="商品名称") |
|||
private String productName; |
|||
|
|||
/** |
|||
* 商品原价 |
|||
*/ |
|||
@TableField(value = "product_origin_price") |
|||
@ApiModelProperty(value="商品原价") |
|||
private BigDecimal productOriginPrice; |
|||
|
|||
/** |
|||
* 商品售价 |
|||
*/ |
|||
@TableField(value = "product_sale_price") |
|||
@ApiModelProperty(value="商品售价") |
|||
private BigDecimal productSalePrice; |
|||
|
|||
/** |
|||
* 折扣 |
|||
*/ |
|||
@TableField(value = "product_discount") |
|||
@ApiModelProperty(value="折扣") |
|||
private String productDiscount; |
|||
|
|||
/** |
|||
* 节省钱数 |
|||
*/ |
|||
@TableField(value = "product_saved_money") |
|||
@ApiModelProperty(value="节省钱数") |
|||
private String productSavedMoney; |
|||
|
|||
/** |
|||
* 库存量 |
|||
*/ |
|||
@TableField(value = "product_num") |
|||
@ApiModelProperty(value="库存量") |
|||
private Integer productNum; |
|||
|
|||
/** |
|||
* 商品描述 |
|||
*/ |
|||
@TableField(value = "product_desc") |
|||
@ApiModelProperty(value="商品描述") |
|||
private String productDesc; |
|||
|
|||
/** |
|||
* 商品图片 |
|||
*/ |
|||
@TableField(value = "product_img") |
|||
@ApiModelProperty(value="商品图片") |
|||
private String productImg; |
|||
|
|||
/** |
|||
* 商品类型(0->直充;1->卡密) |
|||
*/ |
|||
@TableField(value = "product_type") |
|||
@ApiModelProperty(value="商品类型(0->直充;1->卡密)") |
|||
private String productType; |
|||
|
|||
/** |
|||
* 商品使用说明 |
|||
*/ |
|||
@TableField(value = "product_use_desc") |
|||
@ApiModelProperty(value="商品使用说明") |
|||
private String productUseDesc; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,128 @@ |
|||
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 java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
import lombok.ToString; |
|||
|
|||
@ApiModel(value="com-bnyer-img-domain-ProductOrder") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_product_order") |
|||
public class ProductOrder implements Serializable { |
|||
/** |
|||
* 主键id |
|||
*/ |
|||
@TableId(value = "id", type = IdType.AUTO) |
|||
@ApiModelProperty(value="主键id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 订单流水号 |
|||
*/ |
|||
@TableField(value = "order_id") |
|||
@ApiModelProperty(value="订单流水号") |
|||
private String orderId; |
|||
|
|||
/** |
|||
* 平台用户唯一id |
|||
*/ |
|||
@TableField(value = "user_code") |
|||
@ApiModelProperty(value="平台用户唯一id") |
|||
private String userCode; |
|||
|
|||
/** |
|||
* 商品价格 |
|||
*/ |
|||
@TableField(value = "product_price") |
|||
@ApiModelProperty(value="商品价格") |
|||
private BigDecimal productPrice; |
|||
|
|||
/** |
|||
* 支付价格 |
|||
*/ |
|||
@TableField(value = "pay_price") |
|||
@ApiModelProperty(value="支付价格") |
|||
private BigDecimal payPrice; |
|||
|
|||
/** |
|||
* 充值账号 |
|||
*/ |
|||
@TableField(value = "account_num") |
|||
@ApiModelProperty(value="充值账号") |
|||
private String accountNum; |
|||
|
|||
/** |
|||
* 订单类型(0->直充;1->卡密) |
|||
*/ |
|||
@TableField(value = "order_type") |
|||
@ApiModelProperty(value="订单类型(0->直充;1->卡密)") |
|||
private String orderType; |
|||
|
|||
/** |
|||
* 订单状态(0->待支付;1->支付中;2->已完成;3->已失效;4->支付失败) |
|||
*/ |
|||
@TableField(value = "order_status") |
|||
@ApiModelProperty(value="订单状态(0->待支付;1->支付中;2->已完成;3->已失效;4->支付失败)") |
|||
private String orderStatus; |
|||
|
|||
/** |
|||
* 账号类型(0->手机号;1->QQ号) |
|||
*/ |
|||
@TableField(value = "account_type") |
|||
@ApiModelProperty(value="账号类型(0->手机号;1->QQ号)") |
|||
private String accountType; |
|||
|
|||
/** |
|||
* 来源平台(0->抖音;1->快手;2->微信) |
|||
*/ |
|||
@TableField(value = "platform") |
|||
@ApiModelProperty(value="来源平台(0->抖音;1->快手;2->微信)") |
|||
private String platform; |
|||
|
|||
/** |
|||
* 支付方式(0->支付宝;1->微信支付) |
|||
*/ |
|||
@TableField(value = "pay_type") |
|||
@ApiModelProperty(value="支付方式(0->支付宝;1->微信支付)") |
|||
private String payType; |
|||
|
|||
/** |
|||
* 是否展示(0->否;1->是) |
|||
*/ |
|||
@TableField(value = "is_show") |
|||
@ApiModelProperty(value="是否展示(0->否;1->是)") |
|||
private String isShow; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@TableField(value = "create_time") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@ApiModelProperty(value="创建时间") |
|||
private Date createTime; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
@TableField(value = "update_time") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@ApiModelProperty(value="更新时间") |
|||
private Date updateTime; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,90 @@ |
|||
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 java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
import lombok.ToString; |
|||
|
|||
@ApiModel(value="com-bnyer-img-domain-UserVip") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_user_vip") |
|||
public class UserVip extends BaseDomain { |
|||
/** |
|||
* 主键Id |
|||
*/ |
|||
@TableId(value = "id", type = IdType.AUTO) |
|||
@ApiModelProperty(value="主键Id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* vip名称 |
|||
*/ |
|||
@TableField(value = "vip_name") |
|||
@ApiModelProperty(value="vip名称") |
|||
private String vipName; |
|||
|
|||
/** |
|||
* vip编码 |
|||
*/ |
|||
@TableField(value = "vip_code") |
|||
@ApiModelProperty(value="vip编码") |
|||
private String vipCode; |
|||
|
|||
/** |
|||
* 原价 |
|||
*/ |
|||
@TableField(value = "origin_price") |
|||
@ApiModelProperty(value="原价") |
|||
private BigDecimal originPrice; |
|||
|
|||
/** |
|||
* 售价 |
|||
*/ |
|||
@TableField(value = "price") |
|||
@ApiModelProperty(value="售价") |
|||
private BigDecimal price; |
|||
|
|||
/** |
|||
* 描述 |
|||
*/ |
|||
@TableField(value = "description") |
|||
@ApiModelProperty(value="描述") |
|||
private String description; |
|||
|
|||
/** |
|||
* 热门描述 |
|||
*/ |
|||
@TableField(value = "hot_sign_desc") |
|||
@ApiModelProperty(value="热门描述") |
|||
private String hotSignDesc; |
|||
|
|||
/** |
|||
* 时长天数 |
|||
*/ |
|||
@TableField(value = "days") |
|||
@ApiModelProperty(value="时长天数") |
|||
private Integer days; |
|||
|
|||
/** |
|||
* 是否到期自动续费(0>否;1->是) |
|||
*/ |
|||
@TableField(value = "is_delay") |
|||
@ApiModelProperty(value="是否到期自动续费(0>否;1->是)") |
|||
private String isDelay; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,93 @@ |
|||
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 java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
import lombok.ToString; |
|||
|
|||
@ApiModel(value="com-bnyer-img-domain-UserVipRecord") |
|||
@Getter |
|||
@Setter |
|||
@ToString |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
@TableName(value = "img_user_vip_record") |
|||
public class UserVipRecord extends BaseDomain { |
|||
/** |
|||
* 主键id |
|||
*/ |
|||
@TableId(value = "id", type = IdType.AUTO) |
|||
@ApiModelProperty(value="主键id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 订单id |
|||
*/ |
|||
@TableField(value = "order_id") |
|||
@ApiModelProperty(value="订单id") |
|||
private String orderId; |
|||
|
|||
/** |
|||
* 用户手机号 |
|||
*/ |
|||
@TableField(value = "phone") |
|||
@ApiModelProperty(value="用户手机号") |
|||
private String phone; |
|||
|
|||
/** |
|||
* 用户vip表id |
|||
*/ |
|||
@TableField(value = "user_vip_id") |
|||
@ApiModelProperty(value="用户vip表id") |
|||
private Long userVipId; |
|||
|
|||
/** |
|||
* 开始时间 |
|||
*/ |
|||
@TableField(value = "start_time") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty(value="开始时间") |
|||
private Date startTime; |
|||
|
|||
/** |
|||
* 到期时间 |
|||
*/ |
|||
@TableField(value = "end_time") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty(value="到期时间") |
|||
private Date endTime; |
|||
|
|||
/** |
|||
* 支付金额 |
|||
*/ |
|||
@TableField(value = "price") |
|||
@ApiModelProperty(value="支付金额") |
|||
private BigDecimal price; |
|||
|
|||
/** |
|||
* vip类型状态(0->月卡;1->季卡;2->年卡) |
|||
*/ |
|||
@TableField(value = "type") |
|||
@ApiModelProperty(value="vip类型状态(0->月卡;1->季卡;2->年卡)") |
|||
private String type; |
|||
|
|||
/** |
|||
* 支付状态(0->待支付;1->已支付;2->支付失败;3->支付异常) |
|||
*/ |
|||
@TableField(value = "status") |
|||
@ApiModelProperty(value="支付状态(0->待支付;1->已支付;2->支付失败;3->支付异常)") |
|||
private String status; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
import lombok.NoArgsConstructor; |
|||
import lombok.Setter; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
@ApiModel("支付宝支付参数接收类") |
|||
public class AlipayParamDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="商户订单号") |
|||
private String outTradeNo; |
|||
|
|||
@ApiModelProperty(value="订单名称") |
|||
private String subject; |
|||
|
|||
@ApiModelProperty(value="付款金额") |
|||
private String totalAmount; |
|||
|
|||
@ApiModelProperty(value="备注") |
|||
private String body; |
|||
} |
|||
@ -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 javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("卡密下单接收类") |
|||
public class CardBuyOrderDto implements Serializable { |
|||
|
|||
@NotNull(message = "商品id不能为空!") |
|||
@ApiModelProperty(value="商品id") |
|||
private Integer skuId; |
|||
|
|||
@NotNull(message = "购买数量不能为空!") |
|||
@ApiModelProperty(value="购买数量") |
|||
private Integer buyQuantity; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
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.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("艺术家登出入参") |
|||
public class CreatorLogoutDto implements Serializable { |
|||
|
|||
@NotBlank(message = "手机号不能为空!") |
|||
@ApiModelProperty(value = "手机号") |
|||
private String phone; |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
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.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("直充下单接收类") |
|||
public class DirectBuyOrderDto implements Serializable { |
|||
|
|||
@NotNull(message = "商品id不能为空!") |
|||
@ApiModelProperty(value="商品id") |
|||
private Integer skuId; |
|||
|
|||
@NotNull(message = "直充账号类型不能为空!") |
|||
@ApiModelProperty(value="直充账号类型,10:手机号;20:QQ号,30:邮箱;40:用户ID") |
|||
private Integer chargeAccountType; |
|||
|
|||
@NotBlank(message = "直充账号不能为空!") |
|||
@ApiModelProperty(value="直充账号") |
|||
private String chargeAccountNumber; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
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 FollowDto implements Serializable { |
|||
|
|||
@NotNull(message = "用户id不能为空!") |
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
|
|||
@NotNull(message = "艺术家id不能为空!") |
|||
@ApiModelProperty(value="艺术家id") |
|||
private Long creatorId; |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.bnyer.common.core.utils.bean.BeanUtils; |
|||
import com.bnyer.img.domain.LevelInfo; |
|||
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 LevelInfoDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="主键id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="等级头衔名称") |
|||
private String title; |
|||
|
|||
@ApiModelProperty(value="头衔图标") |
|||
private String titleIcon; |
|||
|
|||
@ApiModelProperty(value="最小经验值") |
|||
private Integer minExp; |
|||
|
|||
@ApiModelProperty(value="最大经验值") |
|||
private Integer maxExp; |
|||
|
|||
@ApiModelProperty(value="等级类型(0->用户;1->创作者)") |
|||
private String type; |
|||
|
|||
public LevelInfo extractParam(){ |
|||
LevelInfo levelInfo = new LevelInfo(); |
|||
BeanUtils.copyProperties(this,levelInfo); |
|||
return levelInfo; |
|||
} |
|||
} |
|||
@ -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; |
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("等级分页接收类") |
|||
public class LevelInfoPageDto extends BasePageDto { |
|||
|
|||
@ApiModelProperty(value="等级头衔名称") |
|||
private String title; |
|||
|
|||
@ApiModelProperty(value="等级类型(0->用户;1->创作者)") |
|||
private String type; |
|||
|
|||
@ApiModelProperty(value="是否显示") |
|||
private String isShow; |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
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; |
|||
import java.util.List; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("修改sign接收类") |
|||
public class ModifySignDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="图片id") |
|||
private Long imgId; |
|||
|
|||
@ApiModelProperty(value="分类id") |
|||
private Long typeId; |
|||
|
|||
@ApiModelProperty(value="标签列表") |
|||
private List<Long> signList; |
|||
|
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
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.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("云媒订单详情接收类") |
|||
public class OrderDetailsDto implements Serializable { |
|||
|
|||
@NotBlank(message = "订单id不能为空!") |
|||
@ApiModelProperty(value="订单id") |
|||
private String orderNo; |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.alibaba.fastjson.annotation.JSONField; |
|||
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 OrderNotifyDto implements Serializable { |
|||
|
|||
@NotBlank(message = "商户id不能为空!") |
|||
@ApiModelProperty(value="商户id") |
|||
private String app_id; |
|||
|
|||
@NotNull(message = "时间戳不能为空!") |
|||
@ApiModelProperty(value="时间戳") |
|||
private long timestamp; |
|||
|
|||
@NotBlank(message = "签名值不能为空!") |
|||
@ApiModelProperty(value="签名值") |
|||
private String sign; |
|||
|
|||
@NotBlank(message = "商户侧订单号不能为空!") |
|||
@ApiModelProperty(value="商户侧订单号") |
|||
private String customer_order_no; |
|||
|
|||
@NotBlank(message = "订单状态不能为空!") |
|||
@ApiModelProperty(value="订单状态(SUCCESS-成功;FAIL-失败)") |
|||
private String trade_state; |
|||
|
|||
@NotBlank(message = "描述信息不能为空!") |
|||
@ApiModelProperty(value="描述信息") |
|||
private String description; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
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.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("用户会员vip支付接收类") |
|||
public class PayUserVipDto implements Serializable { |
|||
|
|||
@NotBlank(message = "手机号不能为空!") |
|||
@ApiModelProperty(value="手机号") |
|||
private String phone; |
|||
|
|||
@NotNull(message = "用户vipId不能为空!") |
|||
@ApiModelProperty(value="用户vip表id") |
|||
private Long userVipId; |
|||
|
|||
@NotBlank(message = "vip类型状态不能为空!") |
|||
@ApiModelProperty(value="vip类型状态(0->月卡;1->季卡;2->年卡)") |
|||
private String type; |
|||
|
|||
@NotBlank(message = "支付金额不能为空!") |
|||
@ApiModelProperty(value="支付金额") |
|||
private String price; |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.bnyer.img.domain.Product; |
|||
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.math.BigDecimal; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("产品接收类") |
|||
public class ProductDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="主键id") |
|||
private Long id; |
|||
|
|||
@NotBlank(message = "商品名称不能为空!") |
|||
@ApiModelProperty(value="商品名称") |
|||
private String productName; |
|||
|
|||
@NotBlank(message = "商品原价不能为空!") |
|||
@ApiModelProperty(value="商品原价") |
|||
private String productOriginPrice; |
|||
|
|||
@NotBlank(message = "商品售价不能为空!") |
|||
@ApiModelProperty(value="商品售价") |
|||
private String productSalePrice; |
|||
|
|||
@NotBlank(message = "折扣不能为空!") |
|||
@ApiModelProperty(value="折扣") |
|||
private String productDiscount; |
|||
|
|||
@NotBlank(message = "节省钱数不能为空!") |
|||
@ApiModelProperty(value="节省钱数") |
|||
private String productSavedMoney; |
|||
|
|||
@NotNull(message = "库存量不能为空!") |
|||
@ApiModelProperty(value="库存量") |
|||
private Integer productNum; |
|||
|
|||
@NotBlank(message = "商品描述不能为空!") |
|||
@ApiModelProperty(value="商品描述") |
|||
private String productDesc; |
|||
|
|||
@NotBlank(message = "商品图片不能为空!") |
|||
@ApiModelProperty(value="商品图片") |
|||
private String productImg; |
|||
|
|||
@NotBlank(message = "商品类型不能为空!") |
|||
@ApiModelProperty(value="商品类型(0->直充;1->卡密)") |
|||
private String productType; |
|||
|
|||
@NotBlank(message = "商品使用说明不能为空!") |
|||
@ApiModelProperty(value="商品使用说明") |
|||
private String productUseDesc; |
|||
|
|||
public Product extractParam(){ |
|||
Product product = new Product(); |
|||
if(this.getId() != null){ |
|||
product.setId(this.getId()); |
|||
} |
|||
product.setProductName(this.getProductName()); |
|||
product.setProductOriginPrice(new BigDecimal(this.getProductOriginPrice())); |
|||
product.setProductSalePrice(new BigDecimal(this.getProductSalePrice())); |
|||
product.setProductDiscount(this.getProductDiscount()); |
|||
product.setProductSavedMoney(this.getProductSavedMoney()); |
|||
product.setProductNum(this.getProductNum()); |
|||
product.setProductDesc(this.getProductDesc()); |
|||
product.setProductImg(this.getProductImg()); |
|||
product.setProductType(this.getProductType()); |
|||
product.setProductUseDesc(this.getProductUseDesc()); |
|||
return product; |
|||
} |
|||
} |
|||
@ -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; |
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("商品分页接收类") |
|||
public class ProductPageDto extends BasePageDto { |
|||
|
|||
@ApiModelProperty(value="商品名称") |
|||
private String productName; |
|||
|
|||
@ApiModelProperty(value="商品类型(0->直充;1->卡密)") |
|||
private String productType; |
|||
|
|||
@ApiModelProperty(value="是否显示") |
|||
private String isShow; |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
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("关注用户id接收类") |
|||
public class UserIdDto extends BasePageDto { |
|||
|
|||
@NotNull(message = "用户id不能为空!") |
|||
@ApiModelProperty(value="用户id") |
|||
private Long userId; |
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.bnyer.common.core.utils.StringUtils; |
|||
import com.bnyer.common.core.utils.bean.BeanUtils; |
|||
import com.bnyer.img.domain.Banner; |
|||
import com.bnyer.img.domain.UserVip; |
|||
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; |
|||
import java.math.BigDecimal; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("用户会员vip接收类") |
|||
public class UserVipDto implements Serializable { |
|||
|
|||
@ApiModelProperty(value="主键Id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="vip名称") |
|||
private String vipName; |
|||
|
|||
@ApiModelProperty(value="原价") |
|||
private String originPrice; |
|||
|
|||
@ApiModelProperty(value="售价") |
|||
private String price; |
|||
|
|||
@ApiModelProperty(value="描述") |
|||
private String description; |
|||
|
|||
@ApiModelProperty(value="热门描述") |
|||
private String hotSignDesc; |
|||
|
|||
@ApiModelProperty(value="时长天数") |
|||
private Integer days; |
|||
|
|||
@ApiModelProperty(value="是否到期自动续费(0>否;1->是)") |
|||
private String isDelay; |
|||
|
|||
public UserVip extractParam(){ |
|||
UserVip userVip = new UserVip(); |
|||
if(this.getId() != null){ |
|||
userVip.setId(this.getId()); |
|||
} |
|||
userVip.setVipName(this.getVipName()); |
|||
userVip.setOriginPrice(new BigDecimal(this.getOriginPrice())); |
|||
userVip.setPrice(new BigDecimal(this.getPrice())); |
|||
if(StringUtils.isNotBlank(this.getDescription())){ |
|||
userVip.setDescription(this.getDescription()); |
|||
} |
|||
if(StringUtils.isNotBlank(this.getHotSignDesc())){ |
|||
userVip.setHotSignDesc(this.getHotSignDesc()); |
|||
} |
|||
userVip.setDays(this.getDays()); |
|||
userVip.setIsDelay(this.getIsDelay()); |
|||
return userVip; |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
package com.bnyer.img.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
|
|||
|
|||
@Getter |
|||
@Setter |
|||
@ApiModel("会员vip分页接收类") |
|||
public class UserVipPageDto extends BasePageDto { |
|||
|
|||
@ApiModelProperty(value="vip名称") |
|||
private String vipName; |
|||
|
|||
@ApiModelProperty(value="vip编码") |
|||
private String vipCode; |
|||
|
|||
@ApiModelProperty(value="是否到期自动续费(0>否;1->是)") |
|||
private String isDelay; |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.bnyer.img.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/4/19 17:46 |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum YunmeiCallbackEnum { |
|||
SUCCESS("SUCCESS","ok"), |
|||
FAIL("FAIL","fail"); |
|||
|
|||
private String value; |
|||
|
|||
private String msg; |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.bnyer.img.enums; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Getter; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/4/19 17:46 |
|||
*/ |
|||
@Getter |
|||
@AllArgsConstructor |
|||
public enum YunmeiEnum { |
|||
SUCCESS(0,"接口调用成功"); |
|||
|
|||
private Integer code; |
|||
|
|||
private String msg; |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.bnyer.img.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.bnyer.img.domain.LevelInfo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface LevelInfoMapper extends BaseMapper<LevelInfo> { |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.bnyer.img.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.bnyer.img.domain.Product; |
|||
import com.bnyer.img.vo.ProductVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface ProductMapper extends BaseMapper<Product> { |
|||
|
|||
/** |
|||
* 查询前端产品列表 |
|||
* @return - |
|||
*/ |
|||
List<ProductVo> queryFrontList(); |
|||
|
|||
/** |
|||
* 商品详情 |
|||
* @param id 主键id |
|||
* @return - |
|||
*/ |
|||
ProductVo queryFrontDetails(Long id); |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package com.bnyer.img.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.bnyer.img.domain.ProductOrder; |
|||
|
|||
public interface ProductOrderMapper extends BaseMapper<ProductOrder> { |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.bnyer.img.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.bnyer.img.domain.UserVip; |
|||
import com.bnyer.img.vo.UserVipVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface UserVipMapper extends BaseMapper<UserVip> { |
|||
|
|||
/** |
|||
* 获取小程序端会员vip列表 |
|||
* @return - |
|||
*/ |
|||
List<UserVipVo> queryFront(); |
|||
|
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.bnyer.img.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.bnyer.img.domain.UserVipRecord; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface UserVipRecordMapper extends BaseMapper<UserVipRecord> { |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.bnyer.img.dto.AlipayParamDto; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/8/30 16:42 |
|||
*/ |
|||
public interface AlipayService { |
|||
|
|||
/** |
|||
* 支付宝支付 |
|||
* @param params 支付参数 |
|||
* @return - |
|||
*/ |
|||
String aliPay(AlipayParamDto params); |
|||
|
|||
/** |
|||
* 支付宝回调 |
|||
* @param request 回调请求 |
|||
* @return - |
|||
*/ |
|||
String alipayCallBack(HttpServletRequest request); |
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.bnyer.img.vo.CreatorFollowVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/9/17 15:54 |
|||
*/ |
|||
public interface FollowService { |
|||
|
|||
/** |
|||
* 关注艺术家 |
|||
* @param userId 用户id |
|||
* @param creatorId 艺术家id |
|||
* @param platform 平台 |
|||
*/ |
|||
void follow(Long userId,Long creatorId,String platform); |
|||
|
|||
/** |
|||
* 取消关注 |
|||
* @param userId 用户id |
|||
* @param creatorId 艺术家id |
|||
* @param platform 平台 |
|||
*/ |
|||
void unFollow(Long userId,Long creatorId,String platform); |
|||
|
|||
/** |
|||
* 检查用户是否关注 |
|||
* @param userId 用户id |
|||
* @param creatorId 艺术家id |
|||
* @param platform 平台 |
|||
* @return - |
|||
*/ |
|||
boolean checkFollow(Long userId,Long creatorId,String platform); |
|||
|
|||
/** |
|||
* 根据平台和用户id返回关注的艺术家列表 |
|||
* @param userId 用户id |
|||
* @param platform 平台 |
|||
* @return - |
|||
*/ |
|||
List<CreatorFollowVo> queryFollowCreatorList(Long userId,String platform); |
|||
|
|||
/** |
|||
* 艺术家获取粉丝数量 |
|||
* @param creatorId 艺术家id |
|||
* @return - |
|||
*/ |
|||
Integer queryFansNum(Long creatorId); |
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.bnyer.img.domain.LevelInfo; |
|||
import com.bnyer.img.dto.LevelInfoPageDto; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface LevelInfoService { |
|||
|
|||
/** |
|||
* 新增等级 |
|||
* @param levelInfo 等级信息 |
|||
* @return - |
|||
*/ |
|||
int insert(LevelInfo levelInfo); |
|||
|
|||
/** |
|||
* 修改等级 |
|||
* @param levelInfo 等级信息 |
|||
* @return - |
|||
*/ |
|||
int update(LevelInfo levelInfo); |
|||
|
|||
/** |
|||
* 批量删除等级信息 |
|||
* @param ids 主键ids |
|||
* @return - |
|||
*/ |
|||
int delete(List<Long> ids); |
|||
|
|||
/** |
|||
* 查询等级列表分页 |
|||
* @param params 分页参数 |
|||
* @return - |
|||
*/ |
|||
List<LevelInfo> queryList(LevelInfoPageDto params); |
|||
|
|||
/** |
|||
* 查询等级详情 |
|||
* @param id 主键Id |
|||
* @return - |
|||
*/ |
|||
LevelInfo queryDetails(Long id); |
|||
|
|||
/** |
|||
* 变更显示状态 |
|||
* @param id 主键id |
|||
* @param status 状态 |
|||
* @return - |
|||
*/ |
|||
int changeStatus(Long id, String status); |
|||
} |
|||
@ -0,0 +1,66 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.bnyer.img.domain.Product; |
|||
import com.bnyer.img.dto.ProductPageDto; |
|||
import com.bnyer.img.vo.ProductVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface ProductService { |
|||
|
|||
/** |
|||
* 新增商品 |
|||
* @param product 商品 |
|||
* @return - |
|||
*/ |
|||
int insert(Product product); |
|||
|
|||
/** |
|||
* 编辑商品 |
|||
* @param product 商品 |
|||
* @return - |
|||
*/ |
|||
int update(Product product); |
|||
|
|||
/** |
|||
* 批量删除商品 |
|||
* @param ids 商品ids |
|||
* @return - |
|||
*/ |
|||
int delete(List<Long> ids); |
|||
|
|||
/** |
|||
* 查询商品分页 |
|||
* @param params 分页参数 |
|||
* @return - |
|||
*/ |
|||
List<Product> queryPage(ProductPageDto params); |
|||
|
|||
/** |
|||
* 查询商品详情 |
|||
* @param id 主键id |
|||
* @return - |
|||
*/ |
|||
Product details(Long id); |
|||
|
|||
/** |
|||
* 查询前端商品列表 |
|||
* @return - |
|||
*/ |
|||
List<ProductVo> queryFrontList(); |
|||
|
|||
/** |
|||
* 查询前端盖商品详情 |
|||
* @param id 主键id |
|||
* @return - |
|||
*/ |
|||
ProductVo queryFrontDetails(Long id); |
|||
|
|||
/** |
|||
* 变更显示状态 |
|||
* @param id 主键id |
|||
* @param status 状态 |
|||
* @return - |
|||
*/ |
|||
int changeStatus(Long id,String status); |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.bnyer.img.domain.UserVipRecord; |
|||
import com.bnyer.img.dto.PayUserVipDto; |
|||
|
|||
public interface UserVipRecordService { |
|||
|
|||
|
|||
/** |
|||
* 下单并支付会员vip |
|||
* @param param 用户vip参数对象 |
|||
* @return - |
|||
*/ |
|||
boolean payUserVip(PayUserVipDto param); |
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.bnyer.img.domain.UserVip; |
|||
import com.bnyer.img.dto.UserVipPageDto; |
|||
import com.bnyer.img.vo.UserVipVo; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface UserVipService { |
|||
|
|||
/** |
|||
* 新增会员vip |
|||
* @param userVip vip |
|||
* @return - |
|||
*/ |
|||
int insert(UserVip userVip); |
|||
|
|||
/** |
|||
* 修改会员vip |
|||
* @param userVip vip |
|||
* @return - |
|||
*/ |
|||
int update(UserVip userVip); |
|||
|
|||
/** |
|||
* 删除会员vip |
|||
* @param ids vip列表 |
|||
* @return - |
|||
*/ |
|||
int delete(List<Long> ids); |
|||
|
|||
/** |
|||
* 获取会员vip详情 |
|||
* @param id 主键id |
|||
* @return - |
|||
*/ |
|||
UserVip queryDetails(Long id); |
|||
|
|||
/** |
|||
* 获取会员vip分页 |
|||
* @param param 分页参数 |
|||
* @return - |
|||
*/ |
|||
List<UserVip> queryPage(UserVipPageDto param); |
|||
|
|||
/** |
|||
* 变更显示状态 |
|||
* @param id 主键id |
|||
* @param status 状态 |
|||
* @return - |
|||
*/ |
|||
int changeStatus(Long id,String status); |
|||
|
|||
/** |
|||
* 获取小程序端会员vip列表 |
|||
* @return - |
|||
*/ |
|||
List<UserVipVo> queryFront(); |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
package com.bnyer.img.service; |
|||
|
|||
import com.alibaba.fastjson.JSONArray; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.bnyer.img.dto.CardBuyOrderDto; |
|||
import com.bnyer.img.dto.DirectBuyOrderDto; |
|||
import com.bnyer.img.dto.OrderNotifyDto; |
|||
|
|||
public interface YunmeiService { |
|||
|
|||
/** |
|||
* 获取产品列表 |
|||
* @return - |
|||
*/ |
|||
JSONArray getProductList(); |
|||
|
|||
/** |
|||
* 根据商品id获取商品详情 |
|||
* @param skuId 商品Id |
|||
* @return - |
|||
*/ |
|||
JSONObject getProductDetails(Long skuId); |
|||
|
|||
/** |
|||
* 直充下单 |
|||
* @param params 下单参数 |
|||
* @return - |
|||
*/ |
|||
JSONObject directBuyOrder(DirectBuyOrderDto params); |
|||
|
|||
/** |
|||
* 卡密下单 |
|||
* @param params |
|||
* @return |
|||
*/ |
|||
JSONObject cardBuyOrder(CardBuyOrderDto params); |
|||
|
|||
/** |
|||
* 查询订单详情 |
|||
* @param orderNo 订单id |
|||
* @return - |
|||
*/ |
|||
JSONObject getOrderDetails(String orderNo); |
|||
|
|||
/** |
|||
* 查询商户余额 |
|||
* @return - |
|||
*/ |
|||
JSONObject getBalance(); |
|||
|
|||
/** |
|||
* 订单通知回调 |
|||
* @param params 回调参数 |
|||
* @return - |
|||
*/ |
|||
String orderNotify(OrderNotifyDto params); |
|||
} |
|||
@ -0,0 +1,95 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.alipay.api.AlipayApiException; |
|||
import com.alipay.api.AlipayClient; |
|||
import com.alipay.api.DefaultAlipayClient; |
|||
import com.alipay.api.internal.util.AlipaySignature; |
|||
import com.alipay.api.request.AlipayTradePagePayRequest; |
|||
import com.bnyer.img.config.AlipayConfig; |
|||
import com.bnyer.img.dto.AlipayParamDto; |
|||
import com.bnyer.img.service.AlipayService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.util.HashMap; |
|||
import java.util.Iterator; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/8/30 17:09 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class AlipayServiceImpl implements AlipayService { |
|||
|
|||
@Autowired |
|||
private AlipayConfig alipayConfig; |
|||
|
|||
@Override |
|||
public String aliPay(AlipayParamDto params) { |
|||
String result = null; |
|||
//1、获得初始化的AlipayClient
|
|||
AlipayClient client = new DefaultAlipayClient( |
|||
alipayConfig.getGatewayUrl(), |
|||
alipayConfig.getAppId(), |
|||
alipayConfig.getPrivateKey(), |
|||
alipayConfig.getCharset(), |
|||
alipayConfig.getPublicKey(), |
|||
alipayConfig.getSignType()); |
|||
//2、设置请求参数
|
|||
AlipayTradePagePayRequest request = new AlipayTradePagePayRequest(); |
|||
//页面跳转同步通知页面路径
|
|||
request.setReturnUrl(alipayConfig.getReturnUrl()); |
|||
// 服务器异步通知页面路径
|
|||
request.setNotifyUrl(alipayConfig.getNotifyUrl()); |
|||
//封装参数
|
|||
request.setBizContent(JSON.toJSONString(client)); |
|||
try { |
|||
//3、请求支付宝进行付款,并获取支付结果
|
|||
result = client.pageExecute(request).getBody(); |
|||
} catch (AlipayApiException e) { |
|||
log.error("支付宝支付失败!错误原因为:", e); |
|||
return null; |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
public String alipayCallBack(HttpServletRequest request) { |
|||
Map<String, String> result = new HashMap<>(); |
|||
Map requestParams = request.getParameterMap(); |
|||
for (Iterator iter = requestParams.keySet().iterator(); iter.hasNext(); ) { |
|||
String name = (String) iter.next(); |
|||
String[] values = (String[]) requestParams.get(name); |
|||
String valueStr = ""; |
|||
for (int i = 0; i < values.length; i++) { |
|||
valueStr = (i == values.length - 1) ? valueStr + values[i] |
|||
: valueStr + values[i] + ","; |
|||
} |
|||
//乱码解决,这段代码在出现乱码时使用。
|
|||
//valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
|
|||
result.put(name, valueStr); |
|||
} |
|||
|
|||
String outTradeNo = result.get("out_trade_no"); |
|||
String appId = result.get("app_id"); |
|||
String sellerId = result.get("out_trade_no"); |
|||
String totalAmount = result.get("total_amount"); |
|||
log.info("outTradeNo=={},appId=={},sellerId=={},totalAmount=={}",outTradeNo,appId,sellerId,totalAmount); |
|||
try { |
|||
boolean flag = AlipaySignature.rsaCheckV1(result, alipayConfig.getPublicKey(), alipayConfig.getCharset(), alipayConfig.getSignType()); |
|||
if (flag) { |
|||
return "success"; |
|||
} else { |
|||
return "failure"; |
|||
} |
|||
} catch (AlipayApiException e) { |
|||
e.printStackTrace(); |
|||
return "failure"; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,120 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import com.bnyer.common.redis.service.RedisService; |
|||
import com.bnyer.img.constants.PlatformConstant; |
|||
import com.bnyer.img.constants.RedisKeyConstant; |
|||
import com.bnyer.img.domain.Creator; |
|||
import com.bnyer.img.mapper.CreatorMapper; |
|||
import com.bnyer.img.service.FollowService; |
|||
import com.bnyer.img.vo.CreatorFollowVo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.data.redis.core.RedisTemplate; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.*; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/9/17 16:18 |
|||
*/ |
|||
@Service |
|||
@Slf4j |
|||
public class FollowServiceImpl implements FollowService { |
|||
|
|||
@Autowired |
|||
private RedisService redisService; |
|||
|
|||
@Autowired |
|||
private RedisTemplate redisTemplate; |
|||
|
|||
@Autowired |
|||
private CreatorMapper creatorMapper; |
|||
|
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void follow(Long userId, Long creatorId, String platform) { |
|||
String redisKey = null; |
|||
if(platform.equals(PlatformConstant.TIKTOK)){ |
|||
redisKey = RedisKeyConstant.TIKTOK_USER_FOLLOW_KEY + userId; |
|||
}else if(platform.equals(PlatformConstant.FAST_HAND)){ |
|||
redisKey = RedisKeyConstant.FH_USER_FOLLOW_KEY + userId; |
|||
}else{ |
|||
redisKey = RedisKeyConstant.WECHAT_USER_FOLLOW_KEY + userId; |
|||
} |
|||
//添加粉丝关注艺术家
|
|||
Set<Long> creatorSet = new HashSet<>(); |
|||
creatorSet.add(creatorId); |
|||
redisService.setCacheSet(redisKey, creatorSet); |
|||
//添加艺术家粉丝数量
|
|||
redisService.hashIncr(RedisKeyConstant.CREATOR_FANS_NUM_KEY, String.valueOf(creatorId),1); |
|||
log.debug("平台{}用户{}关注了艺术家{}",platform,userId,creatorId); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void unFollow(Long userId, Long creatorId, String platform) { |
|||
String redisKey = null; |
|||
if(platform.equals(PlatformConstant.TIKTOK)){ |
|||
redisKey = RedisKeyConstant.TIKTOK_USER_FOLLOW_KEY + userId; |
|||
}else if(platform.equals(PlatformConstant.FAST_HAND)){ |
|||
redisKey = RedisKeyConstant.FH_USER_FOLLOW_KEY + userId; |
|||
}else{ |
|||
redisKey = RedisKeyConstant.WECHAT_USER_FOLLOW_KEY + userId; |
|||
} |
|||
//取消粉丝关注艺术家
|
|||
if(redisService.hasSet(redisKey,creatorId)){ |
|||
redisService.removeSet(redisKey,creatorId); |
|||
//取消艺术家粉丝数量
|
|||
redisService.hashIncr(RedisKeyConstant.CREATOR_FANS_NUM_KEY, String.valueOf(creatorId),-1); |
|||
log.debug("平台{}用户{}取消关注了艺术家{}",platform,userId,creatorId); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public boolean checkFollow(Long userId, Long creatorId, String platform) { |
|||
String redisKey = null; |
|||
if(platform.equals(PlatformConstant.TIKTOK)){ |
|||
redisKey = RedisKeyConstant.TIKTOK_USER_FOLLOW_KEY + userId; |
|||
}else if(platform.equals(PlatformConstant.FAST_HAND)){ |
|||
redisKey = RedisKeyConstant.FH_USER_FOLLOW_KEY + userId; |
|||
}else{ |
|||
redisKey = RedisKeyConstant.WECHAT_USER_FOLLOW_KEY + userId; |
|||
} |
|||
if(redisService.hasSet(redisKey,creatorId)){ |
|||
return true; |
|||
}else{ |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public List<CreatorFollowVo> queryFollowCreatorList(Long userId, String platform) { |
|||
String redisKey = null; |
|||
if(platform.equals(PlatformConstant.TIKTOK)){ |
|||
redisKey = RedisKeyConstant.TIKTOK_USER_FOLLOW_KEY + userId; |
|||
}else if(platform.equals(PlatformConstant.FAST_HAND)){ |
|||
redisKey = RedisKeyConstant.FH_USER_FOLLOW_KEY + userId; |
|||
}else{ |
|||
redisKey = RedisKeyConstant.WECHAT_USER_FOLLOW_KEY + userId; |
|||
} |
|||
if(redisService.hasKey(redisKey)){ |
|||
Set<Long> cacheSet = redisService.getCacheSet(redisKey); |
|||
return creatorMapper.queryFollowCreator(cacheSet); |
|||
}else{ |
|||
return new ArrayList<>(); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Integer queryFansNum(Long creatorId) { |
|||
String redisKey = RedisKeyConstant.CREATOR_FANS_NUM_KEY; |
|||
if(redisService.hasHashKey(redisKey,String.valueOf(creatorId))){ |
|||
return redisService.getCacheMapValue(redisKey, String.valueOf(creatorId)); |
|||
}else{ |
|||
return 0; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import com.bnyer.common.core.utils.StringUtils; |
|||
import com.bnyer.img.domain.LevelInfo; |
|||
import com.bnyer.img.domain.Notice; |
|||
import com.bnyer.img.dto.LevelInfoPageDto; |
|||
import com.bnyer.img.mapper.LevelInfoMapper; |
|||
import com.bnyer.img.service.LevelInfoService; |
|||
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; |
|||
|
|||
@Service |
|||
public class LevelInfoServiceImpl implements LevelInfoService { |
|||
|
|||
@Autowired |
|||
private LevelInfoMapper levelInfoMapper; |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int insert(LevelInfo levelInfo) { |
|||
levelInfo.setCreateTime(new Date()); |
|||
levelInfo.setUpdateTime(new Date()); |
|||
levelInfo.setIsShow("1"); |
|||
levelInfo.setSort(0); |
|||
return levelInfoMapper.insert(levelInfo); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int update(LevelInfo levelInfo) { |
|||
levelInfo.setUpdateTime(new Date()); |
|||
return levelInfoMapper.updateById(levelInfo); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int delete(List<Long> ids) { |
|||
return levelInfoMapper.deleteBatchIds(ids); |
|||
} |
|||
|
|||
@Override |
|||
public List<LevelInfo> queryList(LevelInfoPageDto params) { |
|||
LambdaQueryWrapper<LevelInfo> wrapper = new LambdaQueryWrapper<>(); |
|||
if(StringUtils.isNotBlank(params.getTitle())){ |
|||
wrapper.like(LevelInfo::getTitle, params.getTitle()); |
|||
} |
|||
if(StringUtils.isNotBlank(params.getType())){ |
|||
wrapper.eq(LevelInfo::getType, params.getType()); |
|||
} |
|||
if(StringUtils.isNotBlank(params.getIsShow())){ |
|||
wrapper.eq(LevelInfo::getIsShow, params.getIsShow()); |
|||
} |
|||
wrapper.orderByDesc(LevelInfo::getSort); |
|||
return levelInfoMapper.selectList(wrapper); |
|||
} |
|||
|
|||
@Override |
|||
public LevelInfo queryDetails(Long id) { |
|||
return levelInfoMapper.selectById(id); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int changeStatus(Long id, String status) { |
|||
LambdaUpdateWrapper<LevelInfo> wrapper = new LambdaUpdateWrapper<>(); |
|||
wrapper.eq(LevelInfo::getId, id); |
|||
LevelInfo levelInfo = new LevelInfo(); |
|||
levelInfo.setIsShow(status); |
|||
return levelInfoMapper.update(levelInfo,wrapper); |
|||
} |
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import com.bnyer.common.core.utils.StringUtils; |
|||
import com.bnyer.img.domain.Banner; |
|||
import com.bnyer.img.domain.Product; |
|||
import com.bnyer.img.dto.ProductPageDto; |
|||
import com.bnyer.img.mapper.ProductMapper; |
|||
import com.bnyer.img.service.ProductService; |
|||
import com.bnyer.img.vo.ProductVo; |
|||
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; |
|||
|
|||
@Service |
|||
@Slf4j |
|||
public class ProductServiceImpl implements ProductService { |
|||
|
|||
@Autowired |
|||
private ProductMapper productMapper; |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int insert(Product product) { |
|||
product.setCreateTime(new Date()); |
|||
product.setUpdateTime(new Date()); |
|||
product.setIsShow("1"); |
|||
return productMapper.insert(product); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int update(Product product) { |
|||
product.setUpdateTime(new Date()); |
|||
return productMapper.updateById(product); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int delete(List<Long> ids) { |
|||
return productMapper.deleteBatchIds(ids); |
|||
} |
|||
|
|||
@Override |
|||
public List<Product> queryPage(ProductPageDto params) { |
|||
LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>(); |
|||
if(StringUtils.isNotBlank(params.getProductName())){ |
|||
wrapper.like(Product::getProductName, params.getProductName()); |
|||
} |
|||
if(StringUtils.isNotBlank(params.getProductType())){ |
|||
wrapper.eq(Product::getProductType, params.getProductType()); |
|||
} |
|||
if(StringUtils.isNotBlank(params.getIsShow())){ |
|||
wrapper.eq(Product::getIsShow, params.getIsShow()); |
|||
} |
|||
return productMapper.selectList(wrapper); |
|||
} |
|||
|
|||
@Override |
|||
public Product details(Long id) { |
|||
return productMapper.selectById(id); |
|||
} |
|||
|
|||
@Override |
|||
public List<ProductVo> queryFrontList() { |
|||
return productMapper.queryFrontList(); |
|||
} |
|||
|
|||
@Override |
|||
public ProductVo queryFrontDetails(Long id) { |
|||
return productMapper.queryFrontDetails(id); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int changeStatus(Long id, String status) { |
|||
LambdaUpdateWrapper<Product> wrapper = new LambdaUpdateWrapper<>(); |
|||
wrapper.eq(Product::getId, id); |
|||
Product product = new Product(); |
|||
product.setIsShow(status); |
|||
return productMapper.update(product,wrapper); |
|||
} |
|||
} |
|||
@ -0,0 +1,85 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import com.bnyer.common.core.utils.StringUtils; |
|||
import com.bnyer.common.core.utils.uuid.IdUtils; |
|||
import com.bnyer.img.domain.Banner; |
|||
import com.bnyer.img.domain.UserVip; |
|||
import com.bnyer.img.dto.UserVipPageDto; |
|||
import com.bnyer.img.mapper.UserVipMapper; |
|||
import com.bnyer.img.service.UserVipService; |
|||
import com.bnyer.img.vo.UserVipVo; |
|||
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; |
|||
|
|||
@Service |
|||
@Slf4j |
|||
public class UserVipServiceImpl implements UserVipService { |
|||
|
|||
@Autowired |
|||
private UserVipMapper userVipMapper; |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int insert(UserVip userVip) { |
|||
userVip.setVipCode(IdUtils.fastSimpleUUID()); |
|||
userVip.setCreateTime(new Date()); |
|||
userVip.setUpdateTime(new Date()); |
|||
userVip.setIsShow("1"); |
|||
return userVipMapper.insert(userVip); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int update(UserVip userVip) { |
|||
userVip.setUpdateTime(new Date()); |
|||
return userVipMapper.updateById(userVip); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public int delete(List<Long> ids) { |
|||
return userVipMapper.deleteBatchIds(ids); |
|||
} |
|||
|
|||
@Override |
|||
public UserVip queryDetails(Long id) { |
|||
return userVipMapper.selectById(id); |
|||
} |
|||
|
|||
@Override |
|||
public List<UserVip> queryPage(UserVipPageDto param) { |
|||
LambdaQueryWrapper<UserVip> wrapper = new LambdaQueryWrapper<>(); |
|||
if(StringUtils.isNotBlank(param.getVipName())){ |
|||
wrapper.like(UserVip::getVipName, param.getVipName()); |
|||
} |
|||
if(StringUtils.isNotBlank(param.getVipCode())){ |
|||
wrapper.eq(UserVip::getVipCode, param.getVipCode()); |
|||
} |
|||
if(StringUtils.isNotBlank(param.getIsDelay())){ |
|||
wrapper.eq(UserVip::getIsDelay, param.getIsDelay()); |
|||
} |
|||
wrapper.orderByDesc(UserVip::getSort); |
|||
return userVipMapper.selectList(wrapper); |
|||
} |
|||
|
|||
@Override |
|||
public int changeStatus(Long id, String status) { |
|||
LambdaUpdateWrapper<UserVip> wrapper = new LambdaUpdateWrapper<>(); |
|||
wrapper.eq(UserVip::getId, id); |
|||
UserVip userVip = new UserVip(); |
|||
userVip.setIsShow(status); |
|||
return userVipMapper.update(userVip,wrapper); |
|||
} |
|||
|
|||
@Override |
|||
public List<UserVipVo> queryFront() { |
|||
return userVipMapper.queryFront(); |
|||
} |
|||
} |
|||
@ -0,0 +1,98 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import cn.hutool.core.date.DateUtil; |
|||
import cn.hutool.core.util.IdUtil; |
|||
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.DateUtils; |
|||
import com.bnyer.common.core.utils.StringUtils; |
|||
import com.bnyer.common.core.utils.uuid.IdUtils; |
|||
import com.bnyer.common.redis.service.RedissonService; |
|||
import com.bnyer.img.constants.RedisKeyConstant; |
|||
import com.bnyer.img.constants.UserVipOrderStatusConstant; |
|||
import com.bnyer.img.constants.UserVipTypeConstant; |
|||
import com.bnyer.img.domain.UserVip; |
|||
import com.bnyer.img.domain.UserVipRecord; |
|||
import com.bnyer.img.dto.PayUserVipDto; |
|||
import com.bnyer.img.dto.UserVipPageDto; |
|||
import com.bnyer.img.mapper.UserVipMapper; |
|||
import com.bnyer.img.mapper.UserVipRecordMapper; |
|||
import com.bnyer.img.service.UserVipRecordService; |
|||
import com.bnyer.img.service.UserVipService; |
|||
import com.bnyer.img.vo.UserVipVo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.redisson.api.RLock; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.time.LocalDateTime; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.concurrent.TimeUnit; |
|||
|
|||
@Service |
|||
@Slf4j |
|||
public class UserVipServiceRecordImpl implements UserVipRecordService { |
|||
|
|||
@Autowired |
|||
private UserVipRecordMapper userVipRecordMapper; |
|||
|
|||
@Autowired |
|||
private RedissonService redissonService; |
|||
|
|||
|
|||
@Override |
|||
public boolean payUserVip(PayUserVipDto param) { |
|||
UserVipRecord userVipRecord = new UserVipRecord(); |
|||
//生成订单id
|
|||
userVipRecord.setOrderId(IdUtil.getSnowflakeNextIdStr()); |
|||
//获取分布式锁
|
|||
RLock lock = redissonService.getRLock(RedisKeyConstant.PAY_USER_VIP_LOCK_KEY + userVipRecord.getOrderId()); |
|||
try{ |
|||
if(lock.tryLock(500, 10000, TimeUnit.MILLISECONDS)){ |
|||
//调用支付
|
|||
|
|||
//保存订单
|
|||
userVipRecord.setCreateTime(new Date()); |
|||
userVipRecord.setUpdateTime(new Date()); |
|||
userVipRecord.setPrice(new BigDecimal(param.getPrice())); |
|||
userVipRecord.setStatus(UserVipOrderStatusConstant.UN_PAY); |
|||
userVipRecord.setIsShow("1"); |
|||
Date startTime = new Date(); |
|||
userVipRecord.setStartTime(startTime); |
|||
if(userVipRecord.getType().equals(UserVipTypeConstant.MONTH_CARD)){ |
|||
//计算月卡(30天)的结束时间
|
|||
userVipRecord.setEndTime(DateUtils.getDateAfter(startTime, 30)); |
|||
}else if(userVipRecord.getType().equals(UserVipTypeConstant.SEASON_CARD)){ |
|||
//结算季卡(90天)的结束时间
|
|||
userVipRecord.setEndTime(DateUtils.getDateAfter(startTime, 90)); |
|||
}else{ |
|||
//计算年卡(365天)的结束时间
|
|||
userVipRecord.setEndTime(DateUtils.getDateAfter(startTime, 365)); |
|||
} |
|||
}else{ |
|||
userVipRecord.setStatus(UserVipOrderStatusConstant.PAY_EXCEPTION); |
|||
log.error("用户会员vip支付异常,锁被占用!"); |
|||
throw new ServiceException("系统繁忙,请稍候重试!"); |
|||
} |
|||
}catch (Exception e){ |
|||
userVipRecord.setStatus(UserVipOrderStatusConstant.PAY_FAIL); |
|||
log.error("用户会员vip支付失败!错误原因为【{}】",e.getMessage()); |
|||
throw new ServiceException("系统繁忙,请勿重复操作!"); |
|||
}finally { |
|||
int insert = userVipRecordMapper.insert(userVipRecord); |
|||
if(insert > 0){ |
|||
return true; |
|||
} |
|||
//释放锁
|
|||
if(lock.isHeldByCurrentThread()){ |
|||
lock.unlock(); |
|||
log.info("用户会员vip支付操作执行完毕,释放锁成功!"); |
|||
} |
|||
} |
|||
return false; |
|||
} |
|||
} |
|||
@ -0,0 +1,245 @@ |
|||
package com.bnyer.img.service.impl; |
|||
|
|||
import cn.hutool.core.util.IdUtil; |
|||
import com.alibaba.fastjson.JSON; |
|||
import com.alibaba.fastjson.JSONArray; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.bnyer.common.core.exception.ServiceException; |
|||
import com.bnyer.img.config.YunmeiConfig; |
|||
import com.bnyer.img.constants.YunmeiConstant; |
|||
import com.bnyer.img.dto.CardBuyOrderDto; |
|||
import com.bnyer.img.dto.DirectBuyOrderDto; |
|||
import com.bnyer.img.dto.OrderNotifyDto; |
|||
import com.bnyer.img.enums.YunmeiCallbackEnum; |
|||
import com.bnyer.img.enums.YunmeiEnum; |
|||
import com.bnyer.img.service.YunmeiService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.codec.digest.DigestUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.web.client.RestTemplate; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
@Slf4j |
|||
public class YunmeiServiceImpl implements YunmeiService { |
|||
|
|||
@Autowired |
|||
private RestTemplate restTemplate; |
|||
|
|||
@Autowired |
|||
private YunmeiConfig yunmeiConfig; |
|||
|
|||
@Override |
|||
public JSONArray getProductList() { |
|||
long timeMillis = System.currentTimeMillis(); |
|||
String signContent = "app_id="+yunmeiConfig.getAppId()+"×tamp="+timeMillis |
|||
+"&version="+yunmeiConfig.getVersion()+"&app_secret="+yunmeiConfig.getAppSecret(); |
|||
log.debug("签名明文为:{}",signContent); |
|||
String sign = DigestUtils.md5Hex(signContent).toUpperCase(); |
|||
Map<String, Object> map = new HashMap<>(); |
|||
map.put("app_id",yunmeiConfig.getAppId()); |
|||
map.put("timestamp", timeMillis); |
|||
map.put("version", yunmeiConfig.getVersion()); |
|||
map.put("biz_content", ""); |
|||
map.put("sign", sign); |
|||
JSONObject result = restTemplate.postForObject(yunmeiConfig.getUrl() + YunmeiConstant.PRODUCT_LIST,map, JSONObject.class); |
|||
if(result != null && !result.getString("retcode").equals(YunmeiEnum.SUCCESS.getCode().toString())){ |
|||
log.error("###获取云媒产品列表失败!错误码为:{},错误信息为:{}",result.getString("retcode"),result.getString("retmsg")); |
|||
throw new ServiceException(result.getString("retmsg"),Integer.parseInt(result.getString("retcode"))); |
|||
} |
|||
return result.getJSONArray("data"); |
|||
} |
|||
|
|||
@Override |
|||
public JSONObject getProductDetails(Long skuId) { |
|||
long timeMillis = System.currentTimeMillis(); |
|||
Map<String,Object> bizMap = new HashMap<>(); |
|||
bizMap.put("sku_id",skuId); |
|||
String bizContent = JSON.toJSONString(bizMap); |
|||
String signContent = "app_id="+yunmeiConfig.getAppId()+"&biz_content="+ bizContent +"×tamp="+timeMillis |
|||
+"&version="+yunmeiConfig.getVersion()+"&app_secret="+yunmeiConfig.getAppSecret(); |
|||
log.debug("签名明文为:{}",signContent); |
|||
String sign = DigestUtils.md5Hex(signContent).toUpperCase(); |
|||
Map<String, Object> map = new HashMap<>(); |
|||
map.put("app_id",yunmeiConfig.getAppId()); |
|||
map.put("timestamp", timeMillis); |
|||
map.put("version", yunmeiConfig.getVersion()); |
|||
map.put("biz_content", bizContent); |
|||
map.put("sign",sign); |
|||
JSONObject result = restTemplate.postForObject(yunmeiConfig.getUrl() + YunmeiConstant.PRODUCT_DETAILS, map, JSONObject.class); |
|||
if(result != null){ |
|||
if(!result.getString("retcode").equals(YunmeiEnum.SUCCESS.getCode().toString())){ |
|||
log.error("###获取云媒产品【{}】详情失败!错误码为:{},错误信息为:{}",skuId,result.getString("retcode"),result.getString("retmsg")); |
|||
throw new ServiceException(result.getString("retmsg"),Integer.parseInt(result.getString("retcode"))); |
|||
} |
|||
if(result.getJSONObject("data") != null){ |
|||
return result.getJSONObject("data"); |
|||
}else{ |
|||
return null; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public JSONObject directBuyOrder(DirectBuyOrderDto params) { |
|||
long timeMillis = System.currentTimeMillis(); |
|||
String orderId = IdUtil.getSnowflakeNextIdStr(); |
|||
Map<String,Object> bizMap = new HashMap<>(); |
|||
bizMap.put("customer_order_no", orderId); |
|||
bizMap.put("sku_id", params.getSkuId()); |
|||
bizMap.put("order_type", 10); |
|||
bizMap.put("charge_acount_type", params.getChargeAccountType()); |
|||
bizMap.put("charge_acount_number", params.getChargeAccountNumber()); |
|||
String bizContent = JSON.toJSONString(bizMap); |
|||
String signContent = "app_id="+yunmeiConfig.getAppId()+"&biz_content="+ bizContent +"¬ify_url="+yunmeiConfig.getNotifyUrl() |
|||
+"×tamp="+timeMillis+"&version="+yunmeiConfig.getVersion()+"&app_secret="+yunmeiConfig.getAppSecret(); |
|||
log.debug("签名明文为:{}",signContent); |
|||
String sign = DigestUtils.md5Hex(signContent).toUpperCase(); |
|||
Map<String, Object> map = new HashMap<>(); |
|||
map.put("app_id",yunmeiConfig.getAppId()); |
|||
map.put("timestamp", timeMillis); |
|||
map.put("version", yunmeiConfig.getVersion()); |
|||
map.put("notify_url", yunmeiConfig.getNotifyUrl()); |
|||
map.put("biz_content", bizContent); |
|||
map.put("sign",sign); |
|||
JSONObject result = restTemplate.postForObject(yunmeiConfig.getUrl() + YunmeiConstant.CREATE_ORDER, map, JSONObject.class); |
|||
if(result != null){ |
|||
if(!result.getString("retcode").equals(YunmeiEnum.SUCCESS.getCode().toString())){ |
|||
log.error("###账号【{}】订单id【{}】直充下单产品【{}】失败!错误码为:{},错误信息为:{}",params.getChargeAccountNumber(),orderId,params.getSkuId(),result.getString("retcode"),result.getString("retmsg")); |
|||
throw new ServiceException(result.getString("retmsg"),Integer.parseInt(result.getString("retcode"))); |
|||
} |
|||
if(result.getJSONObject("data") != null){ |
|||
return result.getJSONObject("data"); |
|||
}else{ |
|||
return null; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public JSONObject cardBuyOrder(CardBuyOrderDto params) { |
|||
String orderId = IdUtil.getSnowflakeNextIdStr(); |
|||
long timeMillis = System.currentTimeMillis(); |
|||
Map<String,Object> bizMap = new HashMap<>(); |
|||
bizMap.put("customer_order_no", orderId); |
|||
bizMap.put("sku_id", params.getSkuId()); |
|||
bizMap.put("order_type", 20); |
|||
bizMap.put("buy_quantity", params.getBuyQuantity()); |
|||
String bizContent = JSON.toJSONString(bizMap); |
|||
String signContent = "app_id="+yunmeiConfig.getAppId()+"&biz_content="+ bizContent +"¬ify_url="+yunmeiConfig.getNotifyUrl() |
|||
+"×tamp="+timeMillis+"&version="+yunmeiConfig.getVersion()+"&app_secret="+yunmeiConfig.getAppSecret(); |
|||
log.debug("签名明文为:{}",signContent); |
|||
String sign = DigestUtils.md5Hex(signContent).toUpperCase(); |
|||
Map<String, Object> map = new HashMap<>(); |
|||
map.put("app_id",yunmeiConfig.getAppId()); |
|||
map.put("timestamp", timeMillis); |
|||
map.put("version", yunmeiConfig.getVersion()); |
|||
map.put("notify_url", yunmeiConfig.getNotifyUrl()); |
|||
map.put("biz_content", bizContent); |
|||
map.put("sign",sign); |
|||
JSONObject result = restTemplate.postForObject(yunmeiConfig.getUrl() + YunmeiConstant.CREATE_ORDER, map, JSONObject.class); |
|||
if(result != null){ |
|||
if(!result.getString("retcode").equals(YunmeiEnum.SUCCESS.getCode().toString())){ |
|||
log.error("###订单id【{}】卡密下单产品【{}】失败!错误码为:{},错误信息为:{}",orderId,params.getSkuId(),result.getString("retcode"),result.getString("retmsg")); |
|||
throw new ServiceException(result.getString("retmsg"),Integer.parseInt(result.getString("retcode"))); |
|||
} |
|||
if(result.getJSONObject("data") != null){ |
|||
return result.getJSONObject("data"); |
|||
}else{ |
|||
return null; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public JSONObject getOrderDetails(String orderNo) { |
|||
long timeMillis = System.currentTimeMillis(); |
|||
Map<String,Object> bizMap = new HashMap<>(); |
|||
bizMap.put("customer_order_no",orderNo); |
|||
String bizContent = JSON.toJSONString(bizMap); |
|||
String signContent = "app_id="+yunmeiConfig.getAppId()+"&biz_content="+ bizContent +"×tamp="+timeMillis |
|||
+"&version="+yunmeiConfig.getVersion()+"&app_secret="+yunmeiConfig.getAppSecret(); |
|||
log.debug("签名明文为:{}",signContent); |
|||
String sign = DigestUtils.md5Hex(signContent).toUpperCase(); |
|||
Map<String, Object> map = new HashMap<>(); |
|||
map.put("app_id",yunmeiConfig.getAppId()); |
|||
map.put("timestamp", timeMillis); |
|||
map.put("version", yunmeiConfig.getVersion()); |
|||
map.put("biz_content", bizContent); |
|||
map.put("sign",sign); |
|||
JSONObject result = restTemplate.postForObject(yunmeiConfig.getUrl() + YunmeiConstant.ORDER_DETAILS, map, JSONObject.class); |
|||
if(result != null){ |
|||
if(!result.getString("retcode").equals(YunmeiEnum.SUCCESS.getCode().toString())){ |
|||
log.error("###订单id【{}】查询订单详情失败!错误码为:{},错误信息为:{}",orderNo,result.getString("retcode"),result.getString("retmsg")); |
|||
throw new ServiceException(result.getString("retmsg"),Integer.parseInt(result.getString("retcode"))); |
|||
} |
|||
if(result.getJSONObject("data") != null){ |
|||
return result.getJSONObject("data"); |
|||
}else{ |
|||
return null; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public JSONObject getBalance() { |
|||
long timeMillis = System.currentTimeMillis(); |
|||
String signContent = "app_id="+yunmeiConfig.getAppId()+"×tamp="+timeMillis |
|||
+"&version="+yunmeiConfig.getVersion()+"&app_secret="+yunmeiConfig.getAppSecret(); |
|||
log.debug("签名明文为:{}",signContent); |
|||
String sign = DigestUtils.md5Hex(signContent).toUpperCase(); |
|||
Map<String, Object> map = new HashMap<>(); |
|||
map.put("app_id",yunmeiConfig.getAppId()); |
|||
map.put("timestamp", timeMillis); |
|||
map.put("version", yunmeiConfig.getVersion()); |
|||
map.put("biz_content", ""); |
|||
map.put("sign", sign); |
|||
JSONObject result = restTemplate.postForObject(yunmeiConfig.getUrl() + YunmeiConstant.AMOUNT,map, JSONObject.class); |
|||
if(result != null){ |
|||
if(!result.getString("retcode").equals(YunmeiEnum.SUCCESS.getCode().toString())){ |
|||
log.error("###查询商户余额失败!错误码为:{},错误信息为:{}",result.getString("retcode"),result.getString("retmsg")); |
|||
throw new ServiceException(result.getString("retmsg"),Integer.parseInt(result.getString("retcode"))); |
|||
} |
|||
if(result.getJSONObject("data") != null){ |
|||
return result.getJSONObject("data"); |
|||
}else{ |
|||
return null; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public String orderNotify(OrderNotifyDto params) { |
|||
//验证商户id
|
|||
if(!params.getApp_id().equals(yunmeiConfig.getAppId())){ |
|||
log.error("###云媒订单【{}】回调失败!商户id【{}】不匹配!",params.getCustomer_order_no(),params.getApp_id()); |
|||
return YunmeiCallbackEnum.FAIL.getValue(); |
|||
} |
|||
//验证签名
|
|||
String signContent = "app_id="+params.getApp_id()+"&customer_order_no="+params.getCustomer_order_no() |
|||
+"&description="+params.getDescription()+"×tamp="+params.getTimestamp() |
|||
+"&trade_state="+params.getTrade_state()+"&app_secret="+yunmeiConfig.getAppSecret(); |
|||
log.debug("签名明文为:{}",signContent); |
|||
String sign = DigestUtils.md5Hex(signContent).toUpperCase(); |
|||
if(!sign.equals(params.getSign())){ |
|||
log.error("###云媒订单【{}】回调失败!签名参数【{}】不匹配!",params.getCustomer_order_no(),JSON.toJSONString(params)); |
|||
return YunmeiCallbackEnum.FAIL.getValue(); |
|||
} |
|||
//验证订单状态
|
|||
if(!params.getTrade_state().equals(YunmeiCallbackEnum.SUCCESS.getValue())){ |
|||
log.error("###云媒回调订单【{}】失败!错误信息为【{}】",params.getCustomer_order_no(),params.getDescription()); |
|||
return YunmeiCallbackEnum.FAIL.getValue(); |
|||
} |
|||
//TODO 回调成功,修改订单状态
|
|||
log.info("###云媒订单【{}】回调成功!",params.getCustomer_order_no()); |
|||
return YunmeiCallbackEnum.SUCCESS.getValue(); |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
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 CreatorFollowVo implements Serializable { |
|||
|
|||
@ApiModelProperty(value="id") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty(value="搜索码") |
|||
private String scanCode; |
|||
|
|||
@ApiModelProperty(value="等级名称") |
|||
private String levelName; |
|||
|
|||
@ApiModelProperty(value="等级图标") |
|||
private String levelIcon; |
|||
|
|||
@ApiModelProperty(value="是否热门") |
|||
private String isHot; |
|||
|
|||
@ApiModelProperty(value="头像img地址") |
|||
private String img; |
|||
|
|||
@ApiModelProperty(value="序号") |
|||
private Integer sort; |
|||
|
|||
@ApiModelProperty(value="简介") |
|||
private String intro; |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue