feat(新增): activity基础环境搭建
This commit is contained in:
parent
71c9b53fa1
commit
5e5b2d4854
|
@ -19,6 +19,7 @@
|
||||||
<file url="file://$PROJECT_DIR$/service-client/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/service-client/src/main/resources" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/service-gateway/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/service-gateway/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/service/service-acl/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/service/service-acl/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/service/service-activity/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/service/service-product/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/service/service-product/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/service/service-search/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/service/service-search/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/service/service-sys/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/service/service-sys/src/main/java" charset="UTF-8" />
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.generator.config.GlobalConfig;
|
||||||
import com.baomidou.mybatisplus.generator.config.PackageConfig;
|
import com.baomidou.mybatisplus.generator.config.PackageConfig;
|
||||||
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
|
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
|
||||||
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
|
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class CodeGet {
|
public class CodeGet {
|
||||||
|
|
||||||
|
@ -17,7 +18,8 @@ public class CodeGet {
|
||||||
// 2、全局配置
|
// 2、全局配置
|
||||||
// 全局配置
|
// 全局配置
|
||||||
GlobalConfig gc = new GlobalConfig();
|
GlobalConfig gc = new GlobalConfig();
|
||||||
gc.setOutputDir("F:\\File\\Java\\ssyx\\guigu-ssyx-parent\\service\\service-product" + "/src/main/java");
|
// TODO 需要修改路径名称
|
||||||
|
gc.setOutputDir("G:\\File\\Java\\ssyx\\ssyx-parent\\service\\service-activity" + "/src/main/java");
|
||||||
|
|
||||||
gc.setServiceName("%sService"); // 去掉Service接口的首字母I
|
gc.setServiceName("%sService"); // 去掉Service接口的首字母I
|
||||||
gc.setAuthor("bunny");
|
gc.setAuthor("bunny");
|
||||||
|
@ -26,7 +28,8 @@ public class CodeGet {
|
||||||
|
|
||||||
// 3、数据源配置
|
// 3、数据源配置
|
||||||
DataSourceConfig dsc = new DataSourceConfig();
|
DataSourceConfig dsc = new DataSourceConfig();
|
||||||
dsc.setUrl("jdbc:mysql://106.15.251.123:3305/shequ-product?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true");
|
// TODO 需要修改数据库
|
||||||
|
dsc.setUrl("jdbc:mysql://106.15.251.123:3305/shequ-activity?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true");
|
||||||
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
|
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
|
||||||
dsc.setUsername("root");
|
dsc.setUsername("root");
|
||||||
dsc.setPassword("02120212");
|
dsc.setPassword("02120212");
|
||||||
|
@ -36,26 +39,32 @@ public class CodeGet {
|
||||||
// 4、包配置
|
// 4、包配置
|
||||||
PackageConfig pc = new PackageConfig();
|
PackageConfig pc = new PackageConfig();
|
||||||
pc.setParent("com.atguigu.ssyx");
|
pc.setParent("com.atguigu.ssyx");
|
||||||
pc.setModuleName("product"); // 模块名
|
// TODO 需要修改模块名
|
||||||
|
pc.setModuleName("activity");
|
||||||
pc.setController("controller");
|
pc.setController("controller");
|
||||||
pc.setService("service");
|
pc.setService("service");
|
||||||
pc.setMapper("mapper");
|
pc.setMapper("mapper");
|
||||||
mpg.setPackageInfo(pc);
|
mpg.setPackageInfo(pc);
|
||||||
|
|
||||||
// 5、策略配置
|
// 5、策略配置
|
||||||
StrategyConfig strategy = new StrategyConfig();
|
StrategyConfig strategy = getStrategyConfig();
|
||||||
|
|
||||||
strategy.setInclude("attr", "attr_group", "base_category_trademark", "category", "comment", "comment_replay", "mq_repeat_record",
|
|
||||||
"region_ware", "sku_attr_value", "sku_detail", "sku_image", "sku_info", "sku_poster", "sku_stock_history", "ware");
|
|
||||||
strategy.setNaming(NamingStrategy.underline_to_camel);// 数据库表映射到实体的命名策略
|
|
||||||
strategy.setColumnNaming(NamingStrategy.underline_to_camel);// 数据库表字段映射到实体的命名策略
|
|
||||||
strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作
|
|
||||||
strategy.setRestControllerStyle(true); // restful api风格控制器
|
|
||||||
strategy.setControllerMappingHyphenStyle(true); // url中驼峰转连字符
|
|
||||||
|
|
||||||
mpg.setStrategy(strategy);
|
mpg.setStrategy(strategy);
|
||||||
|
|
||||||
// 6、执行
|
// 6、执行
|
||||||
mpg.execute();
|
mpg.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private static StrategyConfig getStrategyConfig() {
|
||||||
|
StrategyConfig strategy = new StrategyConfig();
|
||||||
|
|
||||||
|
strategy.setInclude("activity_info", "activity_rule", "activity_sku", "coupon_info", "coupon_range", "coupon_use");
|
||||||
|
strategy.setNaming(NamingStrategy.underline_to_camel);// 数据库表映射到实体的命名策略
|
||||||
|
strategy.setColumnNaming(NamingStrategy.underline_to_camel);// 数据库表字段映射到实体的命名策略
|
||||||
|
strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作
|
||||||
|
strategy.setRestControllerStyle(true); // restful api风格控制器
|
||||||
|
strategy.setControllerMappingHyphenStyle(true); // url中驼峰转连字符
|
||||||
|
return strategy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,16 +19,14 @@ import lombok.Data;
|
||||||
@ApiModel(description = "用户角色")
|
@ApiModel(description = "用户角色")
|
||||||
@TableName("admin_role")
|
@TableName("admin_role")
|
||||||
public class AdminRole extends BaseEntity {
|
public class AdminRole extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "角色id")
|
|
||||||
@TableField("role_id")
|
|
||||||
private Long roleId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "用户id")
|
@ApiModelProperty(value = "角色id")
|
||||||
@TableField("admin_id")
|
@TableField("role_id")
|
||||||
private Long adminId;
|
private Long roleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户id")
|
||||||
|
@TableField("admin_id")
|
||||||
|
private Long adminId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,78 +13,77 @@ import java.math.BigDecimal;
|
||||||
@ApiModel(description = "SkuInfo")
|
@ApiModel(description = "SkuInfo")
|
||||||
@TableName("sku_info")
|
@TableName("sku_info")
|
||||||
public class SkuInfo extends BaseEntity {
|
public class SkuInfo extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
@ApiModelProperty(value = "分类id")
|
||||||
|
@TableField("category_id")
|
||||||
|
private Long categoryId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "分类id")
|
@ApiModelProperty(value = "平台属性分组id")
|
||||||
@TableField("category_id")
|
@TableField("attr_group_id")
|
||||||
private Long categoryId;
|
private Long attrGroupId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "平台属性分组id")
|
@ApiModelProperty(value = "商品类型:0->普通商品 1->秒杀商品")
|
||||||
@TableField("attr_group_id")
|
@TableField("sku_type")
|
||||||
private Long attrGroupId;
|
private Integer skuType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品类型:0->普通商品 1->秒杀商品")
|
@ApiModelProperty(value = "spu名称")
|
||||||
@TableField("sku_type")
|
@TableField("sku_name")
|
||||||
private Integer skuType;
|
private String skuName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "spu名称")
|
@ApiModelProperty(value = "展示图片")
|
||||||
@TableField("sku_name")
|
@TableField("img_url")
|
||||||
private String skuName;
|
private String imgUrl;
|
||||||
|
|
||||||
@ApiModelProperty(value = "展示图片")
|
@ApiModelProperty(value = "限购个数/每天(0:不限购)")
|
||||||
@TableField("img_url")
|
@TableField("per_limit")
|
||||||
private String imgUrl;
|
private Integer perLimit;
|
||||||
|
|
||||||
@ApiModelProperty(value = "限购个数/每天(0:不限购)")
|
@ApiModelProperty(value = "上架状态:0->下架;1->上架")
|
||||||
@TableField("per_limit")
|
@TableField("publish_status")
|
||||||
private Integer perLimit;
|
private Integer publishStatus;
|
||||||
|
|
||||||
@ApiModelProperty(value = "上架状态:0->下架;1->上架")
|
@ApiModelProperty(value = "审核状态:0->未审核;1->审核通过")
|
||||||
@TableField("publish_status")
|
@TableField("check_status")
|
||||||
private Integer publishStatus;
|
private Integer checkStatus;
|
||||||
|
|
||||||
@ApiModelProperty(value = "审核状态:0->未审核;1->审核通过")
|
@ApiModelProperty(value = "是否新人专享:0->否;1->是")
|
||||||
@TableField("check_status")
|
@TableField("is_new_person")
|
||||||
private Integer checkStatus;
|
private Integer isNewPerson;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否新人专享:0->否;1->是")
|
@ApiModelProperty(value = "排序")
|
||||||
@TableField("is_new_person")
|
@TableField("sort")
|
||||||
private Integer isNewPerson;
|
private Integer sort;
|
||||||
|
|
||||||
@ApiModelProperty(value = "排序")
|
@ApiModelProperty(value = "sku编码")
|
||||||
@TableField("sort")
|
@TableField("sku_code")
|
||||||
private Integer sort;
|
private String skuCode;
|
||||||
|
|
||||||
@ApiModelProperty(value = "sku编码")
|
@ApiModelProperty(value = "价格")
|
||||||
@TableField("sku_code")
|
@TableField("price")
|
||||||
private String skuCode;
|
private BigDecimal price;
|
||||||
|
|
||||||
@ApiModelProperty(value = "价格")
|
@ApiModelProperty(value = "市场价")
|
||||||
@TableField("price")
|
@TableField("market_price")
|
||||||
private BigDecimal price;
|
private BigDecimal marketPrice;
|
||||||
|
|
||||||
@ApiModelProperty(value = "市场价")
|
@ApiModelProperty(value = "库存")
|
||||||
@TableField("market_price")
|
@TableField("stock")
|
||||||
private BigDecimal marketPrice;
|
private Integer stock;
|
||||||
|
|
||||||
@ApiModelProperty(value = "库存")
|
@ApiModelProperty(value = "锁定库存")
|
||||||
@TableField("stock")
|
@TableField("lock_stock")
|
||||||
private Integer stock;
|
private Integer lockStock;
|
||||||
|
|
||||||
@ApiModelProperty(value = "锁定库存")
|
@ApiModelProperty(value = "预警库存")
|
||||||
@TableField("lock_stock")
|
@TableField("low_stock")
|
||||||
private Integer lockStock;
|
private Integer lowStock;
|
||||||
|
|
||||||
@ApiModelProperty(value = "预警库存")
|
@ApiModelProperty(value = "销量")
|
||||||
@TableField("low_stock")
|
@TableField("sale")
|
||||||
private Integer lowStock;
|
private Integer sale;
|
||||||
|
|
||||||
@ApiModelProperty(value = "销量")
|
@ApiModelProperty(value = "仓库")
|
||||||
@TableField("sale")
|
@TableField("ware_id")
|
||||||
private Integer sale;
|
private Long wareId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "仓库")
|
|
||||||
@TableField("ware_id")
|
|
||||||
private Long wareId;
|
|
||||||
}
|
}
|
|
@ -1,22 +1,16 @@
|
||||||
package com.atguigu.ssyx.model.search;
|
package com.atguigu.ssyx.model.search;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.data.annotation.Id;
|
import org.springframework.data.annotation.Id;
|
||||||
import org.springframework.data.elasticsearch.annotations.DateFormat;
|
|
||||||
import org.springframework.data.elasticsearch.annotations.Document;
|
import org.springframework.data.elasticsearch.annotations.Document;
|
||||||
import org.springframework.data.elasticsearch.annotations.Field;
|
import org.springframework.data.elasticsearch.annotations.Field;
|
||||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Document(indexName = "skues" ,shards = 3,replicas = 1)
|
@Document(indexName = "skues", shards = 3, replicas = 1)
|
||||||
public class SkuEs {
|
public class SkuEs {
|
||||||
|
|
||||||
// 商品Id= skuId
|
// 商品Id= skuId
|
||||||
@Id
|
@Id
|
||||||
private Long id;
|
private Long id;
|
||||||
|
@ -64,5 +58,4 @@ public class SkuEs {
|
||||||
|
|
||||||
@Field(type = FieldType.Object, index = false)
|
@Field(type = FieldType.Object, index = false)
|
||||||
private List<String> ruleList;
|
private List<String> ruleList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,25 @@
|
||||||
package com.atguigu.ssyx.vo.product;
|
package com.atguigu.ssyx.vo.product;
|
||||||
|
|
||||||
import com.atguigu.ssyx.model.product.*;
|
|
||||||
import com.atguigu.ssyx.model.product.SkuAttrValue;
|
import com.atguigu.ssyx.model.product.SkuAttrValue;
|
||||||
import com.atguigu.ssyx.model.product.SkuImage;
|
import com.atguigu.ssyx.model.product.SkuImage;
|
||||||
import com.atguigu.ssyx.model.product.SkuInfo;
|
import com.atguigu.ssyx.model.product.SkuInfo;
|
||||||
import com.atguigu.ssyx.model.product.SkuPoster;
|
import com.atguigu.ssyx.model.product.SkuPoster;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class SkuInfoVo extends SkuInfo {
|
public class SkuInfoVo extends SkuInfo {
|
||||||
|
@ApiModelProperty(value = "海报列表")
|
||||||
|
private List<SkuPoster> skuPosterList;
|
||||||
|
|
||||||
@ApiModelProperty(value = "海报列表")
|
@ApiModelProperty(value = "属性值")
|
||||||
private List<SkuPoster> skuPosterList;
|
private List<SkuAttrValue> skuAttrValueList;
|
||||||
|
|
||||||
@ApiModelProperty(value = "属性值")
|
|
||||||
private List<SkuAttrValue> skuAttrValueList;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "图片")
|
|
||||||
private List<SkuImage> skuImagesList;
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片")
|
||||||
|
private List<SkuImage> skuImagesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
<module>service-sys</module>
|
<module>service-sys</module>
|
||||||
<module>service-product</module>
|
<module>service-product</module>
|
||||||
<module>service-search</module>
|
<module>service-search</module>
|
||||||
|
<module>service-activity</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.atguigu.ssyx.acl.controller;
|
package com.atguigu.ssyx.acl.controller;
|
||||||
|
|
||||||
import com.atguigu.ssyx.acl.service.AdminService;
|
import com.atguigu.ssyx.acl.service.AdminService;
|
||||||
import com.atguigu.ssyx.acl.service.RoleService;
|
|
||||||
import com.atguigu.ssyx.common.result.Result;
|
import com.atguigu.ssyx.common.result.Result;
|
||||||
import com.atguigu.ssyx.model.acl.Admin;
|
import com.atguigu.ssyx.model.acl.Admin;
|
||||||
import com.atguigu.ssyx.vo.acl.AdminQueryVo;
|
import com.atguigu.ssyx.vo.acl.AdminQueryVo;
|
||||||
|
@ -20,8 +19,6 @@ import java.util.List;
|
||||||
public class AdminController {
|
public class AdminController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private AdminService adminService;
|
private AdminService adminService;
|
||||||
@Autowired
|
|
||||||
private RoleService roleService;
|
|
||||||
|
|
||||||
@ApiOperation(value = "获取管理用户分页列表")
|
@ApiOperation(value = "获取管理用户分页列表")
|
||||||
@GetMapping("{page}/{limit}")
|
@GetMapping("{page}/{limit}")
|
||||||
|
|
|
@ -30,9 +30,13 @@ public class AdminRoleServiceImpl extends ServiceImpl<AdminRoleMapper, AdminRole
|
||||||
public AssignAdminRoleVo findRoleByUserId(Long adminId) {
|
public AssignAdminRoleVo findRoleByUserId(Long adminId) {
|
||||||
// 查询所有的角色
|
// 查询所有的角色
|
||||||
List<Role> allRolesList = roleService.list(null);
|
List<Role> allRolesList = roleService.list(null);
|
||||||
|
// 根据用户id查询角色
|
||||||
List<Role> roleList = baseMapper.findRoleByUserId(adminId);
|
List<Role> roleList = baseMapper.findRoleByUserId(adminId);
|
||||||
|
|
||||||
return AssignAdminRoleVo.builder().assignRoles(roleList).allRolesList(allRolesList).build();
|
// 返回全部角色和当前用户查询的角色
|
||||||
|
return AssignAdminRoleVo.builder()
|
||||||
|
.assignRoles(roleList)
|
||||||
|
.allRolesList(allRolesList).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,17 +48,20 @@ public class AdminRoleServiceImpl extends ServiceImpl<AdminRoleMapper, AdminRole
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void saveUserRoleShip(Long adminId, Long[] roleIds) {
|
public void saveUserRoleShip(Long adminId, Long[] roleIds) {
|
||||||
|
// 先删除这个用户id下所有的角色信息
|
||||||
remove(Wrappers.<AdminRole>lambdaQuery().eq(AdminRole::getAdminId, adminId));
|
remove(Wrappers.<AdminRole>lambdaQuery().eq(AdminRole::getAdminId, adminId));
|
||||||
|
// 创建集合,遍历完成后一次性插入
|
||||||
ArrayList<AdminRole> adminRoles = new ArrayList<>();
|
ArrayList<AdminRole> adminRoles = new ArrayList<>();
|
||||||
|
|
||||||
// 循环遍历并插入
|
// 循环遍历并插入
|
||||||
for (Long roleId : roleIds) {
|
for (Long roleId : roleIds) {
|
||||||
|
// 为用户设置角色id
|
||||||
AdminRole adminRole = new AdminRole();
|
AdminRole adminRole = new AdminRole();
|
||||||
adminRole.setAdminId(adminId);
|
adminRole.setAdminId(adminId);
|
||||||
adminRole.setRoleId(roleId);
|
adminRole.setRoleId(roleId);
|
||||||
adminRoles.add(adminRole);
|
adminRoles.add(adminRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 插入整体数据
|
// 插入整体数据
|
||||||
saveBatch(adminRoles);
|
saveBatch(adminRoles);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,10 +24,8 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Permission> queryAllMenu() {
|
public List<Permission> queryAllMenu() {
|
||||||
// 查询所有菜单
|
|
||||||
List<Permission> permissions = baseMapper.selectList(null);
|
|
||||||
// 转换要求数据格式
|
// 转换要求数据格式
|
||||||
return PermissionHelper.buildPermissions(permissions);
|
return PermissionHelper.buildPermissions(list());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
FROM openjdk:17
|
||||||
|
MAINTAINER bunny
|
||||||
|
|
||||||
|
#系统编码
|
||||||
|
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
||||||
|
|
||||||
|
# 设置时区,构建镜像时执行的命令
|
||||||
|
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||||
|
RUN echo "Asia/Shanghai" > /etc/timezone
|
||||||
|
|
||||||
|
# 设定工作目录
|
||||||
|
WORKDIR /home/bunny
|
||||||
|
|
||||||
|
# 复制jar包
|
||||||
|
COPY target/*.jar /home/bunny/app.jar
|
||||||
|
|
||||||
|
#启动容器时的进程
|
||||||
|
ENTRYPOINT ["java","-jar","/home/bunny/app.jar"]
|
||||||
|
|
||||||
|
#暴露 8080 端口
|
||||||
|
EXPOSE 8080
|
|
@ -0,0 +1,23 @@
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.atguigu</groupId>
|
||||||
|
<artifactId>service</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>service-activity</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>service-activity</name>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.atguigu.ssyx.activity;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@ComponentScan(basePackages = {
|
||||||
|
"com.atguigu.ssyx.common",
|
||||||
|
"com.atguigu.ssyx.activity"})
|
||||||
|
@EnableTransactionManagement
|
||||||
|
public class ServiceActivityApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(ServiceActivityApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.atguigu.ssyx.activity.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.atguigu.ssyx.activity.service.ActivityInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 活动表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author bunny
|
||||||
|
* @since 2024-04-04
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/admin/activity/activityInfo")
|
||||||
|
public class ActivityInfoController {
|
||||||
|
@Autowired
|
||||||
|
private ActivityInfoService activityInfoService;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.atguigu.ssyx.activity.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 优惠券信息 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author bunny
|
||||||
|
* @since 2024-04-04
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/activity/coupon-info")
|
||||||
|
public class CouponInfoController {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.atguigu.ssyx.activity.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.ssyx.model.activity.ActivityInfo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 活动表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author bunny
|
||||||
|
* @since 2024-04-04
|
||||||
|
*/
|
||||||
|
public interface ActivityInfoMapper extends BaseMapper<ActivityInfo> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.atguigu.ssyx.activity.mapper;
|
||||||
|
|
||||||
|
import com.atguigu.ssyx.model.activity.CouponInfo;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 优惠券信息 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author bunny
|
||||||
|
* @since 2024-04-04
|
||||||
|
*/
|
||||||
|
public interface CouponInfoMapper extends BaseMapper<CouponInfo> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.atguigu.ssyx.activity.service;
|
||||||
|
|
||||||
|
import com.atguigu.ssyx.model.activity.ActivityInfo;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 活动表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author bunny
|
||||||
|
* @since 2024-04-04
|
||||||
|
*/
|
||||||
|
public interface ActivityInfoService extends IService<ActivityInfo> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.atguigu.ssyx.activity.service;
|
||||||
|
|
||||||
|
import com.atguigu.ssyx.model.activity.CouponInfo;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 优惠券信息 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author bunny
|
||||||
|
* @since 2024-04-04
|
||||||
|
*/
|
||||||
|
public interface CouponInfoService extends IService<CouponInfo> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.atguigu.ssyx.activity.service.impl;
|
||||||
|
|
||||||
|
import com.atguigu.ssyx.activity.mapper.ActivityInfoMapper;
|
||||||
|
import com.atguigu.ssyx.activity.service.ActivityInfoService;
|
||||||
|
import com.atguigu.ssyx.model.activity.ActivityInfo;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 活动表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author bunny
|
||||||
|
* @since 2024-04-04
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ActivityInfoServiceImpl extends ServiceImpl<ActivityInfoMapper, ActivityInfo> implements ActivityInfoService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.atguigu.ssyx.activity.service.impl;
|
||||||
|
|
||||||
|
import com.atguigu.ssyx.activity.mapper.CouponInfoMapper;
|
||||||
|
import com.atguigu.ssyx.activity.service.CouponInfoService;
|
||||||
|
import com.atguigu.ssyx.model.activity.CouponInfo;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 优惠券信息 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author bunny
|
||||||
|
* @since 2024-04-04
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponInfo> implements CouponInfoService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
server:
|
||||||
|
port: 8204
|
||||||
|
|
||||||
|
bunny:
|
||||||
|
datasource:
|
||||||
|
host: 106.15.251.123
|
||||||
|
port: 3305
|
||||||
|
sqlData: shequ-activity
|
||||||
|
username: root
|
||||||
|
password: "02120212"
|
||||||
|
|
||||||
|
nacos:
|
||||||
|
server-addr: z-bunny.cn:8848
|
||||||
|
discovery:
|
||||||
|
namespace: ssyx
|
|
@ -0,0 +1,54 @@
|
||||||
|
server:
|
||||||
|
port: 8204
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: service-activity
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
|
|
||||||
|
datasource:
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://${bunny.datasource.host}:${bunny.datasource.port}/${bunny.datasource.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true
|
||||||
|
username: ${bunny.datasource.username}
|
||||||
|
password: ${bunny.datasource.password}
|
||||||
|
|
||||||
|
cloud:
|
||||||
|
sentinel:
|
||||||
|
log:
|
||||||
|
dir: logs/${spring.application.name}/sentinel
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
namespace: ${bunny.nacos.discovery.namespace}
|
||||||
|
server-addr: ${bunny.nacos.server-addr}
|
||||||
|
|
||||||
|
jackson:
|
||||||
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
|
time-zone: GMT+8
|
||||||
|
|
||||||
|
mybatis-plus:
|
||||||
|
type-aliases-package: com.atguigu.model # 配置每个包前缀
|
||||||
|
mapper-locations: classpath:mapper/*.xml
|
||||||
|
configuration:
|
||||||
|
map-underscore-to-camel-case: true
|
||||||
|
auto-mapping-behavior: full
|
||||||
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 查看日志
|
||||||
|
global-config:
|
||||||
|
db-config:
|
||||||
|
# 设置表名前缀,不用在每个tableName添加前缀
|
||||||
|
# table-prefix: t_
|
||||||
|
# 全局配置主键值方式
|
||||||
|
id-type: assign_id
|
||||||
|
logic-not-delete-value: 0 # 未删除默认为0
|
||||||
|
logic-delete-value: 1 # 删除
|
||||||
|
logic-delete-field: deleted # 全局配置逻辑删除
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.atguigu.ssyx.activity.mapper: debug
|
||||||
|
com.atguigu.ssyx.activity.controller: info
|
||||||
|
com.atguigu.ssyx.activity.service: info
|
||||||
|
pattern:
|
||||||
|
dateformat: HH:mm:ss:SSS
|
||||||
|
file:
|
||||||
|
path: "logs/${spring.application.name}"
|
|
@ -0,0 +1,16 @@
|
||||||
|
-----------------▄██-█▄---------
|
||||||
|
-----------------███▄██▄--------
|
||||||
|
-----------------███████--------
|
||||||
|
-----------------▀███████-------
|
||||||
|
-------------------██████▄▄-----
|
||||||
|
-------------------█████████▄---
|
||||||
|
-------------------██████▄████--
|
||||||
|
-------▄███████████████████████-
|
||||||
|
-----▄███████████████████████▀--
|
||||||
|
---▄██████████████████████------
|
||||||
|
---███████████████████████------
|
||||||
|
---███████████████████████------
|
||||||
|
-▄▄██████████████████████▀------
|
||||||
|
-█████████████████▀█████--------
|
||||||
|
-▀██████████████▀▀-▀█████▄------
|
||||||
|
-------▀▀▀▀▀▀▀▀▀------▀▀▀▀------
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.atguigu.ssyx.activity.mapper.ActivityInfoMapper">
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.atguigu.ssyx.activity.mapper.CouponInfoMapper">
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -4,6 +4,7 @@ import com.atguigu.ssyx.model.product.Attr;
|
||||||
import com.atguigu.ssyx.product.mapper.AttrMapper;
|
import com.atguigu.ssyx.product.mapper.AttrMapper;
|
||||||
import com.atguigu.ssyx.product.service.AttrService;
|
import com.atguigu.ssyx.product.service.AttrService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -24,8 +25,7 @@ public class AttrServiceImpl extends ServiceImpl<AttrMapper, Attr> implements At
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Attr> findByAttrGroupId(Long attrGroupId) {
|
public List<Attr> findByAttrGroupId(Long attrGroupId) {
|
||||||
LambdaQueryWrapper<Attr> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Attr> wrapper = Wrappers.<Attr>lambdaQuery().eq(Attr::getAttrGroupId, attrGroupId);
|
||||||
wrapper.eq(Attr::getAttrGroupId, attrGroupId);
|
|
||||||
return baseMapper.selectList(wrapper);
|
return baseMapper.selectList(wrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue