package jnpf.cultivate.v2.controller.app.offline;

import jnpf.base.ActionResult;
import jnpf.cultivate.v2.service.V2CultivateOfflineTrainService;
import jnpf.model.cultivate.v2.offline.V2CultivateOfflineTrainUpdateDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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;

/**
 * app线下培训模块
 */
@RestController
@RequestMapping("/v2/app/cultivate/offline")
public class V2CultivateOfflineTrainAppController {

    @Autowired
    private V2CultivateOfflineTrainService v2CultivateOfflineTrainService;


    /**
     * 修改培训结果
     *
     * @param req 修改培训结果参数
     * @return {@link ActionResult}
     */
    @PostMapping("/modify-training-results")
    public ActionResult<Void> modifyTrainingResults(@RequestBody @Validated V2CultivateOfflineTrainUpdateDTO req) {
        v2CultivateOfflineTrainService.updateTrainingResults(req);
        return ActionResult.success();
    }

}
