店铺装修接口
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.account.entity.ShopExtend;
|
||||
|
||||
/**
|
||||
* 店铺扩展信息 映射层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-19
|
||||
*/
|
||||
public interface ShopExtendMapper extends BaseMapper<ShopExtend> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.czg.service.account.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.czg.account.dto.extend.ShopExtendDTO;
|
||||
import com.czg.exception.ApiNotPrintException;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.account.entity.ShopExtend;
|
||||
import com.czg.account.service.ShopExtendService;
|
||||
import com.czg.service.account.mapper.ShopExtendMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 店铺扩展信息 服务层实现。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-19
|
||||
*/
|
||||
@Service
|
||||
public class ShopExtendServiceImpl extends ServiceImpl<ShopExtendMapper, ShopExtend> implements ShopExtendService{
|
||||
|
||||
@Override
|
||||
public Boolean edit(Long shopId, ShopExtendDTO shopExtendDTO) {
|
||||
ShopExtend shopExtend = queryChain().eq(ShopExtend::getShopId, shopId).eq(ShopExtend::getAutoKey, shopExtendDTO.getAutokey()).one();
|
||||
if (shopExtend == null) {
|
||||
throw new ApiNotPrintException("key有误");
|
||||
}
|
||||
|
||||
BeanUtil.copyProperties(shopExtendDTO, shopExtend);
|
||||
shopExtend.setAutoKey(null);
|
||||
return update(shopExtend, new QueryWrapper().eq(ShopExtend::getShopId, shopId).eq(ShopExtend::getAutoKey, shopExtendDTO.getAutokey()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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.czg.service.account.mapper.ShopExtendMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user