Browse Source

Dev good brand

tsurumure 1 month ago
parent
commit
080f461e5d

+ 0 - 0
db/b2c_goods_brand.sql → db/__b2c_goods_brand.sql


+ 41 - 0
db/b2c_good_brand.sql

@@ -0,0 +1,41 @@
+/**
+Source Server Version: 8.0.31
+Source Database: backendsys
+Date: 2025/07/17 10:01:12
+*/
+
+DROP TABLE IF EXISTS `b2c_good_brand`;
+CREATE TABLE `b2c_good_brand` (
+    PRIMARY KEY (`id`),
+    `id` BIGINT AUTO_INCREMENT COMMENT 'ID',
+    `parent_id` BIGINT DEFAULT '-1' COMMENT '父ID',
+    `brand_name` VARCHAR(100) NOT NULL COMMENT '商品品牌名称',
+    `brand_name_en` VARCHAR(100) NOT NULL COMMENT '商品品牌名称 (英文)',
+    `sort` INT DEFAULT '1' COMMENT '排序',
+    `status` TINYINT(1) DEFAULT '1' COMMENT '商品品牌状态 (-1禁用, 1启用)'
+) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='商品品牌表';
+
+INSERT INTO b2c_good_brand(parent_id, brand_name, brand_name_en, sort) VALUES
+    (-1, '优衣库', 'UNIQLO', 1),
+    (-1, 'ZARA', 'ZARA', 2),
+    (-1, 'H&M', 'H&M', 3),
+    (-1, '耐克', 'Nike', 4),
+        (4, 'Air Jordan', 'Air Jordan', 11),       -- 属于 Nike
+        (4, 'Nike SB', 'Nike Skateboarding', 12),  -- 属于 Nike
+    (-1, '阿迪达斯', 'Adidas', 5),
+    (-1, '路易威登', 'Louis Vuitton', 6),
+    (-1, '古驰', 'Gucci', 7),
+    (-1, '香奈儿', 'Chanel', 8),
+    (-1, '彪马', 'Puma', 9),
+    (-1, '李宁', 'Li-Ning', 10),
+    (-1, '安踏', 'ANTA', 11),
+    (-1, '太平鸟', 'PEACEBIRD', 12),
+    (-1, '杰克琼斯', 'Jack & Jones', 13),
+    (-1, 'Only', 'Only', 14),
+    (-1, 'Vero Moda', 'Vero Moda', 15),
+    (-1, '森马', 'Semir', 16),
+    (-1, '美特斯邦威', 'Meters/bonwe', 17),
+    (-1, '海澜之家', 'HLA', 18),
+    (-1, '七匹狼', 'Septwolves', 19),
+    (-1, '波司登', 'Bosideng', 20)
+;

+ 2 - 2
db/b2c_good_category.sql

@@ -1,14 +1,14 @@
 /**
 Source Server Version: 8.0.31
 Source Database: backendsys
-Date: 2023/08/18 12:51:10
+Date: 2025/07/17 10:24:20
 */
 
 DROP TABLE IF EXISTS `b2c_good_category`;
 CREATE TABLE `b2c_good_category` (
     PRIMARY KEY (`id`),
     `id` BIGINT AUTO_INCREMENT COMMENT 'ID',
-    `parent_id` BIGINT COMMENT '父ID',
+    `parent_id` BIGINT DEFAULT '-1' COMMENT '父ID',
     `sort` INT DEFAULT '1' COMMENT '排序',
     `status` TINYINT(1) DEFAULT '1' COMMENT '商品分类状态 (-1禁用, 1启用)'
 ) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='商品分类表';

+ 2 - 2
db/b2c_good_unit.sql

@@ -1,7 +1,7 @@
 /**
 Source Server Version: 8.0.31
 Source Database: backendsys
-Date: 2023/08/18 12:51:10
+Date: 2025/07/17 10:01:12
 */
 
 DROP TABLE IF EXISTS `b2c_good_unit`;
@@ -10,7 +10,7 @@ CREATE TABLE `b2c_good_unit` (
    `id` BIGINT AUTO_INCREMENT COMMENT 'ID',
    `unit_category` VARCHAR(255) NOT NULL COMMENT '商品单位分类',
    `unit_name` VARCHAR(255) NOT NULL COMMENT '商品单位名称',
-   `unit_name_en` VARCHAR(255) NOT NULL COMMENT '商品单位名称',
+   `unit_name_en` VARCHAR(255) NOT NULL COMMENT '商品单位名称 (英文)',
    `sort` INT DEFAULT '1' COMMENT '排序'
 ) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='商品单位表';
 

+ 60 - 60
src/main/java/com/backendsys/controller/B2c/B2cGoodBrandController.java

@@ -1,60 +1,60 @@
-package com.backendsys.controller.B2c;
-
-import com.backendsys.aspect.QueryNullCheck;
-import com.backendsys.aspect.QueryNullCheckAspect;
-import com.backendsys.entity.B2c.B2cGoodBrandDTO;
-import com.backendsys.entity.PageDTO;
-import com.backendsys.service.B2c.B2cGoodBrandService;
-import com.backendsys.utils.response.Result;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * 商品品牌
- */
-@Validated
-@RestController
-public class B2cGoodBrandController {
-
-    @Autowired
-    private B2cGoodBrandService b2cGoodBrandService;
-
-    @PreAuthorize("@sr.hasPermission('11.3')")
-    @GetMapping("/api/b2c/good/getGoodBrand")
-    public Result getGoodBrand(@Validated PageDTO pageDTO, @Validated B2cGoodBrandDTO b2cGoodBrandDTO) {
-        return Result.success(b2cGoodBrandService.queryGoodBrandList(pageDTO.getPage_num(), pageDTO.getPage_size(), b2cGoodBrandDTO));
-    }
-
-    @PreAuthorize("@sr.hasPermission('11.3.1')")
-    @QueryNullCheck(serviceClass = B2cGoodBrandService.class, serviceMethod = "queryGoodBrandDetail", argField = "good_brand_id", message = "商品品牌不存在")
-    @GetMapping("/api/b2c/good/getGoodBrandDetail")
-    public Result getGoodBrandDetail(@Validated(B2cGoodBrandDTO.Detail.class) B2cGoodBrandDTO b2cGoodBrandDTO) {
-        return Result.success(QueryNullCheckAspect.getQueryResult());
-    }
-
-    @PreAuthorize("@sr.hasPermission('11.3.2')")
-    @PostMapping("/api/b2c/good/createGoodBrand")
-    public Result createGoodBrand(@Validated(B2cGoodBrandDTO.Create.class) @RequestBody B2cGoodBrandDTO b2cGoodBrandDTO) {
-        return Result.success(b2cGoodBrandService.insertGoodBrand(b2cGoodBrandDTO), "创建成功");
-    }
-
-    @PreAuthorize("@sr.hasPermission('11.3.3')")
-    @QueryNullCheck(serviceClass = B2cGoodBrandService.class, serviceMethod = "queryGoodBrandDetail", argField = "good_brand_id", message = "商品品牌不存在")
-    @PutMapping("/api/b2c/good/updateGoodBrand")
-    public Result updateGoodBrand(@Validated(B2cGoodBrandDTO.Update.class) @RequestBody B2cGoodBrandDTO b2cGoodBrandDTO) {
-        return Result.success(b2cGoodBrandService.updateGoodBrand(b2cGoodBrandDTO), "更新成功");
-    }
-
-    @PreAuthorize("@sr.hasPermission('11.3.4')")
-    @QueryNullCheck(serviceClass = B2cGoodBrandService.class, serviceMethod = "queryGoodBrandDetail", argField = "good_brand_id", message = "商品品牌不存在")
-    @DeleteMapping("/api/b2c/good/deleteGoodBrand")
-    public Result deleteGoodBrand(@Validated(B2cGoodBrandDTO.Delete.class) @RequestBody B2cGoodBrandDTO b2cGoodBrandDTO) {
-
-        // 判断是否有子ID,有则不允许删除
-
-
-        return Result.success(b2cGoodBrandService.deleteGoodBrand(b2cGoodBrandDTO), "删除成功");
-    }
-}
+//package com.backendsys.controller.B2c;
+//
+//import com.backendsys.aspect.QueryNullCheck;
+//import com.backendsys.aspect.QueryNullCheckAspect;
+//import com.backendsys.entity.B2c.B2cGoodBrandDTO;
+//import com.backendsys.entity.PageDTO;
+//import com.backendsys.service.B2c.B2cGoodBrandService;
+//import com.backendsys.utils.response.Result;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.security.access.prepost.PreAuthorize;
+//import org.springframework.validation.annotation.Validated;
+//import org.springframework.web.bind.annotation.*;
+//
+///**
+// * 商品品牌
+// */
+//@Validated
+//@RestController
+//public class B2cGoodBrandController {
+//
+//    @Autowired
+//    private B2cGoodBrandService b2cGoodBrandService;
+//
+//    @PreAuthorize("@sr.hasPermission('11.3')")
+//    @GetMapping("/api/b2c/good/getGoodBrand")
+//    public Result getGoodBrand(@Validated PageDTO pageDTO, @Validated B2cGoodBrandDTO b2cGoodBrandDTO) {
+//        return Result.success(b2cGoodBrandService.queryGoodBrandList(pageDTO.getPage_num(), pageDTO.getPage_size(), b2cGoodBrandDTO));
+//    }
+//
+//    @PreAuthorize("@sr.hasPermission('11.3.1')")
+//    @QueryNullCheck(serviceClass = B2cGoodBrandService.class, serviceMethod = "queryGoodBrandDetail", argField = "good_brand_id", message = "商品品牌不存在")
+//    @GetMapping("/api/b2c/good/getGoodBrandDetail")
+//    public Result getGoodBrandDetail(@Validated(B2cGoodBrandDTO.Detail.class) B2cGoodBrandDTO b2cGoodBrandDTO) {
+//        return Result.success(QueryNullCheckAspect.getQueryResult());
+//    }
+//
+//    @PreAuthorize("@sr.hasPermission('11.3.2')")
+//    @PostMapping("/api/b2c/good/createGoodBrand")
+//    public Result createGoodBrand(@Validated(B2cGoodBrandDTO.Create.class) @RequestBody B2cGoodBrandDTO b2cGoodBrandDTO) {
+//        return Result.success(b2cGoodBrandService.insertGoodBrand(b2cGoodBrandDTO), "创建成功");
+//    }
+//
+//    @PreAuthorize("@sr.hasPermission('11.3.3')")
+//    @QueryNullCheck(serviceClass = B2cGoodBrandService.class, serviceMethod = "queryGoodBrandDetail", argField = "good_brand_id", message = "商品品牌不存在")
+//    @PutMapping("/api/b2c/good/updateGoodBrand")
+//    public Result updateGoodBrand(@Validated(B2cGoodBrandDTO.Update.class) @RequestBody B2cGoodBrandDTO b2cGoodBrandDTO) {
+//        return Result.success(b2cGoodBrandService.updateGoodBrand(b2cGoodBrandDTO), "更新成功");
+//    }
+//
+//    @PreAuthorize("@sr.hasPermission('11.3.4')")
+//    @QueryNullCheck(serviceClass = B2cGoodBrandService.class, serviceMethod = "queryGoodBrandDetail", argField = "good_brand_id", message = "商品品牌不存在")
+//    @DeleteMapping("/api/b2c/good/deleteGoodBrand")
+//    public Result deleteGoodBrand(@Validated(B2cGoodBrandDTO.Delete.class) @RequestBody B2cGoodBrandDTO b2cGoodBrandDTO) {
+//
+//        // 判断是否有子ID,有则不允许删除
+//
+//
+//        return Result.success(b2cGoodBrandService.deleteGoodBrand(b2cGoodBrandDTO), "删除成功");
+//    }
+//}

+ 33 - 33
src/main/java/com/backendsys/entity/B2c/B2cGoodBrandDTO.java

@@ -1,33 +1,33 @@
-package com.backendsys.entity.B2c;
-
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Size;
-import lombok.Data;
-import org.hibernate.validator.constraints.Range;
-
-@Data
-public class B2cGoodBrandDTO {
-    public static interface Detail{}
-    public static interface Create{}
-    public static interface Update{}
-    public static interface Delete{}
-
-    /**
-     * b2c_goods_brand
-     */
-    private Long id;
-    @NotNull(message = "商品品牌ID不能为空", groups = { B2cGoodBrandDTO.Detail.class, B2cGoodBrandDTO.Update.class, B2cGoodBrandDTO.Delete.class })
-    private Long good_brand_id;
-
-
-    private Long parent_id;
-
-    @NotBlank(message = "商品品牌名称不能为空", groups = { B2cGoodBrandDTO.Create.class, B2cGoodBrandDTO.Update.class })
-    @Size(max = 50, message = "商品品牌名称长度不超过 {max} 个字符", groups = { B2cGoodBrandDTO.Create.class, B2cGoodBrandDTO.Update.class })
-    private String brand_name;
-
-    @Range(min = 1, max = 9999, message = "排序必须在 {min} 到 {max} 之间")
-    private Long sort;
-    private Integer status;
-}
+//package com.backendsys.entity.B2c;
+//
+//import jakarta.validation.constraints.NotBlank;
+//import jakarta.validation.constraints.NotNull;
+//import jakarta.validation.constraints.Size;
+//import lombok.Data;
+//import org.hibernate.validator.constraints.Range;
+//
+//@Data
+//public class B2cGoodBrandDTO {
+//    public static interface Detail{}
+//    public static interface Create{}
+//    public static interface Update{}
+//    public static interface Delete{}
+//
+//    /**
+//     * b2c_goods_brand
+//     */
+//    private Long id;
+//    @NotNull(message = "商品品牌ID不能为空", groups = { B2cGoodBrandDTO.Detail.class, B2cGoodBrandDTO.Update.class, B2cGoodBrandDTO.Delete.class })
+//    private Long good_brand_id;
+//
+//
+//    private Long parent_id;
+//
+//    @NotBlank(message = "商品品牌名称不能为空", groups = { B2cGoodBrandDTO.Create.class, B2cGoodBrandDTO.Update.class })
+//    @Size(max = 50, message = "商品品牌名称长度不超过 {max} 个字符", groups = { B2cGoodBrandDTO.Create.class, B2cGoodBrandDTO.Update.class })
+//    private String brand_name;
+//
+//    @Range(min = 1, max = 9999, message = "排序必须在 {min} 到 {max} 之间")
+//    private Long sort;
+//    private Integer status;
+//}

+ 16 - 16
src/main/java/com/backendsys/mapper/B2c/B2cGoodBrandMapper.java

@@ -1,16 +1,16 @@
-package com.backendsys.mapper.B2c;
-
-import com.backendsys.entity.B2c.B2cGoodBrandDTO;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface B2cGoodBrandMapper {
-    List<Map<String, Object>> queryGoodBrandList(B2cGoodBrandDTO b2cGoodBrandDTO);
-    Map<String, Object> queryGoodBrandDetail(Long good_id);
-    long insertGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
-    long deleteGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
-    long updateGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
-}
+//package com.backendsys.mapper.B2c;
+//
+//import com.backendsys.entity.B2c.B2cGoodBrandDTO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Mapper
+//public interface B2cGoodBrandMapper {
+//    List<Map<String, Object>> queryGoodBrandList(B2cGoodBrandDTO b2cGoodBrandDTO);
+//    Map<String, Object> queryGoodBrandDetail(Long good_id);
+//    long insertGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
+//    long deleteGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
+//    long updateGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
+//}

+ 68 - 68
src/main/java/com/backendsys/mapper/B2c/B2cGoodBrandMapper.xml

@@ -1,75 +1,75 @@
-<?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.backendsys.mapper.B2c.B2cGoodBrandMapper">
+<!--<?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.backendsys.mapper.B2c.B2cGoodBrandMapper">-->
 
-    <sql id="includeGoodsBrand">
-        gb.id id,
-        gb.id good_brand_id,
-        gb.brand_name,
-        COALESCE(gb.parent_id, '') parent_id,
-        COALESCE(gbp.brand_name, '') parent_name,
-        gb.sort,
-        gb.status
-    </sql>
-    <resultMap id="resultMapGoodsBrand" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT" />
-        <result property="good_brand_id" column="good_brand_id" javaType="java.lang.Long"/>
-        <result property="parent_id" column="parent_id"/>
-        <result property="brand_name" column="brand_name" />
-        <result property="sort" column="sort" javaType="java.lang.Integer" />
-        <result property="status" column="status" javaType="java.lang.Integer" />
-    </resultMap>
+<!--    <sql id="includeGoodsBrand">-->
+<!--        gb.id id,-->
+<!--        gb.id good_brand_id,-->
+<!--        gb.brand_name,-->
+<!--        COALESCE(gb.parent_id, '') parent_id,-->
+<!--        COALESCE(gbp.brand_name, '') parent_name,-->
+<!--        gb.sort,-->
+<!--        gb.status-->
+<!--    </sql>-->
+<!--    <resultMap id="resultMapGoodsBrand" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT" />-->
+<!--        <result property="good_brand_id" column="good_brand_id" javaType="java.lang.Long"/>-->
+<!--        <result property="parent_id" column="parent_id"/>-->
+<!--        <result property="brand_name" column="brand_name" />-->
+<!--        <result property="sort" column="sort" javaType="java.lang.Integer" />-->
+<!--        <result property="status" column="status" javaType="java.lang.Integer" />-->
+<!--    </resultMap>-->
 
-    <select id="queryGoodBrandList" resultMap="resultMapGoodsBrand">
-        SELECT
-        <include refid="includeGoodsBrand" />
-        FROM b2c_goods_brand gb
-        LEFT JOIN b2c_goods_brand gbp ON gb.parent_id = gbp.id
-        <where>
-            <if test="brand_name != null and brand_name != ''">
-                AND gb.brand_name LIKE CONCAT('%', #{brand_name}, '%')
-            </if>
-            <if test="status != null and status != ''">
-                AND gb.status = #{status}
-            </if>
-        </where>
-        ORDER BY gb.sort DESC
-    </select>
+<!--    <select id="queryGoodBrandList" resultMap="resultMapGoodsBrand">-->
+<!--        SELECT-->
+<!--        <include refid="includeGoodsBrand" />-->
+<!--        FROM b2c_goods_brand gb-->
+<!--        LEFT JOIN b2c_goods_brand gbp ON gb.parent_id = gbp.id-->
+<!--        <where>-->
+<!--            <if test="brand_name != null and brand_name != ''">-->
+<!--                AND gb.brand_name LIKE CONCAT('%', #{brand_name}, '%')-->
+<!--            </if>-->
+<!--            <if test="status != null and status != ''">-->
+<!--                AND gb.status = #{status}-->
+<!--            </if>-->
+<!--        </where>-->
+<!--        ORDER BY gb.sort DESC-->
+<!--    </select>-->
 
-    <select id="queryGoodBrandDetail" resultMap="resultMapGoodsBrand">
-        SELECT
-        <include refid="includeGoodsBrand" />
-        FROM b2c_goods_brand gb
-        LEFT JOIN b2c_goods_brand gbp ON gb.parent_id = gbp.id
-        WHERE gb.id = #{good_brand_id}
-    </select>
+<!--    <select id="queryGoodBrandDetail" resultMap="resultMapGoodsBrand">-->
+<!--        SELECT-->
+<!--        <include refid="includeGoodsBrand" />-->
+<!--        FROM b2c_goods_brand gb-->
+<!--        LEFT JOIN b2c_goods_brand gbp ON gb.parent_id = gbp.id-->
+<!--        WHERE gb.id = #{good_brand_id}-->
+<!--    </select>-->
 
-    <insert id="insertGoodBrand" parameterType="com.backendsys.entity.B2c.B2cGoodBrandDTO"
-        useGeneratedKeys="true" keyProperty="good_brand_id">
-        INSERT INTO b2c_goods_brand (brand_name
-        <if test="parent_id != null and parent_id != ''">, parent_id</if>
-        <if test="sort != null and sort != ''">, sort</if>
-        <if test="status != null and status != ''">, status</if>
-        )
-        VALUES (#{brand_name}
-        <if test="parent_id != null and parent_id != ''">, #{parent_id}</if>
-        <if test="sort != null and sort != ''">, #{sort}</if>
-        <if test="status != null and status != ''">, #{status}</if>
-        )
-    </insert>
+<!--    <insert id="insertGoodBrand" parameterType="com.backendsys.entity.B2c.B2cGoodBrandDTO"-->
+<!--        useGeneratedKeys="true" keyProperty="good_brand_id">-->
+<!--        INSERT INTO b2c_goods_brand (brand_name-->
+<!--        <if test="parent_id != null and parent_id != ''">, parent_id</if>-->
+<!--        <if test="sort != null and sort != ''">, sort</if>-->
+<!--        <if test="status != null and status != ''">, status</if>-->
+<!--        )-->
+<!--        VALUES (#{brand_name}-->
+<!--        <if test="parent_id != null and parent_id != ''">, #{parent_id}</if>-->
+<!--        <if test="sort != null and sort != ''">, #{sort}</if>-->
+<!--        <if test="status != null and status != ''">, #{status}</if>-->
+<!--        )-->
+<!--    </insert>-->
 
-    <update id="updateGoodBrand" parameterType="com.backendsys.entity.B2c.B2cGoodBrandDTO"
-        useGeneratedKeys="true" keyProperty="good_brand_id">
-        UPDATE b2c_goods_brand
-        SET brand_name = #{brand_name}
-            <if test="parent_id != null and parent_id != ''">, parent_id = #{parent_id}</if>
-            <if test="sort != null and sort != ''">, sort = #{sort}</if>
-            <if test="status != null and status != ''">, status = #{status}</if>
-        WHERE id = #{good_brand_id}
-    </update>
+<!--    <update id="updateGoodBrand" parameterType="com.backendsys.entity.B2c.B2cGoodBrandDTO"-->
+<!--        useGeneratedKeys="true" keyProperty="good_brand_id">-->
+<!--        UPDATE b2c_goods_brand-->
+<!--        SET brand_name = #{brand_name}-->
+<!--            <if test="parent_id != null and parent_id != ''">, parent_id = #{parent_id}</if>-->
+<!--            <if test="sort != null and sort != ''">, sort = #{sort}</if>-->
+<!--            <if test="status != null and status != ''">, status = #{status}</if>-->
+<!--        WHERE id = #{good_brand_id}-->
+<!--    </update>-->
 
-    <delete id="deleteGoodBrand">
-        DELETE FROM b2c_goods_brand WHERE id = #{good_brand_id}
-    </delete>
+<!--    <delete id="deleteGoodBrand">-->
+<!--        DELETE FROM b2c_goods_brand WHERE id = #{good_brand_id}-->
+<!--    </delete>-->
 
-</mapper>
+<!--</mapper>-->

+ 9 - 0
src/main/java/com/backendsys/modules/b2c/good/dao/GoodBrandDao.java

@@ -0,0 +1,9 @@
+package com.backendsys.modules.b2c.good.dao;
+
+import com.backendsys.modules.b2c.good.entity.GoodBrand;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface GoodBrandDao extends BaseMapper<GoodBrand> {
+}

+ 20 - 0
src/main/java/com/backendsys/modules/b2c/good/entity/GoodBrand.java

@@ -0,0 +1,20 @@
+package com.backendsys.modules.b2c.good.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("b2c_good_brand")
+public class GoodBrand {
+
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    private Long parent_id;
+    private String brand_name;
+    private String brand_name_en;
+    private Integer sort;
+    private Integer status;
+
+}

+ 13 - 13
src/main/java/com/backendsys/service/B2c/B2cGoodBrandService.java

@@ -1,13 +1,13 @@
-package com.backendsys.service.B2c;
-
-import com.backendsys.entity.B2c.B2cGoodBrandDTO;
-
-import java.util.Map;
-
-public interface B2cGoodBrandService {
-    Map<String, Object> queryGoodBrandList(Integer pageNum, Integer pageSize, B2cGoodBrandDTO b2cGoodBrandDTO);
-    Map<String, Object> queryGoodBrandDetail(Long good_id);
-    Map<String, Object> insertGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
-    Map<String, Object> updateGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
-    Map<String, Object> deleteGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
-}
+//package com.backendsys.service.B2c;
+//
+//import com.backendsys.entity.B2c.B2cGoodBrandDTO;
+//
+//import java.util.Map;
+//
+//public interface B2cGoodBrandService {
+//    Map<String, Object> queryGoodBrandList(Integer pageNum, Integer pageSize, B2cGoodBrandDTO b2cGoodBrandDTO);
+//    Map<String, Object> queryGoodBrandDetail(Long good_id);
+//    Map<String, Object> insertGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
+//    Map<String, Object> updateGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
+//    Map<String, Object> deleteGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO);
+//}

+ 72 - 72
src/main/java/com/backendsys/service/B2c/B2cGoodBrandServiceImpl.java

@@ -1,72 +1,72 @@
-package com.backendsys.service.B2c;
-
-import com.backendsys.entity.B2c.B2cGoodBrandDTO;
-import com.backendsys.mapper.B2c.B2cGoodBrandMapper;
-import com.backendsys.utils.response.PageInfoResult;
-import com.github.pagehelper.PageHelper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-import java.util.Map;
-
-@Service
-public class B2cGoodBrandServiceImpl implements B2cGoodBrandService {
-
-    @Autowired
-    private B2cGoodBrandMapper b2cGoodBrandMapper;
-
-    /**
-     * 查询 列表
-     */
-    public Map<String, Object> queryGoodBrandList(Integer pageNum, Integer pageSize, B2cGoodBrandDTO b2cGoodBrandDTO) {
-        // 分页查询
-        if (pageNum != null && pageSize != null) {
-            PageHelper.startPage(pageNum, pageSize);
-            PageHelper.getLocalPage().setPageSizeZero(true);
-        }
-        // 分页输出 (自定义)
-        List<Map<String, Object>> list = b2cGoodBrandMapper.queryGoodBrandList(b2cGoodBrandDTO);
-        PageInfoResult pageInfoResult = new PageInfoResult(list);
-        return pageInfoResult.toMap();
-    }
-
-    /**
-     * 查询 详情
-     */
-    @Override
-    public Map<String, Object> queryGoodBrandDetail(Long good_brand_id) {
-        return b2cGoodBrandMapper.queryGoodBrandDetail(good_brand_id);
-    }
-
-    /**
-     * 创建
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public Map<String, Object> insertGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO) {
-        b2cGoodBrandMapper.insertGoodBrand(b2cGoodBrandDTO);
-        return Map.of("good_brand_id", b2cGoodBrandDTO.getGood_brand_id());
-    }
-
-    /**
-     * 更新
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public Map<String, Object> updateGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO) {
-        b2cGoodBrandMapper.updateGoodBrand(b2cGoodBrandDTO);
-        return Map.of("good_brand_id", b2cGoodBrandDTO.getGood_brand_id());
-    }
-
-    /**
-     * 删除
-     */
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public Map<String, Object> deleteGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO) {
-        b2cGoodBrandMapper.deleteGoodBrand(b2cGoodBrandDTO);
-        return Map.of("good_brand_id", b2cGoodBrandDTO.getGood_brand_id());
-    }
-}
+//package com.backendsys.service.B2c;
+//
+//import com.backendsys.entity.B2c.B2cGoodBrandDTO;
+//import com.backendsys.mapper.B2c.B2cGoodBrandMapper;
+//import com.backendsys.utils.response.PageInfoResult;
+//import com.github.pagehelper.PageHelper;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//import org.springframework.transaction.annotation.Transactional;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Service
+//public class B2cGoodBrandServiceImpl implements B2cGoodBrandService {
+//
+//    @Autowired
+//    private B2cGoodBrandMapper b2cGoodBrandMapper;
+//
+//    /**
+//     * 查询 列表
+//     */
+//    public Map<String, Object> queryGoodBrandList(Integer pageNum, Integer pageSize, B2cGoodBrandDTO b2cGoodBrandDTO) {
+//        // 分页查询
+//        if (pageNum != null && pageSize != null) {
+//            PageHelper.startPage(pageNum, pageSize);
+//            PageHelper.getLocalPage().setPageSizeZero(true);
+//        }
+//        // 分页输出 (自定义)
+//        List<Map<String, Object>> list = b2cGoodBrandMapper.queryGoodBrandList(b2cGoodBrandDTO);
+//        PageInfoResult pageInfoResult = new PageInfoResult(list);
+//        return pageInfoResult.toMap();
+//    }
+//
+//    /**
+//     * 查询 详情
+//     */
+//    @Override
+//    public Map<String, Object> queryGoodBrandDetail(Long good_brand_id) {
+//        return b2cGoodBrandMapper.queryGoodBrandDetail(good_brand_id);
+//    }
+//
+//    /**
+//     * 创建
+//     */
+//    @Override
+//    @Transactional(rollbackFor = Exception.class)
+//    public Map<String, Object> insertGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO) {
+//        b2cGoodBrandMapper.insertGoodBrand(b2cGoodBrandDTO);
+//        return Map.of("good_brand_id", b2cGoodBrandDTO.getGood_brand_id());
+//    }
+//
+//    /**
+//     * 更新
+//     */
+//    @Override
+//    @Transactional(rollbackFor = Exception.class)
+//    public Map<String, Object> updateGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO) {
+//        b2cGoodBrandMapper.updateGoodBrand(b2cGoodBrandDTO);
+//        return Map.of("good_brand_id", b2cGoodBrandDTO.getGood_brand_id());
+//    }
+//
+//    /**
+//     * 删除
+//     */
+//    @Override
+//    @Transactional(rollbackFor = Exception.class)
+//    public Map<String, Object> deleteGoodBrand(B2cGoodBrandDTO b2cGoodBrandDTO) {
+//        b2cGoodBrandMapper.deleteGoodBrand(b2cGoodBrandDTO);
+//        return Map.of("good_brand_id", b2cGoodBrandDTO.getGood_brand_id());
+//    }
+//}