产品上下线
parent
b60ff66037
commit
c838baadef
|
@ -80,6 +80,21 @@ public class ApiManageController {
|
||||||
return Result.success(null, "操作成功");
|
return Result.success(null, "操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品上/下线
|
||||||
|
* @param
|
||||||
|
* @param productUpdReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/updproductState")
|
||||||
|
@Operation(summary = "产品上/下线", description = "产品上/下线")
|
||||||
|
public Result<String> updproductState(
|
||||||
|
@Schema(title = "产品ID", type = "Integer", defaultValue = "1", description = "修改产品信息需要依据的唯一条件")
|
||||||
|
@RequestBody @Validated ProductUpdReq productUpdReq) {
|
||||||
|
apiManageService.updproductState(productUpdReq);
|
||||||
|
return Result.success(null, "操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,7 +103,7 @@ public class ApiManageController {
|
||||||
* @param productId
|
* @param productId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("/del/{productId}")
|
@PostMapping("/del/{productId}")
|
||||||
@Operation(summary = "接口信息删除",description = "通过Id删除接口信息")
|
@Operation(summary = "接口信息删除",description = "通过Id删除接口信息")
|
||||||
public Result<String> delete(@PathVariable("productId") Integer productId){
|
public Result<String> delete(@PathVariable("productId") Integer productId){
|
||||||
apiManageService.removeById(productId);
|
apiManageService.removeById(productId);
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.cloud.background.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.cloud.background.domin.Product;
|
import com.muyu.cloud.background.domin.Product;
|
||||||
|
import com.muyu.cloud.background.domin.req.ProductUpdReq;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
@ -24,4 +25,10 @@ public interface ApiManageMapper extends BaseMapper<Product> {
|
||||||
*/
|
*/
|
||||||
@Select("SELECT product_state from product GROUP BY product_state")
|
@Select("SELECT product_state from product GROUP BY product_state")
|
||||||
List<Integer> selectproductState();
|
List<Integer> selectproductState();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品上/下线
|
||||||
|
* @param productUpdReq
|
||||||
|
*/
|
||||||
|
void updproductState(ProductUpdReq productUpdReq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.cloud.background.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.cloud.background.domin.Product;
|
import com.muyu.cloud.background.domin.Product;
|
||||||
import com.muyu.cloud.background.domin.req.ProductListReq;
|
import com.muyu.cloud.background.domin.req.ProductListReq;
|
||||||
|
import com.muyu.cloud.background.domin.req.ProductUpdReq;
|
||||||
import com.muyu.cloud.background.domin.resp.ProductTotalListResp;
|
import com.muyu.cloud.background.domin.resp.ProductTotalListResp;
|
||||||
import com.muyu.cloud.background.mapper.ApiManageMapper;
|
import com.muyu.cloud.background.mapper.ApiManageMapper;
|
||||||
|
|
||||||
|
@ -30,4 +31,12 @@ public interface ApiManageService extends IService<Product> {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Integer> selectproductState();
|
List<Integer> selectproductState();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品上/下线
|
||||||
|
* @param
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void updproductState(ProductUpdReq productUpdReq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.cloud.background.domin.Company;
|
import com.muyu.cloud.background.domin.Company;
|
||||||
import com.muyu.cloud.background.domin.Product;
|
import com.muyu.cloud.background.domin.Product;
|
||||||
import com.muyu.cloud.background.domin.req.ProductListReq;
|
import com.muyu.cloud.background.domin.req.ProductListReq;
|
||||||
|
import com.muyu.cloud.background.domin.req.ProductUpdReq;
|
||||||
import com.muyu.cloud.background.domin.resp.ProductListResp;
|
import com.muyu.cloud.background.domin.resp.ProductListResp;
|
||||||
import com.muyu.cloud.background.domin.resp.ProductTotalListResp;
|
import com.muyu.cloud.background.domin.resp.ProductTotalListResp;
|
||||||
import com.muyu.cloud.background.mapper.ApiManageMapper;
|
import com.muyu.cloud.background.mapper.ApiManageMapper;
|
||||||
|
@ -64,4 +65,16 @@ public class ApiManageServiceImpl extends ServiceImpl<ApiManageMapper, Product>
|
||||||
public List<Integer> selectproductState() {
|
public List<Integer> selectproductState() {
|
||||||
return apiManageMapper.selectproductState();
|
return apiManageMapper.selectproductState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品上/下线
|
||||||
|
* @param
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void updproductState(ProductUpdReq productUpdReq) {
|
||||||
|
apiManageMapper.updproductState(productUpdReq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?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.muyu.cloud.background.mapper.ApiManageMapper">
|
||||||
|
|
||||||
|
<update id="updproductState">
|
||||||
|
update product set product_state=#{productState} where product_id=#{productId}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue