
16 changed files with 242 additions and 5 deletions
@ -0,0 +1,3 @@ |
|||
|
|||
ALTER TABLE pms_brand ADD qssl int default 0 COMMENT '起始销售数量'; |
|||
ALTER TABLE pms_brand ADD dgxy varchar(255) DEFAULT NULL COMMENT '订购协议'; |
@ -0,0 +1,5 @@ |
|||
|
|||
ALTER TABLE lpk_goods ADD brandId bigint default NULL COMMENT '品牌ID'; |
|||
ALTER TABLE lpk_goods ADD brandName varchar(255) DEFAULT NULL COMMENT '品牌名称'; |
|||
ALTER TABLE lpk_goods ADD categoryId bigint DEFAULT NULL COMMENT '类别ID'; |
|||
ALTER TABLE lpk_goods ADD categoryName varchar(255) DEFAULT NULL COMMENT '类别名称'; |
@ -0,0 +1,33 @@ |
|||
package com.yxt.yythmall.adminapi; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.yythmall.adminapi.vo.PmsBrandVo; |
|||
import com.yxt.yythmall.adminapi.vo.PmsProductCategoryVo; |
|||
import com.yxt.yythmall.adminservice.AdminMallService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
@RestController("com.yxt.yythmall.adminapi.AdminMallRest") |
|||
@RequestMapping("/adminapi/mall") |
|||
public class AdminMallRest { |
|||
|
|||
@Autowired |
|||
private AdminMallService adminMallService; |
|||
|
|||
@GetMapping(value = "/listAllBrand") |
|||
public ResultBean<List<PmsBrandVo>> listAllBrand() { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<PmsBrandVo> list = adminMallService.listBrand(); |
|||
return rb.success().setData(list); |
|||
} |
|||
@GetMapping(value = "/listAllCategory") |
|||
public ResultBean<List<PmsBrandVo>> listAllCategory() { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
List<PmsProductCategoryVo> list = adminMallService.listAllCategory(); |
|||
return rb.success().setData(list); |
|||
} |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.yxt.yythmall.adminapi.vo; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class PmsBrandVo { |
|||
|
|||
private Long id; |
|||
|
|||
private String name; |
|||
private Integer sort; |
|||
/** |
|||
* 起始销售数量 |
|||
*/ |
|||
private Integer qssl; |
|||
/** |
|||
* 订购协议 |
|||
*/ |
|||
private String dgxy; |
|||
/** |
|||
* 品牌logo |
|||
*/ |
|||
private String logo; |
|||
|
|||
/** |
|||
* 专区大图 |
|||
*/ |
|||
private String bigPic; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.yxt.yythmall.adminapi.vo; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class PmsProductCategoryVo { |
|||
private Long id; |
|||
private Long parentId; |
|||
|
|||
private String name; |
|||
private Integer level; |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 图标 |
|||
*/ |
|||
private String icon; |
|||
|
|||
private String keywords; |
|||
|
|||
/** |
|||
* 描述 |
|||
*/ |
|||
private String description; |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.yythmall.adminservice; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.yxt.yythmall.adminapi.vo.PmsBrandVo; |
|||
import com.yxt.yythmall.adminapi.vo.PmsProductCategoryVo; |
|||
import com.yxt.yythmall.api.lpkgoods.LpkGoods; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface AdminMallMapper extends BaseMapper<LpkGoods> { |
|||
|
|||
@Select("select * from pms_brand ") |
|||
List<PmsBrandVo> listBrand(); |
|||
|
|||
@Select("select * from pms_product_category where parent_id=0 ") |
|||
List<PmsProductCategoryVo> listAllCategory(); |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.yxt.yythmall.adminservice; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import com.yxt.yythmall.adminapi.vo.PmsBrandVo; |
|||
import com.yxt.yythmall.adminapi.vo.PmsProductCategoryVo; |
|||
import com.yxt.yythmall.api.lpkgoods.LpkGoods; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class AdminMallService extends ServiceImpl<AdminMallMapper, LpkGoods> { |
|||
|
|||
|
|||
public List<PmsBrandVo> listBrand() { |
|||
return baseMapper.listBrand(); |
|||
} |
|||
|
|||
public List<PmsProductCategoryVo> listAllCategory() { |
|||
return baseMapper.listAllCategory(); |
|||
} |
|||
} |
Loading…
Reference in new issue