package com.heyu.api.controller.mm;


import com.heyu.api.common.annotation.Describe;
import com.heyu.api.data.dao.vv.VvSellerWarehouseDao;
import com.heyu.api.data.entity.vv.VvSellerWarehouseEntity;
import com.heyu.api.data.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/mm/warehouse")
public class AdminSellerWarehouseController {

    @Autowired
    private VvSellerWarehouseDao vvSellerWarehouseDao;


    /****
     *
     * http://localhost:8888/mm/warehouse/insertOrUpdate
     *
     */
    @Describe("仓库添加")
    @RequestMapping("/insertOrUpdate")
    public R add(@RequestBody VvSellerWarehouseEntity warehouseEntity) {
        if(warehouseEntity.getContry() == null){
            warehouseEntity.setContry("中国");
        }

        vvSellerWarehouseDao.insertOrUpdateVvSellerWarehouse(warehouseEntity);
        return R.ok().setData(warehouseEntity);
    }




}


