You've already forked FrameTour-BE
优惠券
This commit is contained in:
@ -0,0 +1,49 @@
|
||||
package com.ycwl.basic.service.impl.pc;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ycwl.basic.mapper.CouponMapper;
|
||||
import com.ycwl.basic.model.pc.coupon.entity.CouponEntity;
|
||||
import com.ycwl.basic.model.pc.coupon.req.CouponQueryReq;
|
||||
import com.ycwl.basic.model.pc.coupon.resp.CouponRespVO;
|
||||
import com.ycwl.basic.service.pc.CouponService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CouponServiceImpl extends ServiceImpl<CouponMapper, CouponEntity> implements CouponService {
|
||||
|
||||
@Autowired
|
||||
private CouponMapper couponMapper;
|
||||
|
||||
@Override
|
||||
public Integer add(CouponEntity coupon) {
|
||||
return couponMapper.insert(coupon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(CouponEntity coupon) {
|
||||
return couponMapper.updateById(coupon) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean delete(Integer id) {
|
||||
return removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CouponEntity getById(Integer id) {
|
||||
return couponMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CouponRespVO> list(CouponQueryReq query) {
|
||||
List<CouponRespVO> list = couponMapper.selectByQuery(query);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateStatus(Integer id) {
|
||||
return couponMapper.updateStatus(id) > 0;
|
||||
}
|
||||
}
|
17
src/main/java/com/ycwl/basic/service/pc/CouponService.java
Normal file
17
src/main/java/com/ycwl/basic/service/pc/CouponService.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.ycwl.basic.service.pc;
|
||||
|
||||
import com.ycwl.basic.model.pc.coupon.entity.CouponEntity;
|
||||
import com.ycwl.basic.model.pc.coupon.req.CouponQueryReq;
|
||||
import com.ycwl.basic.model.pc.coupon.resp.CouponRespVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CouponService {
|
||||
Integer add(CouponEntity coupon);
|
||||
Boolean update(CouponEntity coupon);
|
||||
Boolean delete(Integer id);
|
||||
CouponEntity getById(Integer id);
|
||||
List<CouponRespVO> list(CouponQueryReq query);
|
||||
|
||||
Boolean updateStatus(Integer id);
|
||||
}
|
Reference in New Issue
Block a user