商品测试

dev798
wxy 2024-05-11 17:00:40 +08:00
parent 1b40725c29
commit c9cb5289d6
5 changed files with 18 additions and 4 deletions

View File

@ -6,10 +6,7 @@ import com.muyu.common.core.web.domain.AjaxResult;
import com.muyu.product.service.MallProductTextService;
import com.nuyu.product.domain.MallProductText;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @Author: wangxinyuan
@ -32,4 +29,9 @@ public class MallProductTextController {
public Result delete(Long id){
return Result.success(mallProductTextService.deleteMallProductTextById(id));
}
@PutMapping("/update")
public Result update(@RequestBody MallProductText mallProductText){
return Result.success(mallProductTextService.updateMallProductTextUpdate(mallProductText));
}
}

View File

@ -16,4 +16,6 @@ public interface MallProductTextMapper {
String deleteMallProductTextById(Long id);
Object updateMallProductTextUpdate(MallProductText mallProductText);
}

View File

@ -33,5 +33,10 @@ public class MallProductTextServiceImpl implements MallProductTextService {
return mallProductTextMapper.deleteMallProductTextById(id);
}
@Override
public Object updateMallProductTextUpdate(MallProductText mallProductText) {
return mallProductTextMapper.updateMallProductTextUpdate(mallProductText);
}
}

View File

@ -13,4 +13,6 @@ public interface MallProductTextService {
String deleteMallProductTextById(Long id);
Object updateMallProductTextUpdate(MallProductText mallProductText);
}

View File

@ -3,6 +3,9 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.product.mapper.MallProductTextMapper">
<update id="updateMallProductTextUpdate">
update mall_product_text set name = #{name} WHERE id = #{id}
</update>
<delete id="deleteMallProductTextById">
delete from mall_product_text where id = #{id}