From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 二月 2025 16:41:22 +0800 Subject: [PATCH] 淘宝转链接口更新 --- fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSecondClassServiceImpl.java | 126 +++++++++++++++++++++--------------------- 1 files changed, 63 insertions(+), 63 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSecondClassServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSecondClassServiceImpl.java index 7b0a16a..bab9aa7 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSecondClassServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/GoodsSecondClassServiceImpl.java @@ -1,63 +1,63 @@ -package com.yeshi.fanli.service.impl.goods; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Service; - -import com.yeshi.fanli.dao.mybatis.GoodsSecondClassMapper; -import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass; -import com.yeshi.fanli.exception.NotExistObjectException; -import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService; -import com.yeshi.fanli.util.Constant; - -@Service -public class GoodsSecondClassServiceImpl implements GoodsSecondClassService { - - @Resource - private GoodsSecondClassMapper goodsSecondClassMapper; - - - - @Cacheable(value="classCache",key="'getGoodsSecondClassByGoodsClassId-'+#id") - public List<GoodsSecondClass> getGoodsSecondClassByGoodsClassId(long id) { - return goodsSecondClassMapper.getByGoodsClassId(id); - } - - public List<GoodsSecondClass> getSecondClassList(int index, String key, long cid) { - return goodsSecondClassMapper.getByNameAndGoodsClassId(index * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid, key); - } - - public int getCount(long cid, String key) { - return goodsSecondClassMapper.countByNameAndGoodsClassId(cid, key); - } - - public void addSecondClass(GoodsSecondClass secondClass) { - secondClass.setCreatetime(System.currentTimeMillis()); - goodsSecondClassMapper.insert(secondClass); - } - - public void deleteSecondClass(long sid) { - goodsSecondClassMapper.deleteByPrimaryKey(sid); - } - - public GoodsSecondClass getSecondClass(long scid) { - return goodsSecondClassMapper.selectByPrimaryKey(scid); - } - - public void updateSecondClass(GoodsSecondClass secondClass) - throws NotExistObjectException { - GoodsSecondClass find = goodsSecondClassMapper.selectByPrimaryKey(secondClass.getId()); - if (find == null) { - throw new NotExistObjectException("涓嶅瓨鍦ㄨ鐢ㄦ埛"); - } - find.setName(secondClass.getName()); - find.setPicture(secondClass.getPicture()); - find.setOrderby(secondClass.getOrderby()); - find.setKey(secondClass.getKey()); - goodsSecondClassMapper.updateByPrimaryKey(find); - } - -} +package com.yeshi.fanli.service.impl.goods; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +import com.yeshi.fanli.dao.mybatis.GoodsSecondClassMapper; +import com.yeshi.fanli.entity.bus.clazz.GoodsSecondClass; +import com.yeshi.fanli.exception.NotExistObjectException; +import com.yeshi.fanli.service.inter.goods.GoodsSecondClassService; +import com.yeshi.fanli.util.Constant; + +@Service +public class GoodsSecondClassServiceImpl implements GoodsSecondClassService { + + @Resource + private GoodsSecondClassMapper goodsSecondClassMapper; + + + + @Cacheable(value="classCache",key="'getGoodsSecondClassByGoodsClassId-'+#id") + public List<GoodsSecondClass> getGoodsSecondClassByGoodsClassId(long id) { + return goodsSecondClassMapper.getByGoodsClassId(id); + } + + public List<GoodsSecondClass> getSecondClassList(int index, String key, long cid) { + return goodsSecondClassMapper.getByNameAndGoodsClassId(index * Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid, key); + } + + public int getCount(long cid, String key) { + return goodsSecondClassMapper.countByNameAndGoodsClassId(cid, key); + } + + public void addSecondClass(GoodsSecondClass secondClass) { + secondClass.setCreatetime(System.currentTimeMillis()); + goodsSecondClassMapper.insert(secondClass); + } + + public void deleteSecondClass(long sid) { + goodsSecondClassMapper.deleteByPrimaryKey(sid); + } + + public GoodsSecondClass getSecondClass(long scid) { + return goodsSecondClassMapper.selectByPrimaryKey(scid); + } + + public void updateSecondClass(GoodsSecondClass secondClass) + throws NotExistObjectException { + GoodsSecondClass find = goodsSecondClassMapper.selectByPrimaryKey(secondClass.getId()); + if (find == null) { + throw new NotExistObjectException("涓嶅瓨鍦ㄨ鐢ㄦ埛"); + } + find.setName(secondClass.getName()); + find.setPicture(secondClass.getPicture()); + find.setOrderby(secondClass.getOrderby()); + find.setKey(secondClass.getKey()); + goodsSecondClassMapper.updateByPrimaryKey(find); + } + +} -- Gitblit v1.8.0