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-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-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-search/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.StrategyConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class CodeGet {
|
||||
|
||||
|
@ -17,7 +18,8 @@ public class CodeGet {
|
|||
// 2、全局配置
|
||||
// 全局配置
|
||||
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.setAuthor("bunny");
|
||||
|
@ -26,7 +28,8 @@ public class CodeGet {
|
|||
|
||||
// 3、数据源配置
|
||||
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.setUsername("root");
|
||||
dsc.setPassword("02120212");
|
||||
|
@ -36,26 +39,32 @@ public class CodeGet {
|
|||
// 4、包配置
|
||||
PackageConfig pc = new PackageConfig();
|
||||
pc.setParent("com.atguigu.ssyx");
|
||||
pc.setModuleName("product"); // 模块名
|
||||
// TODO 需要修改模块名
|
||||
pc.setModuleName("activity");
|
||||
pc.setController("controller");
|
||||
pc.setService("service");
|
||||
pc.setMapper("mapper");
|
||||
mpg.setPackageInfo(pc);
|
||||
|
||||
// 5、策略配置
|
||||
StrategyConfig strategy = new StrategyConfig();
|
||||
|
||||
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中驼峰转连字符
|
||||
StrategyConfig strategy = getStrategyConfig();
|
||||
|
||||
mpg.setStrategy(strategy);
|
||||
|
||||
// 6、执行
|
||||
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,7 +19,6 @@ import lombok.Data;
|
|||
@ApiModel(description = "用户角色")
|
||||
@TableName("admin_role")
|
||||
public class AdminRole extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "角色id")
|
||||
|
@ -29,6 +28,5 @@ public class AdminRole extends BaseEntity {
|
|||
@ApiModelProperty(value = "用户id")
|
||||
@TableField("admin_id")
|
||||
private Long adminId;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ import java.math.BigDecimal;
|
|||
@ApiModel(description = "SkuInfo")
|
||||
@TableName("sku_info")
|
||||
public class SkuInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "分类id")
|
||||
|
|
|
@ -1,22 +1,16 @@
|
|||
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 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.Field;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Document(indexName = "skues" ,shards = 3,replicas = 1)
|
||||
@Document(indexName = "skues", shards = 3, replicas = 1)
|
||||
public class SkuEs {
|
||||
|
||||
// 商品Id= skuId
|
||||
@Id
|
||||
private Long id;
|
||||
|
@ -64,5 +58,4 @@ public class SkuEs {
|
|||
|
||||
@Field(type = FieldType.Object, index = false)
|
||||
private List<String> ruleList;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
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.SkuImage;
|
||||
import com.atguigu.ssyx.model.product.SkuInfo;
|
||||
import com.atguigu.ssyx.model.product.SkuPoster;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SkuInfoVo extends SkuInfo {
|
||||
|
||||
@ApiModelProperty(value = "海报列表")
|
||||
private List<SkuPoster> skuPosterList;
|
||||
|
||||
|
@ -21,6 +21,5 @@ public class SkuInfoVo extends SkuInfo {
|
|||
|
||||
@ApiModelProperty(value = "图片")
|
||||
private List<SkuImage> skuImagesList;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<module>service-sys</module>
|
||||
<module>service-product</module>
|
||||
<module>service-search</module>
|
||||
<module>service-activity</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.atguigu.ssyx.acl.controller;
|
||||
|
||||
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.model.acl.Admin;
|
||||
import com.atguigu.ssyx.vo.acl.AdminQueryVo;
|
||||
|
@ -20,8 +19,6 @@ import java.util.List;
|
|||
public class AdminController {
|
||||
@Autowired
|
||||
private AdminService adminService;
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
|
||||
@ApiOperation(value = "获取管理用户分页列表")
|
||||
@GetMapping("{page}/{limit}")
|
||||
|
|
|
@ -30,9 +30,13 @@ public class AdminRoleServiceImpl extends ServiceImpl<AdminRoleMapper, AdminRole
|
|||
public AssignAdminRoleVo findRoleByUserId(Long adminId) {
|
||||
// 查询所有的角色
|
||||
List<Role> allRolesList = roleService.list(null);
|
||||
// 根据用户id查询角色
|
||||
List<Role> roleList = baseMapper.findRoleByUserId(adminId);
|
||||
|
||||
return AssignAdminRoleVo.builder().assignRoles(roleList).allRolesList(allRolesList).build();
|
||||
// 返回全部角色和当前用户查询的角色
|
||||
return AssignAdminRoleVo.builder()
|
||||
.assignRoles(roleList)
|
||||
.allRolesList(allRolesList).build();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,11 +48,14 @@ public class AdminRoleServiceImpl extends ServiceImpl<AdminRoleMapper, AdminRole
|
|||
@Override
|
||||
@Transactional
|
||||
public void saveUserRoleShip(Long adminId, Long[] roleIds) {
|
||||
// 先删除这个用户id下所有的角色信息
|
||||
remove(Wrappers.<AdminRole>lambdaQuery().eq(AdminRole::getAdminId, adminId));
|
||||
// 创建集合,遍历完成后一次性插入
|
||||
ArrayList<AdminRole> adminRoles = new ArrayList<>();
|
||||
|
||||
// 循环遍历并插入
|
||||
for (Long roleId : roleIds) {
|
||||
// 为用户设置角色id
|
||||
AdminRole adminRole = new AdminRole();
|
||||
adminRole.setAdminId(adminId);
|
||||
adminRole.setRoleId(roleId);
|
||||
|
|
|
@ -24,10 +24,8 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
|
|||
*/
|
||||
@Override
|
||||
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.service.AttrService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -24,8 +25,7 @@ public class AttrServiceImpl extends ServiceImpl<AttrMapper, Attr> implements At
|
|||
*/
|
||||
@Override
|
||||
public List<Attr> findByAttrGroupId(Long attrGroupId) {
|
||||
LambdaQueryWrapper<Attr> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Attr::getAttrGroupId, attrGroupId);
|
||||
LambdaQueryWrapper<Attr> wrapper = Wrappers.<Attr>lambdaQuery().eq(Attr::getAttrGroupId, attrGroupId);
|
||||
return baseMapper.selectList(wrapper);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue