ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/PromotionVideo.java
New file @@ -0,0 +1,61 @@ package com.ruoyi.system.api.domain; import com.baomidou.mybatisplus.annotation.*; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import java.io.Serializable; import java.time.LocalDateTime; /** * <p> * 视频表 * </p> * * @author mitao * @since 2024-05-16 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("t_promotion_video") @ApiModel(value = "PromotionVideo对象", description = "视频表") public class PromotionVideo implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "视频id") @TableId(value = "id", type = IdType.ASSIGN_ID) private Long id; @ApiModelProperty(value = "视频名称") private String videoName; @ApiModelProperty(value = "视频链接") private String videoUrl; @ApiModelProperty(value = "创建者") @TableField(value = "create_by", fill = FieldFill.INSERT) private String createBy; @ApiModelProperty(value = "创建时间") @TableField(value = "create_time", fill = FieldFill.INSERT) private LocalDateTime createTime; @ApiModelProperty(value = "更新者") @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) private String updateBy; @ApiModelProperty(value = "更新时间") @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) private LocalDateTime updateTime; @ApiModelProperty(value = "删除标志(0代表存在 1代表删除)") @TableLogic private Integer delFlag; } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.core.annotation.Excel; @@ -22,6 +23,7 @@ * * @author ruoyi */ @Data public class SysUser extends BaseEntity { private static final long serialVersionUID = 1L; @@ -62,6 +64,9 @@ /** 用户头像 */ private String avatar; /** 密码 */ private String userType; /** 密码 */ @NotBlank(message = "密码不能为空") @@ -365,6 +370,10 @@ { this.roleId = roleId; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/PromotionFallbackFactory.java
@@ -1,7 +1,17 @@ package com.ruoyi.system.api.factory; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.GoodsSku; import com.ruoyi.system.api.domain.PromotionVideo; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.feignClient.GoodsSkuClient; import com.ruoyi.system.api.feignClient.PromotionClient; import com.ruoyi.system.api.model.CompanySysUserReq; import com.ruoyi.system.api.model.CompanyUserListVo; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.web.bind.annotation.PathVariable; import java.util.List; /** * @author mitao @@ -11,6 +21,18 @@ @Override public PromotionClient create(Throwable cause) { return null; return new PromotionClient(){ @Override public R<List<PromotionVideo>> getPromotionVideoList() { return R.fail("通过视频集合查询用户失败:" + cause.getMessage()); } @Override public R<PromotionVideo> getPromotionVideoOne(Integer promotionVideoId) { return R.fail("获取视频信息失败:" + cause.getMessage()); } }; } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/GoodsSkuClient.java
@@ -8,11 +8,13 @@ import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @FeignClient(contextId = "GoodsSkuClient", value = ServiceNameConstants.RUOYI_GOODS, fallbackFactory = GoodsSkuFactory.class) public interface GoodsSkuClient { @GetMapping("/goods-sku/getGoodsSkuOne/{goodsSkuId}") R<GoodsSku> getGoodsSkuOne(@PathVariable("goodsSkuId") Long goodsSkuId); @PostMapping("/goods-sku/getGoodsSkuOne") R<GoodsSku> getGoodsSkuOne(@RequestBody Long goodsSkuId); } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/PromotionClient.java
@@ -1,10 +1,24 @@ package com.ruoyi.system.api.feignClient; import com.ruoyi.common.core.constant.ServiceNameConstants; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.PromotionVideo; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.factory.PromotionFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @FeignClient(contextId = "promotionClient", value = ServiceNameConstants.RUOYI_PROMOTION, fallbackFactory = PromotionFallbackFactory.class) public interface PromotionClient { @PostMapping("/promotion-video/getPromotionVideoList") R<List<PromotionVideo>> getPromotionVideoList(); @PostMapping("/promotion-video/getPromotionVideoOne") R<PromotionVideo> getPromotionVideoOne(Long promotionVideoId); }