!257 通过注解增加多租户缓存
parent
239c38cf64
commit
b5474d1d84
@ -1,34 +0,0 @@
|
|||||||
package cn.iocoder.mall.product.application.convert;
|
|
||||||
|
|
||||||
import cn.iocoder.mall.product.api.bo.ProductAttrBO;
|
|
||||||
import cn.iocoder.mall.product.api.bo.ProductAttrPageBO;
|
|
||||||
import cn.iocoder.mall.product.api.bo.ProductAttrSimpleBO;
|
|
||||||
import cn.iocoder.mall.product.api.bo.ProductAttrValueBO;
|
|
||||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrPageVO;
|
|
||||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrSimpleVO;
|
|
||||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrVO;
|
|
||||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductAttrValueVO;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.Mappings;
|
|
||||||
import org.mapstruct.factory.Mappers;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface ProductAttrConvert {
|
|
||||||
|
|
||||||
ProductAttrConvert INSTANCE = Mappers.getMapper(ProductAttrConvert.class);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
AdminsProductAttrPageVO convert2(ProductAttrPageBO result);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
List<AdminsProductAttrSimpleVO> convert(List<ProductAttrSimpleBO> result);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
AdminsProductAttrVO convert3(ProductAttrBO productAttrBO);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
AdminsProductAttrValueVO convert4(ProductAttrValueBO productAttrValueBO);
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
package cn.iocoder.mall.product.application.convert;
|
|
||||||
|
|
||||||
import cn.iocoder.mall.product.api.bo.ProductSpuBO;
|
|
||||||
import cn.iocoder.mall.product.api.bo.ProductSpuDetailBO;
|
|
||||||
import cn.iocoder.mall.product.api.bo.ProductSpuPageBO;
|
|
||||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuDetailVO;
|
|
||||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuPageVO;
|
|
||||||
import cn.iocoder.mall.product.application.vo.admins.AdminsProductSpuVO;
|
|
||||||
import cn.iocoder.mall.product.application.vo.users.UsersProductSpuDetailVO;
|
|
||||||
import cn.iocoder.mall.product.application.vo.users.UsersProductSpuPageVO;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.Mappings;
|
|
||||||
import org.mapstruct.factory.Mappers;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface ProductSpuConvert {
|
|
||||||
|
|
||||||
ProductSpuConvert INSTANCE = Mappers.getMapper(ProductSpuConvert.class);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
AdminsProductSpuDetailVO convert(ProductSpuDetailBO productSpuDetailBO);
|
|
||||||
|
|
||||||
// @Mappings({})
|
|
||||||
// CommonResult<AdminsProductSpuDetailVO> convert(CommonResult<ProductSpuDetailBO> result);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
AdminsProductSpuPageVO convert2(ProductSpuPageBO result);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
List<AdminsProductSpuVO> convert3(List<ProductSpuBO> result);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
UsersProductSpuPageVO convert3(ProductSpuPageBO result);
|
|
||||||
|
|
||||||
@Mappings({})
|
|
||||||
UsersProductSpuDetailVO convert4(ProductSpuDetailBO result);
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
package cn.iocoder.mall.promotion.api.enums.activity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 促销活动状态枚举
|
|
||||||
*/
|
|
||||||
public enum PromotionActivityStatusEnum {
|
|
||||||
|
|
||||||
WAIT(10, "未开始"),
|
|
||||||
RUN(20, "进行中"),
|
|
||||||
END(30, "已结束"),
|
|
||||||
/**
|
|
||||||
* 1. WAIT、RUN、END 可以转换成 INVALID 状态。
|
|
||||||
* 2. INVALID 只可以转换成 DELETED 状态。
|
|
||||||
*/
|
|
||||||
INVALID(40, "已撤销"),
|
|
||||||
DELETED(50, "已删除"),
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态值
|
|
||||||
*/
|
|
||||||
private final Integer value;
|
|
||||||
/**
|
|
||||||
* 状态名
|
|
||||||
*/
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
PromotionActivityStatusEnum(Integer value, String name) {
|
|
||||||
this.value = value;
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
package cn.iocoder.mall.promotion.api.enums.activity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 促销活动类型枚举
|
|
||||||
*/
|
|
||||||
public enum PromotionActivityTypeEnum {
|
|
||||||
|
|
||||||
TIME_LIMITED_DISCOUNT(1, "限时折扣"),
|
|
||||||
FULL_PRIVILEGE(2, "满减送"),
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类型值
|
|
||||||
*/
|
|
||||||
private final Integer value;
|
|
||||||
/**
|
|
||||||
* 类型名
|
|
||||||
*/
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
PromotionActivityTypeEnum(Integer value, String name) {
|
|
||||||
this.value = value;
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
package cn.iocoder.mall.promotionservice.config;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@EnableAsync(proxyTargetClass = true) // 开启 Spring Async 异步的功能
|
|
||||||
public class AsyncConfiguration {
|
|
||||||
}
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
package cn.iocoder.mall.promotionservice.config;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
|
|
||||||
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@MapperScan("cn.iocoder.mall.promotionservice.dal.mysql.mapper") // 扫描对应的 Mapper 接口
|
|
||||||
@EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理。
|
|
||||||
public class DatabaseConfiguration {
|
|
||||||
|
|
||||||
// 数据库连接池 Druid
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public ISqlInjector sqlInjector() {
|
|
||||||
return new DefaultSqlInjector(); // MyBatis Plus 逻辑删除
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public PaginationInterceptor paginationInterceptor() {
|
|
||||||
return new PaginationInterceptor(); // MyBatis Plus 分页插件
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
package cn.iocoder.mall.promotionservice.dal.mysql.dataobject.banner;
|
|
||||||
|
|
||||||
import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Banner 广告页
|
|
||||||
*/
|
|
||||||
@TableName("banner")
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class BannerDO extends DeletableDO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编号
|
|
||||||
*/
|
|
||||||
private Integer id;
|
|
||||||
/**
|
|
||||||
* 标题
|
|
||||||
*/
|
|
||||||
private String title;
|
|
||||||
/**
|
|
||||||
* 跳转链接
|
|
||||||
*/
|
|
||||||
private String url;
|
|
||||||
/**
|
|
||||||
* 图片链接
|
|
||||||
*/
|
|
||||||
private String picUrl;
|
|
||||||
/**
|
|
||||||
* 排序
|
|
||||||
*/
|
|
||||||
private Integer sort;
|
|
||||||
/**
|
|
||||||
* 状态
|
|
||||||
*
|
|
||||||
* {@link cn.iocoder.common.framework.enums.CommonStatusEnum}
|
|
||||||
*/
|
|
||||||
private Integer status;
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String memo;
|
|
||||||
|
|
||||||
// TODO 芋艿 点击次数。&& 其他数据相关
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
package cn.iocoder.mall.promotionservice.dal.mysql.mapper.banner;
|
|
||||||
|
|
||||||
import cn.iocoder.mall.mybatis.core.query.QueryWrapperX;
|
|
||||||
import cn.iocoder.mall.promotion.api.rpc.banner.dto.BannerListReqDTO;
|
|
||||||
import cn.iocoder.mall.promotion.api.rpc.banner.dto.BannerPageReqDTO;
|
|
||||||
import cn.iocoder.mall.promotionservice.dal.mysql.dataobject.banner.BannerDO;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public interface BannerMapper extends BaseMapper<BannerDO> {
|
|
||||||
|
|
||||||
default List<BannerDO> selectList(BannerListReqDTO listReqDTO) {
|
|
||||||
return selectList(new QueryWrapperX<BannerDO>().eqIfPresent("status", listReqDTO.getStatus()));
|
|
||||||
}
|
|
||||||
|
|
||||||
default IPage<BannerDO> selectPage(BannerPageReqDTO pageReqDTO) {
|
|
||||||
return selectPage(new Page<>(pageReqDTO.getPageNo(), pageReqDTO.getPageSize()),
|
|
||||||
new QueryWrapperX<BannerDO>().likeIfPresent("title", pageReqDTO.getTitle()));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in new issue