package io.renren.modules.generator.controller;

import io.renren.common.utils.R;
import io.renren.datasource.annotation.DataSource;
import io.renren.modules.generator.entity.AlgorithmEntity;
import io.renren.modules.generator.entity.ModelEntity;
import io.renren.modules.generator.service.ModelService;
import io.renren.modules.generator.service.VolumesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author chenrj.xdu@gmail.com
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2021/11/24
 */
@RestController
@RequestMapping("generator/model")
@DataSource("slave2")
public class ModelController {
    @Autowired
    private ModelService modelService;

    /**
     * 修改
     */
    @PostMapping("/update")
    public R update(@RequestBody ModelEntity model) {
        System.out.println(model);
        modelService.updateById(model);

        return R.ok();
    }
}
