|
@@ -1,10 +1,20 @@
|
|
|
package edu.travel.commodity.web;
|
|
|
|
|
|
+import edu.travel.commodity.entity.ShopSkuSpecValue;
|
|
|
import edu.travel.commodity.service.ShopSkuSpecValueService;
|
|
|
+import edu.travel.remote.commodity.ShopSkuSpecValueRemoteController;
|
|
|
+import edu.travel.remote.dto.ShopSkuSpecValueDto;
|
|
|
+import edu.travel.remote.vo.ShopSkuSpecValueVo;
|
|
|
+import edu.travel.rpc.RPCBaseResponse;
|
|
|
+import edu.travel.web.BaseController;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
|
|
|
* SKU规格值关联表(shop_sku_spec_value)表控制层
|
|
|
*
|
|
@@ -12,12 +22,81 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/shop_sku_spec_value")
|
|
|
-public class ShopSkuSpecValueController {
|
|
|
+public class ShopSkuSpecValueController extends BaseController<ShopSkuSpecValue> implements ShopSkuSpecValueRemoteController {
|
|
|
|
|
|
* 服务对象
|
|
|
*/
|
|
|
@Autowired
|
|
|
private ShopSkuSpecValueService shopSkuSpecValueService;
|
|
|
+
|
|
|
+ * 通过product_id获取规格
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+ * 通过id获取sku
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public RPCBaseResponse<ShopSkuSpecValueVo> getFormId(@RequestParam("id") String id) {
|
|
|
+ RPCBaseResponse<ShopSkuSpecValue> eduFileRPCBaseResponse = super.getId(id);
|
|
|
+ RPCBaseResponse<ShopSkuSpecValueVo> eduFileVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(eduFileRPCBaseResponse, eduFileVoRPCBaseResponse);
|
|
|
+ return eduFileVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 通过id更新
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public RPCBaseResponse<ShopSkuSpecValueVo> updateTargetFormId(ShopSkuSpecValueDto entity) {
|
|
|
+ ShopSkuSpecValue shopSkuSpecValue = new ShopSkuSpecValue();
|
|
|
+ BeanUtils.copyProperties(entity, shopSkuSpecValue);
|
|
|
+ RPCBaseResponse<ShopSkuSpecValue> eduFileRPCBaseResponse = super.updateTargetById(shopSkuSpecValue);
|
|
|
+ RPCBaseResponse<ShopSkuSpecValueVo> eduFileVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(eduFileRPCBaseResponse, eduFileVoRPCBaseResponse);
|
|
|
+ return eduFileVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 新增
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public RPCBaseResponse<ShopSkuSpecValueVo> saveFormTarget(ShopSkuSpecValueDto entity) {
|
|
|
+ ShopSkuSpecValue shopSkuSpecValue = new ShopSkuSpecValue();
|
|
|
+ BeanUtils.copyProperties(entity, shopSkuSpecValue);
|
|
|
+ RPCBaseResponse<ShopSkuSpecValue> eduFileRPCBaseResponse = super.saveTarget(shopSkuSpecValue);
|
|
|
+ RPCBaseResponse<ShopSkuSpecValueVo> eduFileVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(eduFileRPCBaseResponse, eduFileVoRPCBaseResponse);
|
|
|
+ return eduFileVoRPCBaseResponse;
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
+ * 删除
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public RPCBaseResponse<ShopSkuSpecValueVo> deleteTargetFormId(List<String> ids) {
|
|
|
+ RPCBaseResponse<ShopSkuSpecValue> eduFileRPCBaseResponse = super.deleteTargetById(ids);
|
|
|
+ RPCBaseResponse<ShopSkuSpecValueVo> eduFileVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(eduFileRPCBaseResponse, eduFileVoRPCBaseResponse);
|
|
|
+ return eduFileVoRPCBaseResponse;
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
+ * 查询全部
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public RPCBaseResponse<List<ShopSkuSpecValueVo>> getAllForm() {
|
|
|
+ RPCBaseResponse<List<ShopSkuSpecValue>> eduFileRPCBaseResponse = super.listAll();
|
|
|
+ RPCBaseResponse<List<ShopSkuSpecValueVo>> eduFileVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(eduFileRPCBaseResponse, eduFileVoRPCBaseResponse);
|
|
|
+ return eduFileVoRPCBaseResponse;
|
|
|
+ }
|
|
|
}
|